userProfile 新增荣誉字段
This commit is contained in:
parent
10f5f90857
commit
6574bafbd1
@ -203,6 +203,19 @@ public class UserRunProfile implements Serializable {
|
|||||||
wearBadge.addAll(useBadgeEntities);
|
wearBadge.addAll(useBadgeEntities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加使用徽章.
|
||||||
|
*/
|
||||||
|
public void addWearHonor(List<UseBadgeDTO> useBadgeEntities) {
|
||||||
|
if (Objects.isNull(wearHonor)) {
|
||||||
|
wearHonor = CollectionUtils.newArrayList();
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(useBadgeEntities)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
wearHonor.addAll(useBadgeEntities);
|
||||||
|
}
|
||||||
|
|
||||||
public List<UsePropsDTO> getUseProps() {
|
public List<UsePropsDTO> getUseProps() {
|
||||||
if (CollectionUtils.isNotEmpty(useProps)) {
|
if (CollectionUtils.isNotEmpty(useProps)) {
|
||||||
return useProps.stream()
|
return useProps.stream()
|
||||||
@ -221,6 +234,15 @@ public class UserRunProfile implements Serializable {
|
|||||||
return wearBadge;
|
return wearBadge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<UseBadgeDTO> getWearHonor() {
|
||||||
|
if (CollectionUtils.isNotEmpty(wearHonor)) {
|
||||||
|
wearHonor = wearHonor.stream()
|
||||||
|
.filter(props -> Objects.nonNull(props) && checkAvailable(props.getExpireTime()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return wearHonor;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* true 可用. false 不可用.
|
* true 可用. false 不可用.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -237,6 +237,10 @@ public class UserRunProfileServiceImpl implements UserRunProfileService {
|
|||||||
if (Objects.nonNull(userRunProfile.getWearBadge())) {
|
if (Objects.nonNull(userRunProfile.getWearBadge())) {
|
||||||
update.set("wearBadge", userRunProfile.getWearBadge());
|
update.set("wearBadge", userRunProfile.getWearBadge());
|
||||||
}
|
}
|
||||||
|
if (Objects.nonNull(userRunProfile.getWearHonor())) {
|
||||||
|
update.set("wearHonor", userRunProfile.getWearHonor());
|
||||||
|
}
|
||||||
|
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -247,7 +247,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
|
|||||||
if (!CollectionUtils.isEmpty(useBadgeDTOS)) {
|
if (!CollectionUtils.isEmpty(useBadgeDTOS)) {
|
||||||
newUserRunProfile.addWearBadge(useBadgeDTOS.stream()
|
newUserRunProfile.addWearBadge(useBadgeDTOS.stream()
|
||||||
.filter(e -> !BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
|
.filter(e -> !BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
|
||||||
newUserRunProfile.setWearHonor(useBadgeDTOS.stream()
|
newUserRunProfile.addWearHonor(useBadgeDTOS.stream()
|
||||||
.filter(e -> BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
|
.filter(e -> BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user