Blame view

ProjectReviewController.java 2.67 KB
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
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));
    }

}