房间成员新增 财富魅力等级

This commit is contained in:
tianfeng 2026-05-12 19:09:52 +08:00
parent e0be58ec2c
commit b288fe86a9

View File

@ -1,10 +1,12 @@
package com.red.circle.other.app.command.room.query;
import com.google.common.collect.Lists;
import com.red.circle.common.business.core.enums.SysOriginPlatformEnum;
import com.red.circle.other.app.convertor.user.UserProfileAppConvertor;
import com.red.circle.other.app.dto.clientobject.room.RoomMemberUserCO;
import com.red.circle.other.app.dto.cmd.room.RoomMemberQryCmd;
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
import com.red.circle.other.domain.model.user.UserConsumptionLevel;
import com.red.circle.other.infra.database.rds.entity.live.RoomMember;
import com.red.circle.other.infra.database.rds.service.live.RoomMemberService;
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
@ -80,10 +82,18 @@ public class RoomSearchMemberQryExe {
return Lists.newArrayList();
}
return roomMembers.stream().map(roomMember -> new RoomMemberUserCO()
.setId(roomMember.getId())
.setRoles(roomMember.getRoles())
.setUserProfile(userProfileMap.get(roomMember.getUserId()))).toList();
return roomMembers.stream().map(roomMember -> {
UserProfileDTO userProfileDTO = userProfileMap.get(roomMember.getUserId());
if (Objects.nonNull(userProfileDTO)) {
UserConsumptionLevel userConsumptionLevel = userProfileGateway.getUserConsumptionLevel(SysOriginPlatformEnum.ATYOU, userProfileDTO.getId());
userProfileDTO.setWealthLevel(userConsumptionLevel.getWealthLevel());
userProfileDTO.setCharmLevel(userConsumptionLevel.getCharmLevel());
}
return new RoomMemberUserCO()
.setId(roomMember.getId())
.setRoles(roomMember.getRoles())
.setUserProfile(userProfileDTO);
}).toList();
}
private List<RoomMember> getHomeownerAndManager(Long roomId) {