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 63e0da1b..17c18087 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 @@ -117,6 +117,11 @@ public class UserProfileDTO implements Serializable { */ private List cpList; + /** + * 是否cp关系 + */ + private Boolean isCpRelation; + /** * 背景照片列表(最多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 566d4123..f5e9177a 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 @@ -90,6 +90,9 @@ public class UserProfileUseQryExe { String isUpdateCountry = redisService.getString("IS_UPDATE_COUNTRY:" + cmd.requiredReqUserId()); userProfileDTO.setIsUpdateCountry(StringUtils.isNotBlank(isUpdateCountry) ? isUpdateCountry : "0"); + // 填充用户CP信息 + userProfileDTO.setCpList(cpRelationshipCacheService.getUserCpList(userProfile.getId())); + // 增加访客记录 if (!Objects.equals(userProfile.getId(), cmd.requiredReqUserId())) { AppUserIdCmd userIdCmd = new AppUserIdCmd(); @@ -97,12 +100,11 @@ public class UserProfileUseQryExe { userIdCmd.setReqUserId(cmd.requiredReqUserId()); userIdCmd.setReqSysOrigin(cmd.getReqSysOrigin()); userRelationInterviewService.addVisitor(userIdCmd); + + boolean match = userProfileDTO.getCpList().stream().anyMatch(e -> + e.getMeUserId().equals(cmd.requiredReqUserId()) && e.getCpUserId().equals(userProfile.getId())); + userProfileDTO.setIsCpRelation(match); } - - - // 填充用户CP信息 - userProfileDTO.setCpList(cpRelationshipCacheService.getUserCpList(userProfile.getId())); - return userProfileDTO; }