From 3a92dc7ef668997c9b8cecb6ee23618db8bfae13 Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Tue, 28 Oct 2025 16:24:07 +0800
Subject: [PATCH] 2025-10-28 zwy 更新,机场状态返回的3个JSON文档添加type值,区分三个文档,方便前端取值。

---
 ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 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 079e96c..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
@@ -5,10 +5,12 @@
 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 {
 
@@ -17,7 +19,15 @@
     @Override
     public ForestAddress getAddress(ForestRequest request) {
         String serverKey = request.varAsString("serverId");
+        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