南亚国家分开处理完善
This commit is contained in:
parent
a51141b12a
commit
7deeddc5a4
@ -65,7 +65,9 @@ public class RoomVoiceDiscoverQryExe {
|
||||
|
||||
// 区域隔离常量 - 与ActiveVoiceRoomServiceImpl保持一致
|
||||
private static final Set<String> TR_REGIONS = Set.of("TR");
|
||||
private static final Set<String> SA_REGIONS = Set.of("BD","SA", "IN", "PK");
|
||||
private static final Set<String> BD_REGIONS = Set.of("BD");
|
||||
private static final Set<String> IN_REGIONS = Set.of("IN");
|
||||
private static final Set<String> PK_REGIONS = Set.of("PK");
|
||||
private static final Set<String> AR_REGIONS = Set.of("AE", "AR", "BH", "DJ", "DZ", "EG", "EY", "ER", "IL", "IQ", "JO", "KM", "KW", "LB", "LY", "MA", "MR", "OM", "PS", "QA", "SD", "SO", "SS", "SY", "TD", "TN", "YE");
|
||||
private static final Set<String> OTHER_REGIONS = Set.of("OTHER", "PH", "ID", "GH", "IR", "AF", "NG", "DE", "MYS", "TM", "AZ", "NP");
|
||||
|
||||
@ -278,8 +280,14 @@ public class RoomVoiceDiscoverQryExe {
|
||||
* 获取区域所属的特殊区域组(如果不属于任何特殊组则返回null)
|
||||
*/
|
||||
private Set<String> getRegionGroup(String region) {
|
||||
if (SA_REGIONS.contains(region)) {
|
||||
return SA_REGIONS;
|
||||
if (BD_REGIONS.contains(region)) {
|
||||
return BD_REGIONS;
|
||||
}
|
||||
if (IN_REGIONS.contains(region)) {
|
||||
return IN_REGIONS;
|
||||
}
|
||||
if (PK_REGIONS.contains(region)) {
|
||||
return PK_REGIONS;
|
||||
}
|
||||
if (AR_REGIONS.contains(region)) {
|
||||
return AR_REGIONS;
|
||||
@ -293,50 +301,6 @@ public class RoomVoiceDiscoverQryExe {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取需要排除的区域列表
|
||||
*/
|
||||
private List<String> getRegions(String region) {
|
||||
List<String> excludeRegions = new ArrayList<>();
|
||||
|
||||
if (SA_REGIONS.contains(region)) {
|
||||
excludeRegions.addAll(AR_REGIONS);
|
||||
excludeRegions.addAll(OTHER_REGIONS);
|
||||
} else if (AR_REGIONS.contains(region)) {
|
||||
excludeRegions.addAll(SA_REGIONS);
|
||||
excludeRegions.addAll(OTHER_REGIONS);
|
||||
} else if (OTHER_REGIONS.contains(region)) {
|
||||
excludeRegions.addAll(SA_REGIONS);
|
||||
excludeRegions.addAll(AR_REGIONS);
|
||||
} else {
|
||||
excludeRegions.addAll(SA_REGIONS);
|
||||
excludeRegions.addAll(AR_REGIONS);
|
||||
excludeRegions.addAll(OTHER_REGIONS);
|
||||
}
|
||||
|
||||
return excludeRegions;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取特殊区域组列表
|
||||
*/
|
||||
private List<String> getSpecialRegions(String region) {
|
||||
if (SA_REGIONS.contains(region)) {
|
||||
return new ArrayList<>(SA_REGIONS);
|
||||
}
|
||||
|
||||
if (AR_REGIONS.contains(region)) {
|
||||
return new ArrayList<>(AR_REGIONS);
|
||||
}
|
||||
|
||||
if (OTHER_REGIONS.contains(region)) {
|
||||
return new ArrayList<>(OTHER_REGIONS);
|
||||
}
|
||||
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 从缓存中获取没人的房间
|
||||
*
|
||||
|
||||
@ -37,14 +37,18 @@ public class ActiveVoiceRoomServiceImpl implements ActiveVoiceRoomService {
|
||||
private final MongoTemplate mongoTemplate;
|
||||
|
||||
private static final Set<String> TR_REGIONS = Set.of("TR");
|
||||
private static final Set<String> SA_REGIONS = Set.of("BD","SA", "IN", "PK");
|
||||
private static final Set<String> BD_REGIONS = Set.of("BD");
|
||||
private static final Set<String> IN_REGIONS = Set.of("IN");
|
||||
private static final Set<String> PK_REGIONS = Set.of("PK");
|
||||
private static final Set<String> AR_REGIONS = Set.of("AE", "AR", "BH", "DJ", "DZ", "EG", "EY", "ER", "IL", "IQ", "JO", "KM", "KW", "LB", "LY", "MA", "MR", "OM", "PS", "QA", "SD", "SO", "SS", "SY", "TD", "TN", "YE");
|
||||
private static final Set<String> OTHER_REGIONS = Set.of("OTHER", "PH", "ID", "GH", "IR", "AF", "NG", "DE", "MYS", "TM", "AZ", "NP");
|
||||
private static final Set<String> ALL_SPECIAL_REGIONS;
|
||||
|
||||
static {
|
||||
Set<String> temp = new HashSet<>();
|
||||
temp.addAll(SA_REGIONS);
|
||||
temp.addAll(BD_REGIONS);
|
||||
temp.addAll(IN_REGIONS);
|
||||
temp.addAll(PK_REGIONS);
|
||||
temp.addAll(AR_REGIONS);
|
||||
temp.addAll(TR_REGIONS);
|
||||
temp.addAll(OTHER_REGIONS);
|
||||
@ -188,8 +192,14 @@ public class ActiveVoiceRoomServiceImpl implements ActiveVoiceRoomService {
|
||||
* 获取区域所属的特殊区域组(如果不属于任何特殊组则返回null)
|
||||
*/
|
||||
private Set<String> getRegionGroup(String region) {
|
||||
if (SA_REGIONS.contains(region)) {
|
||||
return SA_REGIONS;
|
||||
if (BD_REGIONS.contains(region)) {
|
||||
return BD_REGIONS;
|
||||
}
|
||||
if (IN_REGIONS.contains(region)) {
|
||||
return IN_REGIONS;
|
||||
}
|
||||
if (PK_REGIONS.contains(region)) {
|
||||
return PK_REGIONS;
|
||||
}
|
||||
if (AR_REGIONS.contains(region)) {
|
||||
return AR_REGIONS;
|
||||
@ -207,24 +217,8 @@ public class ActiveVoiceRoomServiceImpl implements ActiveVoiceRoomService {
|
||||
* 获取指定区域组需要排除的其他区域组
|
||||
*/
|
||||
private Set<String> getExcludeRegionsForGroup(Set<String> regionGroup) {
|
||||
Set<String> excludes = new HashSet<>();
|
||||
if (regionGroup == SA_REGIONS) {
|
||||
excludes.addAll(AR_REGIONS);
|
||||
excludes.addAll(OTHER_REGIONS);
|
||||
excludes.addAll(TR_REGIONS);
|
||||
} else if (regionGroup == AR_REGIONS) {
|
||||
excludes.addAll(SA_REGIONS);
|
||||
excludes.addAll(OTHER_REGIONS);
|
||||
excludes.addAll(TR_REGIONS);
|
||||
} else if (regionGroup == OTHER_REGIONS) {
|
||||
excludes.addAll(SA_REGIONS);
|
||||
excludes.addAll(AR_REGIONS);
|
||||
excludes.addAll(TR_REGIONS);
|
||||
} else if (regionGroup == TR_REGIONS) {
|
||||
excludes.addAll(SA_REGIONS);
|
||||
excludes.addAll(AR_REGIONS);
|
||||
excludes.addAll(OTHER_REGIONS);
|
||||
}
|
||||
Set<String> excludes = new HashSet<>(ALL_SPECIAL_REGIONS);
|
||||
excludes.removeAll(regionGroup);
|
||||
return excludes;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user