userprofile 新增是否cp关系字段

This commit is contained in:
tianfeng 2025-12-12 11:39:45 +08:00
parent 51c5cf0712
commit 5ce5a784f0
2 changed files with 12 additions and 5 deletions

View File

@ -117,6 +117,11 @@ public class UserProfileDTO implements Serializable {
*/
private List<CpSimpleUserProfileCO> cpList;
/**
* 是否cp关系
*/
private Boolean isCpRelation;
/**
* 背景照片列表最多9张
*/

View File

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