package com.ningdatech.pmapi.performance.controller;

import javax.validation.Valid;

import com.ningdatech.pmapi.performance.manage.VerifyManage;
import org.springframework.web.bind.annotation.*;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalDTO;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;

/**
 * VerifyController
 * @return
 * @author CMM
 * @since 2023/08/10 8:54
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "绩效评价-专家核查")
@RequestMapping("/api/v1/verify")
public class VerifyController {

    private final VerifyManage verifyManage;

    @GetMapping("/list")
    @ApiOperation("当前核查用户的绩效评价计划列表")
    public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) {
        return verifyManage.list(req);
    }

    @GetMapping("/group-project-list/{groupId}")
    @ApiOperation("当前核查用户所在分组核查项目列表")
    public PageVo<PerformanceAppraisalProjectVO> groupProjectList(@PathVariable Long groupId, PerformanceAppraisalListReq req) {
        return verifyManage.groupProjectList(groupId,req);
    }

    @PostMapping("/submit-verify")
    @ApiOperation("提交核查")
    public String submitVerify(@Valid @RequestBody ProjectAppraisalDTO param){
        return verifyManage.submitVerify(param);
    }

}
