|
@@ -3,8 +3,12 @@ package cc.iotkit.manager.controller;
|
|
|
import cc.iotkit.common.api.PageRequest;
|
|
|
import cc.iotkit.common.api.Paging;
|
|
|
import cc.iotkit.common.api.Request;
|
|
|
+import cc.iotkit.common.validate.EditGroup;
|
|
|
+import cc.iotkit.common.validate.QueryGroup;
|
|
|
import cc.iotkit.manager.dto.bo.channel.ChannelConfigBo;
|
|
|
+import cc.iotkit.manager.dto.bo.channel.ChannelTemplateBo;
|
|
|
import cc.iotkit.manager.dto.vo.channel.ChannelConfigVo;
|
|
|
+import cc.iotkit.manager.dto.vo.channel.ChannelTemplateVo;
|
|
|
import cc.iotkit.manager.service.NotifyService;
|
|
|
import cc.iotkit.model.notify.Channel;
|
|
|
import cc.iotkit.model.notify.ChannelConfig;
|
|
@@ -41,21 +45,27 @@ public class NotifyController {
|
|
|
return notifyService.getChannelList();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation("获取通道配置列表")
|
|
|
+ @ApiOperation("获取通道配置分页列表")
|
|
|
@PostMapping("/channel/config/getList")
|
|
|
- public Paging<ChannelConfigVo> getChannelConfigList(PageRequest<ChannelConfigBo> request) {
|
|
|
+ public Paging<ChannelConfigVo> getChannelConfigList(@RequestBody @Validated(QueryGroup.class) PageRequest<ChannelConfigBo> request) {
|
|
|
return notifyService.getChannelConfigList(request);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("获取通道配置列表")
|
|
|
+ @PostMapping("/channel/config/getAll")
|
|
|
+ public List<ChannelConfigVo> getChannelConfigAll() {
|
|
|
+ return notifyService.getChannelConfigAll();
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("新增通道配置")
|
|
|
@PostMapping("/channel/config/add")
|
|
|
- public ChannelConfig addChannelConfig(@RequestBody @Validated Request<ChannelConfig> request) {
|
|
|
+ public ChannelConfig addChannelConfig(@RequestBody @Validated(EditGroup.class) Request<ChannelConfig> request) {
|
|
|
return notifyService.addChannelConfig(request.getData());
|
|
|
}
|
|
|
|
|
|
@ApiOperation("根据ID获取通道配置")
|
|
|
@PostMapping("/channel/config/getById")
|
|
|
- public ChannelConfig getChannelConfigById(@RequestBody @Validated Request<String> request) {
|
|
|
+ public ChannelConfig getChannelConfigById(@RequestBody @Validated(QueryGroup.class) Request<Long> request) {
|
|
|
return notifyService.getChannelConfigById(request.getData());
|
|
|
}
|
|
|
|
|
@@ -67,25 +77,25 @@ public class NotifyController {
|
|
|
|
|
|
@ApiOperation("删除通道配置")
|
|
|
@PostMapping("/channel/config/delById")
|
|
|
- public Boolean delChannelConfigById(@RequestBody @Validated Request<String> request) {
|
|
|
+ public Boolean delChannelConfigById(@RequestBody @Validated Request<Long> request) {
|
|
|
return notifyService.delChannelConfigById(request.getData());
|
|
|
}
|
|
|
|
|
|
@ApiOperation("获取通道模板列表")
|
|
|
@PostMapping("/channel/template/getList")
|
|
|
- public List<ChannelTemplate> getChannelTemplateList() {
|
|
|
- return notifyService.getChannelTemplateList();
|
|
|
+ public Paging<ChannelTemplateVo> getChannelTemplateList(@RequestBody @Validated(QueryGroup.class) PageRequest<ChannelTemplateBo> request) {
|
|
|
+ return notifyService.getChannelTemplateList(request);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("新增通道模板")
|
|
|
@PostMapping("/channel/template/add")
|
|
|
- public ChannelTemplate addChannelTemplate(@RequestBody @Validated Request<ChannelTemplate> request) {
|
|
|
+ public ChannelTemplate addChannelTemplate(@RequestBody @Validated(EditGroup.class) Request<ChannelTemplateBo> request) {
|
|
|
return notifyService.addChannelTemplate(request.getData());
|
|
|
}
|
|
|
|
|
|
@ApiOperation("根据ID获取通道模板")
|
|
|
@PostMapping("/channel/template/getById")
|
|
|
- public ChannelTemplate getChannelTemplateById(@RequestBody @Validated Request<String> request) {
|
|
|
+ public ChannelTemplate getChannelTemplateById(@RequestBody @Validated Request<Long> request) {
|
|
|
return notifyService.getChannelTemplateById(request.getData());
|
|
|
}
|
|
|
|
|
@@ -97,7 +107,7 @@ public class NotifyController {
|
|
|
|
|
|
@ApiOperation("删除通道模板")
|
|
|
@PostMapping("/channel/template/delById")
|
|
|
- public Boolean delChannelTemplateById(@RequestBody @Validated Request<String> request) {
|
|
|
+ public Boolean delChannelTemplateById(@RequestBody @Validated(EditGroup.class) Request<Long> request) {
|
|
|
return notifyService.delChannelTemplateById(request.getData());
|
|
|
}
|
|
|
|