国标级联通道共享支持按照设备添加共享和移除共享

This commit is contained in:
648540858
2024-08-29 11:08:42 +08:00
parent 1efb5fca0f
commit e55cd08b08
15 changed files with 179 additions and 146 deletions

View File

@@ -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());
}
}

View File

@@ -18,4 +18,7 @@ public class UpdateChannelParam {
@Schema(description = "待关联的通道ID")
List<Integer> channelIds;
@Schema(description = "待关联的设备ID")
List<Integer> deviceIds;
}