Blame view

ProjectReviewPeriodController.java 2.2 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
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.period.ProjectReviewPeriodDTO;
import com.zhongzhi.model.ProjectReviewPeriodDO;
import com.zhongzhi.service.ProjectReviewPeriodService;
import com.zhongzhi.vo.ResponseVO;
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-06-10
 */
@RestController
@Api(tags = "评审时段")
@RequestMapping("/projectReviewPeriod")
public class ProjectReviewPeriodController {

    @Autowired
    private ProjectReviewPeriodService projectReviewPeriodService;

    @PostMapping(value = "/getProjectReviewPeriod")
    @LoginRequired({Platform.center, Platform.school, Platform.review})
    @ApiOperation("中心端(种子赛道、职教赛道) --- 查询评审时间:matchId/赛事年份ID、projectGroup/项目组别(科技创新组、红色文创组、高职、中职)、projectSchedule/项目进度(市级初赛、市级复赛、市级决赛)")
    public ResponseVO getProjectReviewPeriod(@RequestBody ProjectReviewPeriodDTO projectReviewPeriodDTO) {
        return ResponseData.generateCreatedResponse(0, projectReviewPeriodService.getProjectReviewPeriod(projectReviewPeriodDTO));
    }

    @PostMapping(value = "/updateProjectReviewPeriod")
    @LoginRequired(Platform.center)
    @ApiOperation("中心端  --- 修改评审时间:id/ID、matchId/赛事ID、projectGroup/项目组别、projectSchedule/项目进度、startTime/开始时间、endTime/结束时间")
    public ResponseVO updateProjectReviewPeriod(@RequestBody ProjectReviewPeriodDO projectReviewPeriodDO) {
        projectReviewPeriodService.updateProjectReviewPeriod(projectReviewPeriodDO);
        return ResponseData.generateCreatedResponse(0);
    }

}