package com.changhu.module.superManagement.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.changhu.common.annotation.CheckUserType;
import com.changhu.common.annotation.JsonBody;
import com.changhu.common.db.enums.UserType;
import com.changhu.module.superManagement.pojo.queryParams.AssessmentRecordPagerQueryParams;
import com.changhu.module.superManagement.pojo.vo.AssessmentRecordDetailVo;
import com.changhu.module.superManagement.pojo.vo.AssessmentRecordPagerVo;
import com.changhu.module.superManagement.service.AssessmentRecordService;
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("/m1/ar")
@CheckUserType(userTypes = {UserType.MANAGEMENT_POLICE, UserType.MANAGEMENT_SUPER})
@RestController
public class AssessmentRecordController {

    @Autowired
    private AssessmentRecordService 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);
    }

}
