修复显示
This commit is contained in:
parent
c7016d5ae4
commit
c56c9db06f
@ -48,8 +48,9 @@ public class GameListConfigQryExe {
|
|||||||
private static final String COMMON = "COMMON";
|
private static final String COMMON = "COMMON";
|
||||||
private static final String IOS_GAME_USER_WHITE_LIST = "IOS_GAME_USER_WHITE_LIST";
|
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_SYS_ORIGIN = "LIKEI";
|
||||||
private static final String GAME_LIST_TARGET_COUNTRY_CODE = "TR";
|
private static final String TURKEY_REGION_CODE = "土耳其";
|
||||||
private static final int GAME_LIST_MIN_WEALTH_LEVEL = 2;
|
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 UserRegionGateway userRegionGateway;
|
||||||
private final UserProfileGateway userProfileGateway;
|
private final UserProfileGateway userProfileGateway;
|
||||||
private final EnumConfigCacheService enumConfigCacheService;
|
private final EnumConfigCacheService enumConfigCacheService;
|
||||||
@ -88,22 +89,28 @@ public class GameListConfigQryExe {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// LIKEI 游戏列表需要同时满足用户区域、财富等级和当前 IP 国家,任一条件不满足直接返回空列表。
|
// LIKEI 只限制土耳其区域或土耳其 IP 的低等级用户;其他区域和其他 IP 直接展示游戏列表。
|
||||||
Long userId = cmd.requiredReqUserId();
|
Long userId = cmd.requiredReqUserId();
|
||||||
if (!GAME_LIST_TARGET_COUNTRY_CODE.equalsIgnoreCase(userRegionGateway.getRegionCode(userId))) {
|
boolean turkeyRegion = isTurkeyRegion(userRegionGateway.getRegionCode(userId));
|
||||||
return false;
|
boolean turkeyIp = TURKEY_COUNTRY_CODE.equalsIgnoreCase(
|
||||||
|
ipCountryUtils.getCountryCode(resolveClientIp(cmd)));
|
||||||
|
|
||||||
|
if (!turkeyRegion && !turkeyIp) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 命中土耳其规则时才读取财富等级;财富等级大于 2 才显示,2 级及以下隐藏。
|
||||||
UserConsumptionLevel level = userProfileGateway.getUserConsumptionLevel(
|
UserConsumptionLevel level = userProfileGateway.getUserConsumptionLevel(
|
||||||
cmd.requireReqSysOriginEnum(), userId);
|
cmd.requireReqSysOriginEnum(), userId);
|
||||||
int wealthLevel = Optional.ofNullable(level)
|
int wealthLevel = Optional.ofNullable(level)
|
||||||
.map(UserConsumptionLevel::getWealthLevel)
|
.map(UserConsumptionLevel::getWealthLevel)
|
||||||
.orElse(0);
|
.orElse(0);
|
||||||
if (wealthLevel < GAME_LIST_MIN_WEALTH_LEVEL) {
|
return wealthLevel > TURKEY_GAME_LIST_BLOCK_WEALTH_LEVEL;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
private boolean matchRegion(String regions, String regionId) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user