From e9aef603baf7601423aeec37a21881df556ac3d3 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 23 Dec 2025 16:09:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B5=84=E6=96=99=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=B0=E5=A2=9EfamilyId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/inner/model/dto/user/UserProfileDTO.java | 6 ++++++ .../app/command/user/query/UserProfileUseQryExe.java | 11 +++++++---- 2 files changed, 13 insertions(+), 4 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 17c18087..82b00d8d 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 @@ -122,6 +122,12 @@ public class UserProfileDTO implements Serializable { */ private Boolean isCpRelation; + /** + * 家族ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long familyId; + /** * 背景照片列表(最多9张) */ diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserProfileUseQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserProfileUseQryExe.java index 2ef140d1..3df2922c 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserProfileUseQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserProfileUseQryExe.java @@ -18,6 +18,8 @@ import com.red.circle.other.infra.database.cache.key.user.UserKey; import com.red.circle.other.infra.database.cache.service.cp.CpRelationshipCacheService; import com.red.circle.other.infra.database.mongo.entity.live.RoomProfileManager; import com.red.circle.other.infra.database.mongo.service.live.RoomProfileManagerService; +import com.red.circle.other.infra.database.rds.entity.family.FamilyMemberInfo; +import com.red.circle.other.infra.database.rds.service.family.FamilyMemberInfoService; import com.red.circle.other.infra.database.rds.service.user.user.CpValueService; import com.red.circle.other.inner.model.dto.user.CpSimpleUserProfileCO; import com.red.circle.tool.core.text.StringUtils; @@ -25,10 +27,7 @@ import com.red.circle.other.inner.asserts.user.UserErrorCode; import com.red.circle.other.inner.model.dto.user.UserProfileDTO; import java.math.BigDecimal; -import java.util.Collections; -import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -54,6 +53,7 @@ public class UserProfileUseQryExe { private final UserSupportRelationService userRelationInterviewService; private final CpValueService cpValueService; private final CpRelationshipCacheService cpRelationshipCacheService; + private final FamilyMemberInfoService familyMemberInfoService; public UserProfileDTO execute(UserProfileQryCmd cmd) { UserProfile userProfile = getUserProfile(cmd); @@ -105,6 +105,9 @@ public class UserProfileUseQryExe { e.getMeUserId().equals(userProfile.getId()) && e.getCpUserId().equals(cmd.requiredReqUserId())); userProfileDTO.setIsCpRelation(match); } + + userProfileDTO.setFamilyId(Optional.ofNullable(familyMemberInfoService.getFamilyMemberByUserId(userProfileDTO.getId())).map(FamilyMemberInfo::getFamilyId).orElse(null)); + return userProfileDTO; }