用户资料接口新增familyId

This commit is contained in:
tianfeng 2025-12-23 16:09:49 +08:00
parent 4ed95671b7
commit e9aef603ba
2 changed files with 13 additions and 4 deletions

View File

@ -122,6 +122,12 @@ public class UserProfileDTO implements Serializable {
*/
private Boolean isCpRelation;
/**
* 家族ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long familyId;
/**
* 背景照片列表最多9张
*/

View File

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