package com.xjrsoft.module.xycxedu.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xjrsoft.common.model.result.RT;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreDto;
import com.xjrsoft.module.xycxedu.service.IExamSubjectScoreService;
import com.xjrsoft.module.xycxedu.vo.ExamSubjectScorePageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
* @title: 考试计划维护
* @Author dzx
* @Date: 2024-07-18
* @Version 1.0
*/
@RestController
@RequestMapping("/xycxedu" + "/ExamSubjectScore")
@Api(value = "/xycxedu"  + "/ExamSubjectScore",tags = "成绩查询代码")
@AllArgsConstructor
public class ExamSubjectScoreController {


    private final IExamSubjectScoreService scoreService;

    @GetMapping(value = "/page")
    @ApiOperation(value="考试成绩查询(分页)")
    @SaCheckPermission("examplan:detail")
    public RT<PageOutput<ExamSubjectScorePageVo>> page(@Valid ExamSubjectScoreDto dto){
        Page<ExamSubjectScorePageVo> page = scoreService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
        PageOutput<ExamSubjectScorePageVo> pageOutput = ConventPage.getPageOutput(page, ExamSubjectScorePageVo.class);
        return RT.ok(pageOutput);
    }


}