UserProfileAppConvertor修改

(cherry picked from commit 3c2b0abaa50f285ec2d647d82f9aaa2c18fd39a1)
This commit is contained in:
tianfeng 2026-04-28 22:58:25 +08:00
parent 688057d5a0
commit 11078dc87e

View File

@ -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<Long, UserProfileDTO> toMapUserProfileDTO(Map<Long, UserProfile> userProfileMap);
@IterableMapping(qualifiedByName = "toUserProfileDTO")
List<UserProfileDTO> toListUserProfileDTO(List<UserProfile> 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<Long, UserProfileDTO> toMapUserProfileDTO(Map<Long, UserProfile> userProfileMap) {
if (userProfileMap == null) {
return null;
}
Map<Long, UserProfileDTO> map = new HashMap<>();
userProfileMap.forEach((key, value) -> map.put(key, toFullUserProfileDTO(value)));
return map;
}
}