Blame view

SmsNoticeController.java 2.11 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
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.notice.SmsNoticeDTO;
import com.zhongzhi.dto.notice.SmsNoticePageDTO;
import com.zhongzhi.service.SmsNoticeService;
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 2022-04-15
 */
@RestController
@Api(tags = "短信通知")
@RequestMapping("/smsNotice")
public class SmsNoticeController {

    @Autowired
    private SmsNoticeService smsNoticeService;

    @PostMapping(value = "batchSend")
    @LoginRequired({Platform.center})
    @ApiOperation("管理端 -- 批量发送短信:matchId/赛事年份ID、projectGroup/组别、projectSchedule/阶段、projectStatus/状态、name/搜索名称")
    public ResponseVO batchSend(@RequestBody SmsNoticeDTO smsNoticeDTO) {
        smsNoticeService.batchSend(smsNoticeDTO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping(value = "send")
    @LoginRequired({Platform.center})
    @ApiOperation("管理端 -- 发送短信:ids/项目ID(数组)")
    public ResponseVO send(@RequestBody SmsNoticeDTO smsNoticeDTO) {
        smsNoticeService.send(smsNoticeDTO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping(value = "getListByPage")
    @LoginRequired({Platform.center})
    @ApiOperation("管理端 -- 发送短信记录:date/日期、name/搜索名称、pageNo、pageSize")
    public ResponseVO getListByPage(@RequestBody SmsNoticePageDTO smsNoticePageDTO) {
        return ResponseData.generateCreatedResponse(0, smsNoticeService.getListByPage(smsNoticePageDTO));
    }

}