zhongrj
2023-06-02 da5605b69bfc5772465e17d7166ce5bab3490e76
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
package cn.gistack.alerts.notice.controller;
 
import cn.gistack.alerts.notice.strategy.NoticeStrategyContext;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 通知信息控制层
 * @author zhongrj
 * @date 2023-05-29
 */
@RestController
@AllArgsConstructor
@RequestMapping("/notice/notice")
public class NoticeController {
 
    private final NoticeStrategyContext applicationContext;
 
    /**
     * 调用任务通知
     * @param type 策略分类
     * @param name 任务名称
     * @param content 内容(可以不传)
     * @return
     */
    @GetMapping("/toNotice")
    public Object toNotice(String type,String name,String content){
        return applicationContext.doSomethingByStrategy(name, content, type);
    }
 
 
}