rain
2024-08-15 2927bb498574a0e30bcbb3a9f7ee9468636cf0d8
src/main/java/com/dji/sample/manage/controller/DeviceController.java
@@ -74,6 +74,30 @@
    }
    /**
     * 手动在线
     * @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