From 22c71b441fd63fbaa240552e82d557e23cfffc00 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Wed, 31 Jul 2024 09:10:39 +0800
Subject: [PATCH] 关闭图片处理
---
src/main/java/com/dji/sample/manage/controller/DeviceController.java | 50 +++++++++++++++++++++++++++++++++++++-------------
1 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/src/main/java/com/dji/sample/manage/controller/DeviceController.java b/src/main/java/com/dji/sample/manage/controller/DeviceController.java
index 9e8870e..3c608b3 100644
--- a/src/main/java/com/dji/sample/manage/controller/DeviceController.java
+++ b/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
@@ -85,19 +109,19 @@
return ResponseResult.success(devicesList);
}
- @GetMapping("/{device_sn}/subscribeTopic")
- public ResponseResult<List<DeviceDTO>> testBinding(@PathVariable("device_sn") String deviceSn) {
- deviceService.subscribeTopicOnline(deviceSn);
-
- return ResponseResult.success();
- }
-
- @GetMapping("/{device_sn}/unsubscribeTopic")
- public ResponseResult<List<DeviceDTO>> testUnBinding(@PathVariable("device_sn") String deviceSn) {
- deviceService.unsubscribeTopicOffline(deviceSn);
-
- return ResponseResult.success();
- }
+// @GetMapping("/{device_sn}/subscribeTopic2")
+// public ResponseResult<List<DeviceDTO>> testBinding(@PathVariable("device_sn") String deviceSn) {
+// deviceService.subscribeTopicOnline(deviceSn);
+//
+// return ResponseResult.success();
+// }
+//
+// @GetMapping("/{device_sn}/unsubscribeTopic2")
+// public ResponseResult<List<DeviceDTO>> testUnBinding(@PathVariable("device_sn") String deviceSn) {
+// deviceService.unsubscribeTopicOffline(deviceSn);
+//
+// return ResponseResult.success();
+// }
/**
* After binding the device to the workspace, the device data can only be seen on the web.
--
Gitblit v1.9.3