From e086a6a377e9646147f019e16166a7dcb1ee3eb0 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 11 Dec 2025 11:03:50 +0800 Subject: [PATCH] =?UTF-8?q?cp=20=E5=88=97=E8=A1=A8=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=88=86=E6=89=8B=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/user/query/UserCpPairUserProfileQryExe.java | 3 +++ .../user/relation/cp/CpPairUserProfileCO.java | 6 ++++++ .../rds/service/user/user/CpRelationshipService.java | 5 +++++ .../service/user/user/impl/CpRelationshipServiceImpl.java | 8 ++++++++ 4 files changed, 22 insertions(+) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserCpPairUserProfileQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserCpPairUserProfileQryExe.java index fd47ac89..35ada877 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserCpPairUserProfileQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserCpPairUserProfileQryExe.java @@ -45,6 +45,8 @@ public class UserCpPairUserProfileQryExe { ResponseAssert.notNull(UserErrorCode.USER_INFO_NOT_FOUND, meUser); List cpRelationshipList = cpRelationshipService.getByUserId(cmd.requiredReqUserId()); + List dismissing = cpRelationshipService.getDismissingByUserId(cmd.requiredReqUserId()); + cpRelationshipList.addAll(dismissing); if (cpRelationshipList.isEmpty()) { return List.of( new CpPairUserProfileCO() @@ -56,6 +58,7 @@ public class UserCpPairUserProfileQryExe { .map(cpRelationship -> new CpPairUserProfileCO() .setMeUserProfile(userProfileAppConvertor.toUserProfileDTO((meUser))) .setCpUserProfile(getUserProfile(cpRelationship.getCpUserId())) + .setStatus(cpRelationship.getStatus()) .setCpValue(cpValueService.getCpVal(cpRelationship.getCpValId())) .setDays(DateUtils.toDurationDays(cpRelationship.getCreateTime(), DateUtils.now())) .setFirstDay(cpRelationship.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().toString())) diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/user/relation/cp/CpPairUserProfileCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/user/relation/cp/CpPairUserProfileCO.java index 5fc829fd..c00b49d3 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/user/relation/cp/CpPairUserProfileCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/user/relation/cp/CpPairUserProfileCO.java @@ -32,6 +32,12 @@ public class CpPairUserProfileCO extends ClientObject { */ private UserProfileDTO cpUserProfile; + + /** + * CP关系状态(NORMAL-正常, DISMISSING-分手中) + */ + private String status; + /** * 心动值 */ diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/CpRelationshipService.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/CpRelationshipService.java index 1725b381..8b5b99dc 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/CpRelationshipService.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/CpRelationshipService.java @@ -31,6 +31,11 @@ public interface CpRelationshipService extends BaseService { */ boolean existsCp(Long userId, Long cpUserId); + /** + * 获取分手中的cp信息集合 + */ + List getDismissingByUserId(Long userId); + /** * 获取cp用户id. * diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/CpRelationshipServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/CpRelationshipServiceImpl.java index 55668736..0a1d6f05 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/CpRelationshipServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/CpRelationshipServiceImpl.java @@ -60,6 +60,14 @@ public class CpRelationshipServiceImpl extends ).map(cpRelationship -> Objects.nonNull(cpRelationship.getId())).orElse(Boolean.FALSE); } + @Override + public List getDismissingByUserId(Long userId) { + return query() + .eq(CpRelationship::getUserId, userId) + .eq(CpRelationship::getStatus, CpRelationshipStatus.DISMISSING.name()) + .list(); + } + @Override public List getCpUserId(Long userId) { return query().select(CpRelationship::getCpUserId)