From 1253a404b21f1db6f5c33a984fb87c567cbe601c Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 12 Mar 2026 21:07:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E8=B6=B3=E8=BF=B9=E5=92=8C?= =?UTF-8?q?=E6=88=91=E7=9A=84=E5=85=B3=E6=B3=A8=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E6=AD=A3=E5=9C=A8=E6=B8=B8=E7=8E=A9=E7=9A=84=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../room/query/UserFollowRoomsQryExe.java | 19 ++++++++++++++--- .../room/query/UserTraceRoomsQryExe.java | 21 ++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/query/UserFollowRoomsQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/query/UserFollowRoomsQryExe.java index c7fc533b..4b0dea62 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/query/UserFollowRoomsQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/query/UserFollowRoomsQryExe.java @@ -5,6 +5,7 @@ import com.red.circle.common.business.dto.cmd.app.AppFlowCmd; import com.red.circle.other.app.common.room.RoomVoiceProfileCommon; import com.red.circle.other.app.dto.clientobject.room.RoomBrowseRecordsV2CO; import com.red.circle.other.app.dto.clientobject.room.RoomVoiceProfileCO; +import com.red.circle.other.app.service.game.GameLudoService; import com.red.circle.other.infra.database.rds.entity.live.RoomSubscription; import com.red.circle.other.infra.database.rds.service.live.RoomSubscriptionService; import com.red.circle.tool.core.collection.CollectionUtils; @@ -26,6 +27,7 @@ public class UserFollowRoomsQryExe { private final RoomVoiceProfileCommon roomVoiceProfileCommon; private final RoomSubscriptionService roomSubscriptionService; + private final GameLudoService gameLudoService; public List execute(AppFlowCmd cmd) { List roomSubscriptions = roomSubscriptionService @@ -40,9 +42,20 @@ public class UserFollowRoomsQryExe { List roomSubscriptions) { Map roomProfileMap = roomVoiceProfileCommon.mapRoomVoiceProfile( roomSubscriptions.stream().map(RoomSubscription::getRoomId).collect(Collectors.toSet())); - return roomSubscriptions.stream().map(roomMember -> new RoomBrowseRecordsV2CO() - .setId(roomMember.getId()) - .setRoomProfile(roomProfileMap.get(roomMember.getRoomId()))) + + // 填充游戏图标 + List list = roomSubscriptions.stream().map(RoomSubscription::getRoomId).toList(); + Map coverMap = gameLudoService.listGameCoverByRoomIds(list); + + return roomSubscriptions.stream().map(roomMember -> { + RoomVoiceProfileCO profileCO = roomProfileMap.get(roomMember.getRoomId()); + if (profileCO != null) { + profileCO.setRoomGameIcon(coverMap.get(roomMember.getRoomId())); + } + return new RoomBrowseRecordsV2CO() + .setId(roomMember.getId()) + .setRoomProfile(profileCO); + }) .filter(sub -> Objects.nonNull(sub.getRoomProfile())).collect(Collectors.toList()); } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/query/UserTraceRoomsQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/query/UserTraceRoomsQryExe.java index 88944dc1..a77897ae 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/query/UserTraceRoomsQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/query/UserTraceRoomsQryExe.java @@ -5,8 +5,10 @@ import com.red.circle.common.business.dto.cmd.app.AppFlowCmd; import com.red.circle.other.app.common.room.RoomVoiceProfileCommon; import com.red.circle.other.app.dto.clientobject.room.RoomBrowseRecordsV2CO; import com.red.circle.other.app.dto.clientobject.room.RoomVoiceProfileCO; +import com.red.circle.other.app.service.game.GameLudoService; import com.red.circle.other.infra.database.mongo.entity.live.RoomTourist; import com.red.circle.other.infra.database.mongo.service.live.RoomTouristService; +import com.red.circle.other.infra.database.rds.entity.live.RoomSubscription; import com.red.circle.tool.core.collection.CollectionUtils; import java.util.List; import java.util.Map; @@ -28,6 +30,7 @@ public class UserTraceRoomsQryExe { private final RoomTouristService roomTouristService; private final RoomVoiceProfileCommon roomVoiceProfileCommon; + private final GameLudoService gameLudoService; public List execute(AppFlowCmd cmd) { List roomTourists = roomTouristService @@ -35,12 +38,24 @@ public class UserTraceRoomsQryExe { if (CollectionUtils.isEmpty(roomTourists)) { return Lists.newArrayList(); } + + // 填充游戏图标 + List list = roomTourists.stream().map(RoomTourist::getRoomId).toList(); + Map coverMap = gameLudoService.listGameCoverByRoomIds(list); + Map roomProfileMap = roomVoiceProfileCommon.mapRoomVoiceProfile( roomTourists.stream().map(RoomTourist::getRoomId).collect(Collectors.toSet())); return roomTourists.stream().filter(Objects::nonNull) - .map(roomTourist -> new RoomBrowseRecordsV2CO() - .setId(roomTourist.getTimeId()) - .setRoomProfile(roomProfileMap.get(roomTourist.getRoomId())) + .map(roomTourist -> { + RoomVoiceProfileCO profileCO = roomProfileMap.get(roomTourist.getRoomId()); + if (profileCO != null) { + profileCO.setRoomGameIcon(coverMap.get(roomTourist.getRoomId())); + } + + return new RoomBrowseRecordsV2CO() + .setId(roomTourist.getTimeId()) + .setRoomProfile(profileCO); + } ).collect(Collectors.toList()); }