diff --git a/ff-game/src/main/java/com/ff/game/api/ae/address/MyAEAddressSource.java b/ff-game/src/main/java/com/ff/game/api/ae/address/MyAEAddressSource.java index 21eba22..01a76ab 100644 --- a/ff-game/src/main/java/com/ff/game/api/ae/address/MyAEAddressSource.java +++ b/ff-game/src/main/java/com/ff/game/api/ae/address/MyAEAddressSource.java @@ -3,8 +3,8 @@ package com.ff.game.api.ae.address; import com.dtflys.forest.callback.AddressSource; import com.dtflys.forest.http.ForestAddress; import com.dtflys.forest.http.ForestRequest; -import com.ff.base.constant.Constants; -import com.ff.base.system.service.ISysConfigService; +import com.ff.base.enums.GamePlatforms; +import com.ff.game.service.IPlatformService; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -20,12 +20,12 @@ import javax.annotation.Resource; public class MyAEAddressSource implements AddressSource { @Resource - private ISysConfigService configService; - + private IPlatformService platformService; @Override public ForestAddress getAddress(ForestRequest request) { - String apiBaseUrl = configService.selectConfigByKey(Constants.AE_API_BASE_URL); - return new ForestAddress("https",apiBaseUrl, 443,""); + String apiBaseUrl = platformService.get(GamePlatforms.AE.getCode()) + .getUrlInfo().getUrl(); + return new ForestAddress("https", apiBaseUrl, 443, ""); } } \ No newline at end of file diff --git a/ff-game/src/main/java/com/ff/game/api/dg/address/MyDGAddressSource.java b/ff-game/src/main/java/com/ff/game/api/dg/address/MyDGAddressSource.java index 9bf5985..b98459f 100644 --- a/ff-game/src/main/java/com/ff/game/api/dg/address/MyDGAddressSource.java +++ b/ff-game/src/main/java/com/ff/game/api/dg/address/MyDGAddressSource.java @@ -3,8 +3,8 @@ package com.ff.game.api.dg.address; import com.dtflys.forest.callback.AddressSource; import com.dtflys.forest.http.ForestAddress; import com.dtflys.forest.http.ForestRequest; -import com.ff.base.constant.Constants; -import com.ff.base.system.service.ISysConfigService; +import com.ff.base.enums.GamePlatforms; +import com.ff.game.service.IPlatformService; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -20,12 +20,12 @@ import javax.annotation.Resource; public class MyDGAddressSource implements AddressSource { @Resource - private ISysConfigService configService; - + private IPlatformService platformService; @Override public ForestAddress getAddress(ForestRequest request) { - String apiBaseUrl = configService.selectConfigByKey(Constants.DG_API_BASE_URL); - return new ForestAddress("http",apiBaseUrl, 80,""); + String apiBaseUrl = platformService.get(GamePlatforms.DG.getCode()) + .getUrlInfo().getUrl(); + return new ForestAddress("http", apiBaseUrl, 80, ""); } } \ No newline at end of file diff --git a/ff-game/src/main/java/com/ff/game/api/fc/address/MyFCAddressSource.java b/ff-game/src/main/java/com/ff/game/api/fc/address/MyFCAddressSource.java index e67a7f0..a7edbdf 100644 --- a/ff-game/src/main/java/com/ff/game/api/fc/address/MyFCAddressSource.java +++ b/ff-game/src/main/java/com/ff/game/api/fc/address/MyFCAddressSource.java @@ -3,8 +3,8 @@ package com.ff.game.api.fc.address; import com.dtflys.forest.callback.AddressSource; import com.dtflys.forest.http.ForestAddress; import com.dtflys.forest.http.ForestRequest; -import com.ff.base.constant.Constants; -import com.ff.base.system.service.ISysConfigService; +import com.ff.base.enums.GamePlatforms; +import com.ff.game.service.IPlatformService; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -13,12 +13,13 @@ import javax.annotation.Resource; public class MyFCAddressSource implements AddressSource { @Resource - private ISysConfigService configService; + private IPlatformService platformService; @Override public ForestAddress getAddress(ForestRequest request) { - String apiBaseUrl = configService.selectConfigByKey(Constants.FC_API_BASE_URL); - return new ForestAddress("https",apiBaseUrl, 443,""); + String apiBaseUrl = platformService.get(GamePlatforms.FC.getCode()) + .getUrlInfo().getUrl(); + return new ForestAddress("https", apiBaseUrl, 443, ""); } } diff --git a/ff-game/src/main/java/com/ff/game/api/jili/address/MyJILIAddressSource.java b/ff-game/src/main/java/com/ff/game/api/jili/address/MyJILIAddressSource.java index d27b734..66ef096 100644 --- a/ff-game/src/main/java/com/ff/game/api/jili/address/MyJILIAddressSource.java +++ b/ff-game/src/main/java/com/ff/game/api/jili/address/MyJILIAddressSource.java @@ -3,13 +3,11 @@ package com.ff.game.api.jili.address; import com.dtflys.forest.callback.AddressSource; import com.dtflys.forest.http.ForestAddress; import com.dtflys.forest.http.ForestRequest; -import com.ff.base.constant.Constants; -import com.ff.base.system.service.ISysConfigService; -import org.springframework.beans.factory.annotation.Autowired; +import com.ff.base.enums.GamePlatforms; +import com.ff.game.service.IPlatformService; import org.springframework.stereotype.Component; import javax.annotation.Resource; -import java.util.Random; /** @@ -19,15 +17,15 @@ import java.util.Random; * @date 2025/02/10 */ @Component -public class MyJILIAddressSource implements AddressSource { +public class MyJILIAddressSource implements AddressSource { @Resource - private ISysConfigService configService; - + private IPlatformService platformService; @Override public ForestAddress getAddress(ForestRequest request) { - String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL); - return new ForestAddress("https",apiBaseUrl, 443,"api1"); + String apiBaseUrl = platformService.get(GamePlatforms.FC.getCode()) + .getUrlInfo().getUrl(); + return new ForestAddress("https", apiBaseUrl, 443, "api1"); } } \ No newline at end of file diff --git a/ff-game/src/main/java/com/ff/game/api/km/address/MyKMAddressSource.java b/ff-game/src/main/java/com/ff/game/api/km/address/MyKMAddressSource.java index a5a3621..c93baab 100644 --- a/ff-game/src/main/java/com/ff/game/api/km/address/MyKMAddressSource.java +++ b/ff-game/src/main/java/com/ff/game/api/km/address/MyKMAddressSource.java @@ -3,8 +3,8 @@ package com.ff.game.api.km.address; import com.dtflys.forest.callback.AddressSource; import com.dtflys.forest.http.ForestAddress; import com.dtflys.forest.http.ForestRequest; -import com.ff.base.constant.Constants; -import com.ff.base.system.service.ISysConfigService; +import com.ff.base.enums.GamePlatforms; +import com.ff.game.service.IPlatformService; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -20,12 +20,12 @@ import javax.annotation.Resource; public class MyKMAddressSource implements AddressSource { @Resource - private ISysConfigService configService; - + private IPlatformService platformService; @Override public ForestAddress getAddress(ForestRequest request) { - String apiBaseUrl = configService.selectConfigByKey(Constants.KM_API_BASE_URL_LOGIN); - return new ForestAddress("https",apiBaseUrl, 443,"api"); + String apiBaseUrl = platformService.get(GamePlatforms.KM.getCode()) + .getUrlInfo().getUrl(); + return new ForestAddress("https", apiBaseUrl, 443, "api"); } } \ No newline at end of file diff --git a/ff-game/src/main/java/com/ff/game/api/ng/address/MyNGAddressSource.java b/ff-game/src/main/java/com/ff/game/api/ng/address/MyNGAddressSource.java index 7f1a0d0..c1b3d32 100644 --- a/ff-game/src/main/java/com/ff/game/api/ng/address/MyNGAddressSource.java +++ b/ff-game/src/main/java/com/ff/game/api/ng/address/MyNGAddressSource.java @@ -3,22 +3,24 @@ package com.ff.game.api.ng.address; import com.dtflys.forest.callback.AddressSource; import com.dtflys.forest.http.ForestAddress; import com.dtflys.forest.http.ForestRequest; -import com.ff.base.constant.Constants; -import com.ff.base.system.service.ISysConfigService; +import com.ff.base.enums.GamePlatforms; +import com.ff.game.service.IPlatformService; import org.springframework.stereotype.Component; import javax.annotation.Resource; @Component -public class MyNGAddressSource implements AddressSource { +public class MyNGAddressSource implements AddressSource { @Resource - private ISysConfigService configService; + private IPlatformService platformService; @Override public ForestAddress getAddress(ForestRequest request) { - String apiBaseUrl = configService.selectConfigByKey(Constants.NG_API_BASE_URL); - return new ForestAddress("https",apiBaseUrl, 443,"api"); + //String apiBaseUrl = configService.selectConfigByKey(Constants.NG_API_BASE_URL); + String apiBaseUrl = platformService.get(GamePlatforms.PG.getCode()) + .getUrlInfo().getUrl(); + return new ForestAddress("https", apiBaseUrl, 443, "api"); } } diff --git a/ff-game/src/main/java/com/ff/game/api/pgx/address/MyPGXAddressSource.java b/ff-game/src/main/java/com/ff/game/api/pgx/address/MyPGXAddressSource.java index 5bd6c65..e3349d0 100644 --- a/ff-game/src/main/java/com/ff/game/api/pgx/address/MyPGXAddressSource.java +++ b/ff-game/src/main/java/com/ff/game/api/pgx/address/MyPGXAddressSource.java @@ -3,8 +3,8 @@ package com.ff.game.api.pgx.address; import com.dtflys.forest.callback.AddressSource; import com.dtflys.forest.http.ForestAddress; import com.dtflys.forest.http.ForestRequest; -import com.ff.base.constant.Constants; -import com.ff.base.system.service.ISysConfigService; +import com.ff.base.enums.GamePlatforms; +import com.ff.game.service.IPlatformService; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -20,12 +20,13 @@ import javax.annotation.Resource; public class MyPGXAddressSource implements AddressSource { @Resource - private ISysConfigService configService; - + private IPlatformService platformService; @Override public ForestAddress getAddress(ForestRequest request) { - String apiBaseUrl = configService.selectConfigByKey(Constants.PGX_API_BASE_URL); - return new ForestAddress("http",apiBaseUrl, 80,""); +// String apiBaseUrl = configService.selectConfigByKey(Constants.PGX_API_BASE_URL); + String apiBaseUrl = platformService.get(GamePlatforms.PGX.getCode()) + .getUrlInfo().getUrl(); + return new ForestAddress("http", apiBaseUrl, 80, ""); } } \ No newline at end of file diff --git a/ff-game/src/main/java/com/ff/game/api/sa/address/MySAAddressSource.java b/ff-game/src/main/java/com/ff/game/api/sa/address/MySAAddressSource.java index 5ee8a89..de51edf 100644 --- a/ff-game/src/main/java/com/ff/game/api/sa/address/MySAAddressSource.java +++ b/ff-game/src/main/java/com/ff/game/api/sa/address/MySAAddressSource.java @@ -3,8 +3,8 @@ package com.ff.game.api.sa.address; import com.dtflys.forest.callback.AddressSource; import com.dtflys.forest.http.ForestAddress; import com.dtflys.forest.http.ForestRequest; -import com.ff.base.constant.Constants; -import com.ff.base.system.service.ISysConfigService; +import com.ff.base.enums.GamePlatforms; +import com.ff.game.service.IPlatformService; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -20,12 +20,14 @@ import javax.annotation.Resource; public class MySAAddressSource implements AddressSource { @Resource - private ISysConfigService configService; + private IPlatformService platformService; @Override public ForestAddress getAddress(ForestRequest request) { - String apiBaseUrl = configService.selectConfigByKey(Constants.SA_API_BASE_URL); - return new ForestAddress("https",apiBaseUrl, 443,"api"); +// String apiBaseUrl = configService.selectConfigByKey(Constants.SA_API_BASE_URL); + String apiBaseUrl = platformService.get(GamePlatforms.SA.getCode()) + .getUrlInfo().getUrl(); + return new ForestAddress("https", apiBaseUrl, 443, "api"); } } \ No newline at end of file diff --git a/ff-game/src/main/java/com/ff/game/api/xk/address/MyXKAddressSource.java b/ff-game/src/main/java/com/ff/game/api/xk/address/MyXKAddressSource.java index 56ecda7..64144db 100644 --- a/ff-game/src/main/java/com/ff/game/api/xk/address/MyXKAddressSource.java +++ b/ff-game/src/main/java/com/ff/game/api/xk/address/MyXKAddressSource.java @@ -3,8 +3,8 @@ package com.ff.game.api.xk.address; import com.dtflys.forest.callback.AddressSource; import com.dtflys.forest.http.ForestAddress; import com.dtflys.forest.http.ForestRequest; -import com.ff.base.constant.Constants; -import com.ff.base.system.service.ISysConfigService; +import com.ff.base.enums.GamePlatforms; +import com.ff.game.service.IPlatformService; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -20,12 +20,13 @@ import javax.annotation.Resource; public class MyXKAddressSource implements AddressSource { @Resource - private ISysConfigService configService; - + private IPlatformService platformService; @Override public ForestAddress getAddress(ForestRequest request) { - String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL); - return new ForestAddress("https",apiBaseUrl, 443,"api"); +// String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL); + String apiBaseUrl = platformService.get(GamePlatforms.XK.getCode()) + .getUrlInfo().getUrl(); + return new ForestAddress("https", apiBaseUrl, 443, "api"); } } \ No newline at end of file