From f905f4377db462640a4fdd53dc5daa1adfc8c542 Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Tue, 14 Oct 2025 18:30:57 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java | 24 ++++++++++++++++++++++++
1 files changed, 24 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
new file mode 100644
index 0000000..1b1e497
--- /dev/null
+++ b/ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java
@@ -0,0 +1,24 @@
+package com.ard.work.component.forest;
+
+import com.ard.work.domain.entity.ArdServerInfo;
+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 org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+@Component
+public class MyAddressSource implements AddressSource {
+
+ @Resource
+ private IArdServerInfoService ardServerService;
+ @Override
+ public ForestAddress getAddress(ForestRequest request) {
+ String serverKey = request.varAsString("serverId");
+ ArdServerInfo serverInfo = ardServerService.selectArdServerManagementById(serverKey);
+ // 返回 Forest 地址对象
+ return new ForestAddress(serverInfo.getHost(), serverInfo.getHttpPort());
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.3