From 5ce5a784f0cd5c20cfc3f37aa17f71342bc14330 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Fri, 12 Dec 2025 11:39:45 +0800 Subject: [PATCH] =?UTF-8?q?userprofile=20=E6=96=B0=E5=A2=9E=E6=98=AF?= =?UTF-8?q?=E5=90=A6cp=E5=85=B3=E7=B3=BB=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/inner/model/dto/user/UserProfileDTO.java | 5 +++++ .../app/command/user/query/UserProfileUseQryExe.java | 12 +++++++----- 2 files changed, 12 insertions(+), 5 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 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; }