package com.ningdatech.pmapi.meeting.controller;


import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq;
import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq.Basic;
import com.ningdatech.pmapi.meeting.manage.MeetingExpertJudgeManage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author WendyYang
 * @since 2023-07-31
 */
@Api(tags = "履职评价管理")
@AllArgsConstructor
@RestController
@RequestMapping("/api/v1/meeting/expert-judge")
public class MeetingExpertJudgeController {

    private final MeetingExpertJudgeManage expertJudgeManage;

    @ApiOperation("保存履职评价")
    @PostMapping("/submit")
    public void saveExpertJudge(@Validated(Basic.class) @RequestBody MeetingExpertJudgeReq req) {
        expertJudgeManage.saveExpertJudge(req);
    }

    @ApiOperation("查看履职评价")
    @GetMapping("/detail/{meetingExpertId}")
    public MeetingExpertJudgeReq expertJudgeDetail(@PathVariable Long meetingExpertId) {
        return expertJudgeManage.expertJudgeDetail(meetingExpertId);
    }

}
