首页房间改成 阿语区和非阿语区
This commit is contained in:
parent
b84b054318
commit
9ff70aa3e4
@ -17,6 +17,7 @@ import com.red.circle.other.domain.gateway.user.ability.UserSVipGateway;
|
||||
import com.red.circle.other.domain.model.user.UserProfile;
|
||||
import com.red.circle.other.infra.database.cache.service.other.MicUserCacheService;
|
||||
import com.red.circle.other.domain.rocket.RocketStatus;
|
||||
import com.red.circle.other.infra.constants.RegionConstant;
|
||||
import com.red.circle.other.infra.database.cache.service.user.RegionRoomCacheService;
|
||||
import com.red.circle.other.infra.database.mongo.entity.live.ActiveVoiceRoom;
|
||||
import com.red.circle.other.infra.database.mongo.entity.live.RoomProfileManager;
|
||||
@ -284,7 +285,16 @@ public class RoomVoiceDiscoverQryExe {
|
||||
private List<ActiveVoiceRoom> filterEmptyRoomsByRegion(List<ActiveVoiceRoom> emptyRooms, String sysOrigin, boolean isAllRegion, String region) {
|
||||
return emptyRooms.stream()
|
||||
.filter(room -> Objects.equals(sysOrigin, room.getSysOrigin()))
|
||||
.filter(room -> isAllRegion || Objects.equals(region, room.getRegion()))
|
||||
.filter(room -> {
|
||||
if (isAllRegion) {
|
||||
return true;
|
||||
}
|
||||
if (RegionConstant.isArabicRegionByCode(region)) {
|
||||
return RegionConstant.isArabicRegionByCode(room.getRegion());
|
||||
} else {
|
||||
return !RegionConstant.isArabicRegionByCode(room.getRegion());
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package com.red.circle.other.infra.constants;
|
||||
|
||||
/**
|
||||
* 区域常量.
|
||||
*/
|
||||
public final class RegionConstant {
|
||||
|
||||
private RegionConstant() {}
|
||||
|
||||
/** 阿语区 region code */
|
||||
public static final String ARABIC_REGION_CODE = "AR";
|
||||
|
||||
/** 阿语区 regionId */
|
||||
public static final String ARABIC_REGION_ID = "2049084769873498113";
|
||||
|
||||
/** 通过 region code 判断是否阿语区(忽略大小写) */
|
||||
public static boolean isArabicRegionByCode(String regionCode) {
|
||||
return ARABIC_REGION_CODE.equalsIgnoreCase(regionCode);
|
||||
}
|
||||
|
||||
/** 通过 regionId 判断是否阿语区(忽略大小写) */
|
||||
public static boolean isArabicRegionById(String regionId) {
|
||||
return ARABIC_REGION_ID.equalsIgnoreCase(regionId);
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.red.circle.other.infra.database.mongo.service.live.impl;
|
||||
|
||||
import com.red.circle.common.business.core.enums.SysOriginPlatformEnum;
|
||||
import com.red.circle.other.infra.constants.RegionConstant;
|
||||
import com.red.circle.framework.mybatis.constant.PageConstant;
|
||||
import com.red.circle.other.infra.database.mongo.dto.query.live.ActiveVoiceRoomQuery;
|
||||
import com.red.circle.other.infra.database.mongo.dto.query.live.FamilyOnlineRoomQuery;
|
||||
@ -117,9 +118,12 @@ public class ActiveVoiceRoomServiceImpl implements ActiveVoiceRoomService {
|
||||
@Override
|
||||
public List<ActiveVoiceRoom> listDiscover(String sysOrigin, boolean isAllRegion, String region, Integer limit) {
|
||||
Criteria criteria = Criteria.where("sysOrigin").is(sysOrigin);
|
||||
// 非全部区域时,仅展示用户当前 region 的房间
|
||||
if (!isAllRegion && StringUtils.isNotBlank(region)) {
|
||||
criteria.and("region").is(region);
|
||||
if (!isAllRegion) {
|
||||
if (RegionConstant.isArabicRegionByCode(region)) {
|
||||
criteria.and("region").is(RegionConstant.ARABIC_REGION_CODE);
|
||||
} else {
|
||||
criteria.and("region").ne(RegionConstant.ARABIC_REGION_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
Query query = Query.query(criteria)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user