| | |
| | | } |
| | | |
| | | /** |
| | | * 手动在线 |
| | | * @param workspaceId |
| | | * @param receiver |
| | | * @return |
| | | */ |
| | | @PostMapping("/{workspace_id}/deviceOnline") |
| | | public ResponseResult<List<DeviceDTO>> deviceOnline(@PathVariable("workspace_id") String workspaceId, |
| | | @RequestBody CommonTopicReceiver<StatusGatewayReceiver> receiver) { |
| | | boolean offline = deviceService.deviceOnline(receiver.getData()); |
| | | if (offline) { |
| | | // Notify pilot that the device is offline successfully. |
| | | deviceService.publishStatusReply(receiver.getData().getSn(), |
| | | CommonTopicResponse.builder() |
| | | .tid(receiver.getTid()) |
| | | .bid(receiver.getBid()) |
| | | .timestamp(System.currentTimeMillis()) |
| | | .method(receiver.getMethod()) |
| | | .build()); |
| | | |
| | | } |
| | | return ResponseResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * Get the topology list of all online devices in one workspace. |
| | | * @param workspaceId |
| | | * @return |