|
|
@@ -3,6 +3,8 @@ 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.satoken.utils.AuthUtil;
|
|
|
+import cc.iotkit.common.satoken.utils.LoginHelper;
|
|
|
import cc.iotkit.common.validate.EditGroup;
|
|
|
import cc.iotkit.common.validate.QueryGroup;
|
|
|
import cc.iotkit.manager.dto.bo.channel.ChannelConfigBo;
|
|
|
@@ -25,7 +27,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* author: 石恒
|
|
|
@@ -52,6 +56,11 @@ public class NotifyController {
|
|
|
@SaCheckPermission("iot:channel:query")
|
|
|
@PostMapping("/channel/config/getList")
|
|
|
public Paging<ChannelConfigVo> getChannelConfigList(@RequestBody @Validated(QueryGroup.class) PageRequest<ChannelConfigBo> request) {
|
|
|
+ request.getData().setTenantId(LoginHelper.getTenantId());
|
|
|
+ request.getData().setUid(AuthUtil.getUserId());
|
|
|
+ Map<String,String> sortMap = new HashMap<>();
|
|
|
+ sortMap.put("createAt","desc");
|
|
|
+ request.setSortMap(sortMap);
|
|
|
return notifyService.getChannelConfigList(request);
|
|
|
}
|
|
|
|
|
|
@@ -66,6 +75,8 @@ public class NotifyController {
|
|
|
@SaCheckPermission("iot:channel:add")
|
|
|
@PostMapping("/channel/config/add")
|
|
|
public ChannelConfig addChannelConfig(@RequestBody @Validated(EditGroup.class) Request<ChannelConfig> request) {
|
|
|
+ request.getData().setTenantId(LoginHelper.getTenantId());
|
|
|
+ request.getData().setUid(AuthUtil.getUserId());
|
|
|
return notifyService.addChannelConfig(request.getData());
|
|
|
}
|
|
|
|
|
|
@@ -94,6 +105,11 @@ public class NotifyController {
|
|
|
@SaCheckPermission("iot:channel:query")
|
|
|
@PostMapping("/channel/template/getList")
|
|
|
public Paging<ChannelTemplateVo> getChannelTemplateList(@RequestBody @Validated(QueryGroup.class) PageRequest<ChannelTemplateBo> request) {
|
|
|
+ request.getData().setTenantId(LoginHelper.getTenantId());
|
|
|
+ request.getData().setUid(AuthUtil.getUserId());
|
|
|
+ Map<String,String> sortMap = new HashMap<>();
|
|
|
+ sortMap.put("createAt","desc");
|
|
|
+ request.setSortMap(sortMap);
|
|
|
return notifyService.getChannelTemplateList(request);
|
|
|
}
|
|
|
|
|
|
@@ -101,6 +117,8 @@ public class NotifyController {
|
|
|
@SaCheckPermission("iot:channel:add")
|
|
|
@PostMapping("/channel/template/add")
|
|
|
public ChannelTemplate addChannelTemplate(@RequestBody @Validated(EditGroup.class) Request<ChannelTemplateBo> request) {
|
|
|
+ request.getData().setTenantId(LoginHelper.getTenantId());
|
|
|
+ request.getData().setUid(AuthUtil.getUserId());
|
|
|
return notifyService.addChannelTemplate(request.getData());
|
|
|
}
|
|
|
|