From 2caa210098644f51ff46daa33b87ce4b7f862a91 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 13 Nov 2023 10:12:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/htxx_dev' into htxx_dev

---
 src/main/java/com/dji/sample/manage/controller/DeviceController.java |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 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 9fcc72d..df16a22 100644
--- a/src/main/java/com/dji/sample/manage/controller/DeviceController.java
+++ b/src/main/java/com/dji/sample/manage/controller/DeviceController.java
@@ -85,6 +85,20 @@
         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();
+    }
+
     /**
      * After binding the device to the workspace, the device data can only be seen on the web.
      * @param device
@@ -108,7 +122,7 @@
     public ResponseResult getDevice(@PathVariable("workspace_id") String workspaceId,
                                                @PathVariable("device_sn") String deviceSn) {
         Optional<DeviceDTO> deviceOpt = deviceService.getDeviceBySn(deviceSn);
-        return deviceOpt.isEmpty() ? ResponseResult.error("device not found.") : ResponseResult.success(deviceOpt.get());
+        return deviceOpt.isEmpty() ? ResponseResult.error("设备未找到") : ResponseResult.success(deviceOpt.get());
     }
 
     /**
@@ -189,4 +203,4 @@
         deviceService.devicePropertySet(workspaceId, dockSn, propertyEnumOpt.get(), param.get(property));
         return ResponseResult.success();
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.9.3