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.DriveSchoolCoach;
import cn.iocoder.yudao.module.jx.service.IDriveSchoolCoachService;
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;

import java.util.List;

/**
 * 驾校教练Controller
 *
 * @author ruoyi
 * @date 2024-03-29
 */
@RestController
@RequestMapping("/admin-api/drivingSchool/applet/schoolCoach")
public class DriveSchoolCoachAppletController extends BaseController
{
    @Autowired
    private IDriveSchoolCoachService driveSchoolCoachService;

    /**
     * 查询驾校教练列表(前两个)
     */
    @GetMapping("/limitList")
    public CommonResult limitList(DriveSchoolCoach driveSchoolCoach)
    {
        List<DriveSchoolCoach> list = driveSchoolCoachService.selectDriveSchoolCoachLimitList(driveSchoolCoach);
        return CommonResult.success(list);
    }

    /**
     * 查询驾校教练列表(更多)
     */
    @GetMapping("/listAll")
    public CommonResult list(DriveSchoolCoach driveSchoolCoach)
    {
        List<DriveSchoolCoach> list = driveSchoolCoachService.selectDriveSchoolCoachListAll(driveSchoolCoach);
        return CommonResult.success(list);
    }

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