From 11078dc87e2ba798bb457f25fea16630fbe6f64f Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 28 Apr 2026 22:58:25 +0800 Subject: [PATCH] =?UTF-8?q?UserProfileAppConvertor=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 3c2b0abaa50f285ec2d647d82f9aaa2c18fd39a1) --- .../user/UserProfileAppConvertor.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/user/UserProfileAppConvertor.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/user/UserProfileAppConvertor.java index 9f6a1fb8..3ee9425d 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/user/UserProfileAppConvertor.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/user/UserProfileAppConvertor.java @@ -16,6 +16,7 @@ import com.red.circle.other.inner.model.dto.user.UserSimpleProfileDTO; import com.red.circle.other.inner.model.dto.user.props.UserUseBadgeDTO; import java.sql.Timestamp; import java.time.LocalDateTime; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -33,11 +34,18 @@ public interface UserProfileAppConvertor { @Named("toUserProfileDTO") UserProfileDTO toUserProfileDTO(UserProfile userProfile); - Map toMapUserProfileDTO(Map userProfileMap); - @IterableMapping(qualifiedByName = "toUserProfileDTO") List toListUserProfileDTO(List userProfiles); + @Mapping(target = "cpList", ignore = true) + @Mapping(target = "backgroundPhotos", ignore = true) + @Mapping(target = "personalPhotos", ignore = true) + @Mapping(target = "wearBadge", ignore = true) + @Mapping(target = "wearHonor", ignore = true) + @Mapping(target = "wearRide", ignore = true) + @Mapping(target = "wearAvatar", ignore = true) + UserProfileDTO toFullUserProfileDTO(UserProfile userProfile); + default LoginLoggerEvent toLoginLoggerEventRegister(CreateAccountCmd cmd) { LoginLoggerEvent event = toLoginLoggerEvent(cmd); event.setInvitePeople(cmd.getInvitePeople()); @@ -78,7 +86,6 @@ public interface UserProfileAppConvertor { @Mapping(target = "wearHonor", ignore = true) @Mapping(target = "wearRide", ignore = true) @Mapping(target = "wearAvatar", ignore = true) - @Mapping(target = "ownSpecialId", ignore = true) UserProfileDTO toSimpleUserProfileDTO(UserProfile userProfile); /** @@ -164,4 +171,13 @@ public interface UserProfileAppConvertor { )); } + default Map toMapUserProfileDTO(Map userProfileMap) { + if (userProfileMap == null) { + return null; + } + Map map = new HashMap<>(); + userProfileMap.forEach((key, value) -> map.put(key, toFullUserProfileDTO(value))); + return map; + } + }