diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/sys/query/GameListConfigQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/sys/query/GameListConfigQryExe.java index f49b418a..6214a8bf 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/sys/query/GameListConfigQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/sys/query/GameListConfigQryExe.java @@ -48,8 +48,9 @@ public class GameListConfigQryExe { private static final String COMMON = "COMMON"; private static final String IOS_GAME_USER_WHITE_LIST = "IOS_GAME_USER_WHITE_LIST"; private static final String GAME_LIST_TARGET_SYS_ORIGIN = "LIKEI"; - private static final String GAME_LIST_TARGET_COUNTRY_CODE = "TR"; - private static final int GAME_LIST_MIN_WEALTH_LEVEL = 2; + private static final String TURKEY_REGION_CODE = "土耳其"; + private static final String TURKEY_COUNTRY_CODE = "TR"; + private static final int TURKEY_GAME_LIST_BLOCK_WEALTH_LEVEL = 2; private final UserRegionGateway userRegionGateway; private final UserProfileGateway userProfileGateway; private final EnumConfigCacheService enumConfigCacheService; @@ -88,22 +89,28 @@ public class GameListConfigQryExe { return true; } - // LIKEI 游戏列表需要同时满足用户区域、财富等级和当前 IP 国家,任一条件不满足直接返回空列表。 + // LIKEI 只限制土耳其区域或土耳其 IP 的低等级用户;其他区域和其他 IP 直接展示游戏列表。 Long userId = cmd.requiredReqUserId(); - if (!GAME_LIST_TARGET_COUNTRY_CODE.equalsIgnoreCase(userRegionGateway.getRegionCode(userId))) { - return false; + boolean turkeyRegion = isTurkeyRegion(userRegionGateway.getRegionCode(userId)); + boolean turkeyIp = TURKEY_COUNTRY_CODE.equalsIgnoreCase( + ipCountryUtils.getCountryCode(resolveClientIp(cmd))); + + if (!turkeyRegion && !turkeyIp) { + return true; } + // 命中土耳其规则时才读取财富等级;财富等级大于 2 才显示,2 级及以下隐藏。 UserConsumptionLevel level = userProfileGateway.getUserConsumptionLevel( cmd.requireReqSysOriginEnum(), userId); int wealthLevel = Optional.ofNullable(level) .map(UserConsumptionLevel::getWealthLevel) .orElse(0); - if (wealthLevel < GAME_LIST_MIN_WEALTH_LEVEL) { - return false; - } + return wealthLevel > TURKEY_GAME_LIST_BLOCK_WEALTH_LEVEL; + } - return GAME_LIST_TARGET_COUNTRY_CODE.equalsIgnoreCase(ipCountryUtils.getCountryCode(resolveClientIp(cmd))); + private boolean isTurkeyRegion(String regionCode) { + return TURKEY_REGION_CODE.equalsIgnoreCase(regionCode) + || TURKEY_COUNTRY_CODE.equalsIgnoreCase(regionCode); } private boolean matchRegion(String regions, String regionId) {