From de026326a9df6f4a2192e99cf0e53e7e7b6d445d Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Fri, 24 Oct 2025 17:29:33 +0800
Subject: [PATCH] 1.整理文件管理文件路径。 2.新增航线信息接口业务。 3.优化KMZ文件接口业务逻辑。 4.pom文件修改。 5.增加业务工具类。 6.增加部分业务注解。 7.增加修改无人机状态方法。
---
ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java b/ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java
index 573305c..7a49d70 100644
--- a/ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java
+++ b/ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java
@@ -1,23 +1,33 @@
package com.ard.work.component.forest;
import com.ard.work.domain.entity.ArdServerInfo;
-import com.ard.work.service.IArdServerService;
+import com.ard.work.service.IArdServerInfoService;
import com.dtflys.forest.callback.AddressSource;
import com.dtflys.forest.http.ForestAddress;
import com.dtflys.forest.http.ForestRequest;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
+@Slf4j
@Component
public class MyAddressSource implements AddressSource {
@Resource
- private IArdServerService ardServerService;
+ private IArdServerInfoService ardServerService;
@Override
public ForestAddress getAddress(ForestRequest request) {
String serverKey = request.varAsString("serverId");
- ArdServerInfo serverInfo = ardServerService.selectArdServerManagementById(serverKey);
+ if(serverKey == null){
+ log.warn("请求属性serverId为空");
+ return null;
+ }
+ ArdServerInfo serverInfo = ardServerService.selectArdServerInfoById(serverKey);
+ if(serverInfo == null){
+ log.warn("边缘服务器不存在");
+ return null;
+ }
// 返回 Forest 地址对象
return new ForestAddress(serverInfo.getHost(), serverInfo.getHttpPort());
}
--
Gitblit v1.9.3