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; }