国标级联通道共享支持按照设备添加共享和移除共享
This commit is contained in:
@@ -259,4 +259,24 @@ public class PlatformController {
|
||||
Assert.notNull(id, "平台ID不可为空");
|
||||
platformChannelService.pushChannel(id);
|
||||
}
|
||||
|
||||
@Operation(summary = "添加通道-通过设备", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@PostMapping("/channel/device/add")
|
||||
@ResponseBody
|
||||
public void addChannelByDevice(@RequestBody UpdateChannelParam param) {
|
||||
Assert.notNull(param.getPlatformId(), "平台ID不可为空");
|
||||
Assert.notNull(param.getDeviceIds(), "设备ID不可为空");
|
||||
Assert.notEmpty(param.getDeviceIds(), "设备ID不可为空");
|
||||
platformChannelService.addChannelByDevice(param.getPlatformId(), param.getDeviceIds());
|
||||
}
|
||||
|
||||
@Operation(summary = "移除通道-通过设备", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@PostMapping("/channel/device/remove")
|
||||
@ResponseBody
|
||||
public void removeChannelByDevice(@RequestBody UpdateChannelParam param) {
|
||||
Assert.notNull(param.getPlatformId(), "平台ID不可为空");
|
||||
Assert.notNull(param.getDeviceIds(), "设备ID不可为空");
|
||||
Assert.notEmpty(param.getDeviceIds(), "设备ID不可为空");
|
||||
platformChannelService.removeChannelByDevice(param.getPlatformId(), param.getDeviceIds());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,7 @@ public class UpdateChannelParam {
|
||||
|
||||
@Schema(description = "待关联的通道ID")
|
||||
List<Integer> channelIds;
|
||||
|
||||
@Schema(description = "待关联的设备ID")
|
||||
List<Integer> deviceIds;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user