diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java index 46a1cb9c..d87cd603 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java @@ -8,6 +8,7 @@ import lombok.experimental.Accessors; import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; +import java.sql.Timestamp; /** * CP简化用户资料 @@ -77,4 +78,6 @@ public class CpSimpleUserProfileCO implements Serializable { */ private String firstDay; + private Timestamp createTime; + } 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 d9a4e096..59e1fef5 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 @@ -2,6 +2,7 @@ package com.red.circle.other.infra.database.rds.service.user.user.impl; import com.red.circle.framework.mybatis.constant.PageConstant; +import com.red.circle.framework.mybatis.entity.TimestampBaseEntity; import com.red.circle.framework.mybatis.service.impl.BaseServiceImpl; import com.red.circle.tool.core.collection.CollectionUtils; import com.red.circle.tool.core.date.LocalDateUtils; @@ -85,6 +86,7 @@ public class CpRelationshipServiceImpl extends return query() .eq(CpRelationship::getUserId, userId) .eq(CpRelationship::getStatus, CpRelationshipStatus.NORMAL.name()) + .orderByAsc(TimestampBaseEntity::getCreateTime) .list(); } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java index 8cdc9768..b0e844a1 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java @@ -368,11 +368,13 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo .setCpUserAvatar(cpUser.getUserAvatar()) .setCpUserNickname(cpUser.getUserNickname()) .setCpValue(cpValue) + .setCreateTime(cpRelationship.getCreateTime()) .setDays(days) .setFirstDay(firstDay); }) .filter(Objects::nonNull) - .sorted(Comparator.comparing(CpSimpleUserProfileCO::getCpValue).reversed()) + .sorted(Comparator.comparing(CpSimpleUserProfileCO::getCpValue).reversed() + .thenComparing(CpSimpleUserProfileCO::getCreateTime)) .toList(); userRunProfile.setCpList(cpList);