package cn.iocoder.yudao.module.appBase.controller;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
import cn.iocoder.yudao.module.jx.domain.DriveSchoolInfo;
import cn.iocoder.yudao.module.jx.service.IDriveSchoolInfoService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 驾校信息Controller
 *
 * @author ruoyi
 * @date 2024-03-19
 */
@RestController
@RequestMapping("/drivingSchool/applet/schoolInfo")
public class DriveSchoolInfoAppletController extends BaseController
{
    @Autowired
    private IDriveSchoolInfoService driveSchoolInfoService;

    /**
     * 查询驾校信息列表
     */
    @GetMapping("/list")
    public CommonResult<IPage<?>> list(DriveSchoolInfo driveSchoolInfo)
    {
        Page<DriveSchoolInfo> page = new Page<>(driveSchoolInfo.getPageNum(), driveSchoolInfo.getPageSize());
        IPage<DriveSchoolInfo> driveSchoolInfoIPage = driveSchoolInfoService.selectDriveSchoolInfoAppletList(driveSchoolInfo, page);
        return success(driveSchoolInfoIPage);
    }

    /**
     * 获取驾校信息详细信息
     */
    @GetMapping(value = "/{id}")
    public CommonResult getInfo(@PathVariable("id") Long id)
    {
        return success(driveSchoolInfoService.selectDriveSchoolInfoById(id));
    }
}
