package cn.iocoder.yudao.module.base.controller.admin;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStaffService;
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 驾校人员管理通用Controller")
@RestController
@RequestMapping("/base/drive-school-staff")
@Validated
public class DlDriveSchoolStaffController {
    @Resource
    private DlDriveSchoolStaffService staffService;

    /**
     * 手机APP分页获取人员信息
     *
     * @param staffVO  {@link DlDriveSchoolStaffVO}
     * @param pageNo   分页参数
     * @param pageSize 分页参数
     * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<com.baomidou.mybatisplus.core.metadata.IPage < ?>>
     * @author PQZ
     * @date 13:49 2025/2/6
     **/
    @GetMapping("/pageStaff")
    @Operation(summary = "分页获取人员信息")
    public CommonResult<IPage<?>> pageStaff(DlDriveSchoolStaffVO staffVO,
                                            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
        Page<DlDriveSchoolStaffVO> page = new Page<>(pageNo, pageSize);
        return success(staffService.pageStaff(staffVO, page));
    }


}