From a7aaeabc7873a0eafb4a7ecad7f65b018b7a9bc9 Mon Sep 17 00:00:00 2001
From: sean.zhou <sean.zhou@dji.com>
Date: Fri, 24 Feb 2023 19:31:23 +0800
Subject: [PATCH] What's new? 1. Add license for dock. 2. Modify the logic corresponding to the firmware file and device type. 3. Add multiple mqtt clients options. 4. Modify the structure of the interface for obtaining the device list. 5. Fixed some issues.

---
 src/main/java/com/dji/sample/map/controller/WorkspaceElementController.java |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/dji/sample/map/controller/WorkspaceElementController.java b/src/main/java/com/dji/sample/map/controller/WorkspaceElementController.java
index 1ad52b8..8afaf16 100644
--- a/src/main/java/com/dji/sample/map/controller/WorkspaceElementController.java
+++ b/src/main/java/com/dji/sample/map/controller/WorkspaceElementController.java
@@ -4,8 +4,8 @@
 import com.dji.sample.common.model.ResponseResult;
 import com.dji.sample.component.websocket.model.BizCodeEnum;
 import com.dji.sample.component.websocket.model.CustomWebSocketMessage;
-import com.dji.sample.component.websocket.model.WebSocketManager;
 import com.dji.sample.component.websocket.service.ISendMessageService;
+import com.dji.sample.component.websocket.service.IWebSocketManageService;
 import com.dji.sample.map.model.dto.*;
 import com.dji.sample.map.service.IWorkspaceElementService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,6 +33,9 @@
 
     @Autowired
     private ISendMessageService sendMessageService;
+
+    @Autowired
+    private IWebSocketManageService webSocketManageService;
 
     /**
      * In the first connection, pilot will send out this http request to obtain the group element list.
@@ -78,7 +81,7 @@
         elementService.getElementByElementId(elementCreate.getId())
                 .ifPresent(groupElement ->
                         sendMessageService.sendBatch(
-                                WebSocketManager.getValueWithWorkspace(workspaceId),
+                                webSocketManageService.getValueWithWorkspace(workspaceId),
                                 CustomWebSocketMessage.<GroupElementDTO>builder()
                                         .timestamp(System.currentTimeMillis())
                                         .bizCode(BizCodeEnum.MAP_ELEMENT_CREATE.getCode())
@@ -114,7 +117,7 @@
         elementService.getElementByElementId(elementId)
                 .ifPresent(groupElement ->
                         sendMessageService.sendBatch(
-                                WebSocketManager.getValueWithWorkspace(workspaceId),
+                                webSocketManageService.getValueWithWorkspace(workspaceId),
                                 CustomWebSocketMessage.<GroupElementDTO>builder()
                                         .timestamp(System.currentTimeMillis())
                                         .bizCode(BizCodeEnum.MAP_ELEMENT_UPDATE.getCode())
@@ -142,7 +145,7 @@
         if (ResponseResult.CODE_SUCCESS == response.getCode()) {
             elementOpt.ifPresent(element ->
                     sendMessageService.sendBatch(
-                    WebSocketManager.getValueWithWorkspace(workspaceId),
+                    webSocketManageService.getValueWithWorkspace(workspaceId),
                             CustomWebSocketMessage.<WebSocketElementDelDTO>builder()
                                     .timestamp(System.currentTimeMillis())
                                     .bizCode(BizCodeEnum.MAP_ELEMENT_DELETE.getCode())
@@ -171,7 +174,7 @@
         if (ResponseResult.CODE_SUCCESS == response.getCode()) {
 
             sendMessageService.sendBatch(
-                    WebSocketManager.getValueWithWorkspace(workspaceId),
+                    webSocketManageService.getValueWithWorkspace(workspaceId),
                     CustomWebSocketMessage.builder()
                             .timestamp(System.currentTimeMillis())
                             .bizCode(BizCodeEnum.MAP_GROUP_REFRESH.getCode())

--
Gitblit v1.9.3