zhaowenyu
2025-10-15 a9780c49f8cf587af26cc83d439320ad02b8668f
ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java
@@ -1,7 +1,7 @@
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;
@@ -13,11 +13,11 @@
public class MyAddressSource implements AddressSource {
    @Resource
    private IArdServerService ardServerService;
    private IArdServerInfoService ardServerService;
    @Override
    public ForestAddress getAddress(ForestRequest request) {
        String serverKey = (String) request.getVariableValue("serverId");
        ArdServerInfo serverInfo = ardServerService.selectArdServerManagementById(serverKey);
        String serverKey = request.varAsString("serverId");
        ArdServerInfo serverInfo = ardServerService.selectArdServerInfoById(serverKey);
        // 返回 Forest 地址对象
        return new ForestAddress(serverInfo.getHost(), serverInfo.getHttpPort());
    }