| | |
| | | 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; |
| | |
| | | public class MyAddressSource implements AddressSource { |
| | | |
| | | @Resource |
| | | private IArdServerService ardServerService; |
| | | private IArdServerInfoService ardServerService; |
| | | @Override |
| | | public ForestAddress getAddress(ForestRequest request) { |
| | | String serverKey = (String) request.getVariableValue("serverId"); |
| | | String serverKey = request.varAsString("serverId"); |
| | | ArdServerInfo serverInfo = ardServerService.selectArdServerManagementById(serverKey); |
| | | // 返回 Forest 地址对象 |
| | | return new ForestAddress(serverInfo.getHost(), serverInfo.getHttpPort()); |