ClassNoticeController.java
2.44 KB
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
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.classNotice.SendNotificationDTO;
import com.subsidy.model.ClassNoticeDO;
import com.subsidy.service.ClassNoticeService;
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;
import io.swagger.annotations.Api;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2022-01-21
*/
@RestController
@Api(tags = "课程通知")
@RequestMapping("/classNotice")
public class ClassNoticeController {
@Autowired
private ClassNoticeService classNoticeService;
@PostMapping("addNotice")
@ApiOperation("新增一个通知 classId noticeType isAuto noticeTime")
public ResponseVO addNotice(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.addNotice(classNoticeDO));
}
@PostMapping("updateNotice")
@ApiOperation("修改一个通知 id noticeType isAuto noticeTime")
public ResponseVO updateNotice(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.updateNotice(classNoticeDO));
}
@PostMapping("deleteNotice")
@ApiOperation("删除一个通知 id")
public ResponseVO deleteNotice(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.deleteNotice(classNoticeDO));
}
@PostMapping("queryClassNotices")
@ApiOperation("查看某个课程的通知提醒 classId 课程id status 状态(待发送/已发送)")
public ResponseVO queryClassNotices(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.queryClassNotices(classNoticeDO));
}
@PostMapping("sendClassNotices")
@ApiOperation("发送通知:classId/课程Id sendType/发送类型(全部成员/未签到成员/未完课成员)")
public ResponseVO sendClassNotices(@RequestBody SendNotificationDTO sendNotificationDTO) {
classNoticeService.sendNotification(sendNotificationDTO);
return ResponseData.generateCreatedResponse(0);
}
}