package com.changhu.module.assessmentCriteria.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.changhu.common.annotation.JsonBody;
import com.changhu.module.assessmentCriteria.pojo.queryParams.AssessmentRecordPagerQueryParams;
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordDetailVo;
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordPagerVo;
import com.changhu.module.assessmentCriteria.service.CkAssessmentRecordService;
import com.changhu.support.mybatisplus.pojo.params.PageParams;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 20252
 * @createTime 2024/11/8 下午3:51
 * @desc AssessmentRecordController...
 */
@Tag(name = "考核记录详情")
@JsonBody
@RequestMapping("/assessmentRecord")
public class AssessmentRecordController {

    @Autowired
    private CkAssessmentRecordService assessmentRecordService;

    @Operation(summary = "考核记录分页")
    @PostMapping("/pager")
    public Page<AssessmentRecordPagerVo> pager(@RequestBody PageParams<AssessmentRecordPagerQueryParams, AssessmentRecordPagerVo> queryParams) {
        return assessmentRecordService.pager(queryParams);
    }

    @Operation(summary = "扣分详情")
    @GetMapping("/deductedDetail")
    public List<AssessmentRecordDetailVo> deductedDetail(@RequestParam Long assessmentRecordId) {
        return assessmentRecordService.deductedDetail(assessmentRecordId);
    }

}
