From cb10413883e8e92c693df769662a1d40f23e85f2 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 20 Nov 2025 16:15:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B5=84=E6=96=99=E4=B9=9F?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BD=A9=E6=88=B4=E7=9A=84=E8=8D=A3=E8=AA=89?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circle/other/inner/model/dto/user/UserProfileDTO.java | 5 +++++ .../red/circle/other/app/scheduler/EmptyRoomCleanTask.java | 4 +++- .../red/circle/other/domain/model/user/UserProfile.java | 5 +++++ .../database/mongo/entity/user/profile/UserRunProfile.java | 5 +++++ .../gateway/user/UserRunProfileTransportGatewayImpl.java | 7 ++++++- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/UserProfileDTO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/UserProfileDTO.java index 0d33f2d7..97703b6e 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/UserProfileDTO.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/UserProfileDTO.java @@ -212,6 +212,11 @@ public class UserProfileDTO implements Serializable { */ private List wearBadge; + /** + * 用户使用的荣誉. + */ + private List wearHonor; + public List filterProps(Predicate predicate) { return Optional.ofNullable(useProps) .map(usePropsEntities -> usePropsEntities.stream() diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/EmptyRoomCleanTask.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/EmptyRoomCleanTask.java index 6214da19..fa19afdf 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/EmptyRoomCleanTask.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/EmptyRoomCleanTask.java @@ -53,7 +53,7 @@ public class EmptyRoomCleanTask { emptyRoomIds.add(room.getId()); } } catch (Exception e) { - log.error("获取房间[{}]在线人数失败", room.getId(), e); + } } @@ -61,6 +61,8 @@ public class EmptyRoomCleanTask { if (!CollectionUtils.isEmpty(emptyRoomIds)) { activeVoiceRoomService.removeByIds(emptyRoomIds); log.info("清理空房间完成,删除房间数量: {}, 房间ID: {}", emptyRoomIds.size(), emptyRoomIds); + } else { + log.warn("清理空房间失败, 无法获取房间在线人数"); } } catch (Exception e) { log.error("清理空房间任务执行失败", e); diff --git a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/model/user/UserProfile.java b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/model/user/UserProfile.java index 3116e46c..55113ae3 100644 --- a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/model/user/UserProfile.java +++ b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/model/user/UserProfile.java @@ -155,6 +155,11 @@ public class UserProfile implements Serializable { */ private List wearBadge; + /** + * 用户使用的荣誉. + */ + private List wearHonor; + private String checkStatus; /** diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/user/profile/UserRunProfile.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/user/profile/UserRunProfile.java index 0d718d7e..b8972ce4 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/user/profile/UserRunProfile.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/user/profile/UserRunProfile.java @@ -159,6 +159,11 @@ public class UserRunProfile implements Serializable { */ private List wearBadge; + /** + * 用户使用的荣誉. + */ + private List wearHonor; + /** * 添加使用道具. */ diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java index 8ccfc155..70af5fee 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java @@ -26,6 +26,7 @@ import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserBackpa import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserCustomizeService; import com.red.circle.other.infra.database.rds.service.user.user.BaseInfoService; import com.red.circle.other.inner.enums.material.BadgeBackpackExpireType; +import com.red.circle.other.inner.enums.material.BadgeConfigTypeEnum; import com.red.circle.other.inner.enums.material.PropsCommodityType; import com.red.circle.other.inner.model.dto.material.BadgeBackpackDTO; import com.red.circle.other.inner.model.dto.material.BadgeConfigDTO; @@ -238,10 +239,14 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo entry.getKey(), userBaseInfos.stream().map(BaseInfo::getId).collect(Collectors.toSet())); + return userBaseInfos.stream().map(userBaseInfo -> { UserRunProfile newUserRunProfile = userProfileInfraConvertor.toUserRunProfile( userBaseInfo); - newUserRunProfile.addWearBadge(userUseBadgeEntities.get(userBaseInfo.getId())); + newUserRunProfile.addWearBadge(userUseBadgeEntities.get(userBaseInfo.getId()).stream() + .filter(e -> !BadgeConfigTypeEnum.isHonorType(e.getType())).toList()); + newUserRunProfile.setWearHonor(userUseBadgeEntities.get(userBaseInfo.getId()).stream() + .filter(e -> BadgeConfigTypeEnum.isHonorType(e.getType())).toList()); newUserRunProfile.addUseProps(userUsePropsEntityMap.get(userBaseInfo.getId())); newUserRunProfile.addUseProps(userUseRoomTheme.get(userBaseInfo.getId())); newUserRunProfile.setOwnSpecialId(userSpecialIdMap.get(userBaseInfo.getId()));