userprofile 接口新增照片返回

This commit is contained in:
tianfeng 2025-12-10 16:30:44 +08:00
parent d3a05b1cf3
commit f2e5087b22

View File

@ -1,5 +1,6 @@
package com.red.circle.other.infra.gateway.user;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.red.circle.framework.dto.ResultResponse;
@ -44,6 +45,7 @@ import com.red.circle.other.inner.model.dto.material.RoomThemeUserCustomizeDTO;
import com.red.circle.other.inner.model.dto.material.UseBadgeDTO;
import com.red.circle.other.inner.model.dto.material.UsePropsDTO;
import com.red.circle.other.inner.model.dto.material.props.PropsNobleVipAbilityDTO;
import com.red.circle.other.inner.model.dto.user.PhotoItem;
import com.red.circle.other.inner.model.dto.user.UserOneTimeTaskDTO;
import com.red.circle.tool.core.collection.CollectionUtils;
import com.red.circle.tool.core.date.DateUtils;
@ -97,6 +99,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
@Override
public UserProfile getByUserId(Long userId) {
UserRunProfile userRunProfile = userRunProfileService.getById(userId);
userRunProfile = null;
if (Objects.nonNull(userRunProfile)) {
// 拥有靓号
UserSpecialId userSpecialId = userSpecialIdService.getByUserId(userId);
@ -267,20 +270,22 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
return userBaseInfos.stream().map(userBaseInfo -> {
UserRunProfile newUserRunProfile = userProfileInfraConvertor.toUserRunProfile(userBaseInfo);
List<UseBadgeDTO> useBadgeDTOS = userUseBadgeEntities.get(userBaseInfo.getId());
if (!CollectionUtils.isEmpty(useBadgeDTOS)) {
newUserRunProfile.addWearBadge(useBadgeDTOS.stream()
.filter(e -> !BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
newUserRunProfile.addWearHonor(useBadgeDTOS.stream()
.filter(e -> BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
}
List<UseBadgeDTO> useBadgeDTOS = userUseBadgeEntities.get(userBaseInfo.getId());
if (!CollectionUtils.isEmpty(useBadgeDTOS)) {
newUserRunProfile.addWearBadge(useBadgeDTOS.stream()
.filter(e -> !BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
newUserRunProfile.addWearHonor(useBadgeDTOS.stream()
.filter(e -> BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
}
// 用户是否首充处理
fillUserFirstRecharge(newUserRunProfile);
// 用户是否首充处理
fillUserFirstRecharge(newUserRunProfile);
newUserRunProfile.addUseProps(userUsePropsEntityMap.get(userBaseInfo.getId()));
newUserRunProfile.addUseProps(userUsePropsEntityMap.get(userBaseInfo.getId()));
newUserRunProfile.addUseProps(userUseRoomTheme.get(userBaseInfo.getId()));
newUserRunProfile.setOwnSpecialId(userSpecialIdMap.get(userBaseInfo.getId()));
newUserRunProfile.setBackgroundPhotos(JSON.parseArray(userBaseInfo.getBackgroundPhoto(), PhotoItem.class));
newUserRunProfile.setPersonalPhotos(JSON.parseArray(userBaseInfo.getPersonalPhoto(), PhotoItem.class));
return newUserRunProfile;
}
).collect(Collectors.toList());