cp 列表新增分手中状态

This commit is contained in:
tianfeng 2025-12-11 11:03:50 +08:00
parent ea5e7a5595
commit e086a6a377
4 changed files with 22 additions and 0 deletions

View File

@ -45,6 +45,8 @@ public class UserCpPairUserProfileQryExe {
ResponseAssert.notNull(UserErrorCode.USER_INFO_NOT_FOUND, meUser);
List<CpRelationship> cpRelationshipList = cpRelationshipService.getByUserId(cmd.requiredReqUserId());
List<CpRelationship> 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()))

View File

@ -32,6 +32,12 @@ public class CpPairUserProfileCO extends ClientObject {
*/
private UserProfileDTO cpUserProfile;
/**
* CP关系状态NORMAL-正常, DISMISSING-分手中
*/
private String status;
/**
* 心动值
*/

View File

@ -31,6 +31,11 @@ public interface CpRelationshipService extends BaseService<CpRelationship> {
*/
boolean existsCp(Long userId, Long cpUserId);
/**
* 获取分手中的cp信息集合
*/
List<CpRelationship> getDismissingByUserId(Long userId);
/**
* 获取cp用户id.
*

View File

@ -60,6 +60,14 @@ public class CpRelationshipServiceImpl extends
).map(cpRelationship -> Objects.nonNull(cpRelationship.getId())).orElse(Boolean.FALSE);
}
@Override
public List<CpRelationship> getDismissingByUserId(Long userId) {
return query()
.eq(CpRelationship::getUserId, userId)
.eq(CpRelationship::getStatus, CpRelationshipStatus.DISMISSING.name())
.list();
}
@Override
public List<Long> getCpUserId(Long userId) {
return query().select(CpRelationship::getCpUserId)