用户VIP获取逻辑修复
This commit is contained in:
parent
1526e10404
commit
f8d01ec784
@ -637,33 +637,25 @@ public class UserProfileGatewayImpl implements UserProfileGateway {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<NobleAbilityCO> getUserNobleAbility(Long userId) {
|
public List<NobleAbilityCO> getUserNobleAbility(Long userId) {
|
||||||
return userCacheService.getUserNobleAbility(userId, this::getNobleAbility);
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<NobleAbilityCO> getNobleAbility(Long userId) {
|
|
||||||
UserProfile userProfile = getByUserId(userId);
|
UserProfile userProfile = getByUserId(userId);
|
||||||
if (Objects.isNull(userProfile)) {
|
if (Objects.isNull(userProfile) || CollectionUtils.isEmpty(userProfile.getUseProps())) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Long> userVipPropsIds = getUserVipPropsIds(userProfile.getUseProps());
|
return userProfile.getUseProps().stream()
|
||||||
if (CollectionUtils.isEmpty(userVipPropsIds)) {
|
.filter(props -> Objects.nonNull(props.getPropsResources())
|
||||||
return null;
|
&& PropsCommodityType.NOBLE_VIP.name().equals(props.getPropsResources().getType())
|
||||||
}
|
&& props.getExpireTime() != null
|
||||||
|
&& props.getExpireTime() > System.currentTimeMillis())
|
||||||
List<PropsNobleVipAbility> vipAbilities = propsNobleVipAbilityService.listByIds(userVipPropsIds);
|
.map(props -> {
|
||||||
|
String vipName = props.getPropsResources().getName();
|
||||||
if (CollectionUtils.isEmpty(vipAbilities)) {
|
NobleVipEnum vipEnum = NobleVipEnum.valueOf(vipName);
|
||||||
return null;
|
NobleAbilityCO co = new NobleAbilityCO();
|
||||||
}
|
co.setVipType(vipName);
|
||||||
|
co.setVipLevel(vipEnum.ordinal() + 1);
|
||||||
return vipAbilities.stream().map(e -> {
|
return co;
|
||||||
NobleAbilityCO result = new NobleAbilityCO();
|
})
|
||||||
result.setVipType(e.getVipType());
|
.toList();
|
||||||
result.setVipLevel(e.getVipLevel());
|
|
||||||
result.setRoomMaxMember(e.getRoomMaxMember());
|
|
||||||
return result;
|
|
||||||
}).toList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user