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)