ProjectReviewController.java 2.67 KB
package com.zhongzhi.controller;

import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.review.CancelReviewDTO;
import com.zhongzhi.dto.review.ProjectReviewDTO;
import com.zhongzhi.dto.review.SetReviewDTO;
import com.zhongzhi.service.ProjectReviewService;
import com.zhongzhi.vo.ResponseVO;
import com.zhongzhi.vo.review.SendNoticeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 项目评审 前端控制器
 * </p>
 *
 * @author DengMin
 * @since 2021-05-18
 */
@RestController
@Api(tags = "项目评审")
@RequestMapping("/projectReview")
public class ProjectReviewController {

    @Autowired
    private ProjectReviewService projectReviewService;

    @PostMapping(value = "/setReview")
    @LoginRequired({Platform.center})
    @ApiOperation("中心端 ---分配评审:[{projectId}]/项目ID、[{judgeId}]/评委ID、smsMessage/是否发送短信通知(0:不发送,1:发送)")
    public ResponseVO setReview(@RequestBody SetReviewDTO setReviewDTO) {
        projectReviewService.setReview(setReviewDTO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping(value = "/sendNotice")
    @LoginRequired({Platform.center})
    @ApiOperation("中心端 --- 发送通知评审:id/评委ID, matchId/赛事ID")
    public ResponseVO sendNotice(@RequestBody SendNoticeVO sendNoticeVO) {
        projectReviewService.sendNotice(sendNoticeVO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping(value = "/cancelReview")
    @LoginRequired({Platform.center})
    @ApiOperation("中心端  --- 撤销分配:projectId/项目ID、[{judgeId}]/评委ID、smsMessage/是否发送短信通知(0:不发送,1:发送)")
    public ResponseVO cancelReview(@RequestBody CancelReviewDTO cancelReviewVO) {
        projectReviewService.cancelReview(cancelReviewVO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping(value = "/getProjectReview")
    @LoginRequired({Platform.center})
    @ApiOperation("中心端 --- 已分配项目评审员:projectId/项目ID")
    public ResponseVO getProjectReview(@RequestBody ProjectReviewDTO projectReviewDTO) {
        return ResponseData.generateCreatedResponse(0, projectReviewService.getProjectReview(projectReviewDTO));
    }

}