荣誉勋章增加use字段
This commit is contained in:
parent
5bcf9c36ce
commit
bc973c1bcc
@ -50,6 +50,11 @@ public class UseBadgeDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否佩戴上
|
||||||
|
*/
|
||||||
|
private Boolean use;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 徽章key.
|
* 徽章key.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -50,6 +50,12 @@ public class UserUseBadgeDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否佩戴上
|
||||||
|
*/
|
||||||
|
private Boolean use;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 徽章key.
|
* 徽章key.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -122,6 +122,6 @@ public class UserBadgeCommon {
|
|||||||
*/
|
*/
|
||||||
public List<BadgeBackpackDTO> listUseNotExpireTimeByUserIds(Set<Long> userIds) {
|
public List<BadgeBackpackDTO> listUseNotExpireTimeByUserIds(Set<Long> userIds) {
|
||||||
return badgeInfraConvertor.toListBadgeBackpackDTO(
|
return badgeInfraConvertor.toListBadgeBackpackDTO(
|
||||||
badgeBackpackService.listUseNotExpireTimeByUserIds(userIds));
|
badgeBackpackService.listNotExpireTimeByUserIds(userIds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,6 +72,11 @@ public interface BadgeBackpackService extends BaseService<BadgeBackpack> {
|
|||||||
*/
|
*/
|
||||||
List<BadgeBackpack> listUseNotExpireTimeByUserIds(Set<Long> userIds);
|
List<BadgeBackpack> listUseNotExpireTimeByUserIds(Set<Long> userIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一组用户未过期的徽章.
|
||||||
|
*/
|
||||||
|
List<BadgeBackpack> listNotExpireTimeByUserIds(Set<Long> userIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取一组指定的徽章信息.
|
* 获取一组指定的徽章信息.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -141,6 +141,21 @@ public class BadgeBackpackServiceImpl extends
|
|||||||
.orElseGet(CollectionUtils::newArrayList);
|
.orElseGet(CollectionUtils::newArrayList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BadgeBackpack> listNotExpireTimeByUserIds(Set<Long> userIds) {
|
||||||
|
if (CollectionUtils.isEmpty(userIds)) {
|
||||||
|
return CollectionUtils.newArrayList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Optional.ofNullable(query()
|
||||||
|
.in(userIds.size() > 1, BadgeBackpack::getUserId, userIds)
|
||||||
|
.eq(Objects.equals(userIds.size(), 1), BadgeBackpack::getUserId, userIds.iterator().next())
|
||||||
|
.list())
|
||||||
|
.map(badgeBackpacks -> badgeBackpacks.stream().filter(this::filterAvailable)
|
||||||
|
.collect(Collectors.toList()))
|
||||||
|
.orElseGet(CollectionUtils::newArrayList);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BadgeBackpack> listUserNotExpireTimeByBadgeIds(Long userId, Collection<Long> badgeIds) {
|
public List<BadgeBackpack> listUserNotExpireTimeByBadgeIds(Long userId, Collection<Long> badgeIds) {
|
||||||
if (CollectionUtils.isEmpty(badgeIds)) {
|
if (CollectionUtils.isEmpty(badgeIds)) {
|
||||||
|
|||||||
@ -91,7 +91,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserProfile getByUserId(Long userId) {
|
public UserProfile getByUserId(Long userId) {
|
||||||
UserRunProfile userRunProfile = userRunProfileService.getById(userId);
|
UserRunProfile userRunProfile = null;
|
||||||
if (Objects.nonNull(userRunProfile)) {
|
if (Objects.nonNull(userRunProfile)) {
|
||||||
// 拥有靓号
|
// 拥有靓号
|
||||||
UserSpecialId userSpecialId = userSpecialIdService.getByUserId(userId);
|
UserSpecialId userSpecialId = userSpecialIdService.getByUserId(userId);
|
||||||
@ -356,6 +356,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
|
|||||||
entity.setSelectUrl(badgePictureConfig.getSelectUrl());
|
entity.setSelectUrl(badgePictureConfig.getSelectUrl());
|
||||||
entity.setNotSelectUrl(badgePictureConfig.getNotSelectUrl());
|
entity.setNotSelectUrl(badgePictureConfig.getNotSelectUrl());
|
||||||
entity.setAnimationUrl(badgePictureConfig.getAnimationUrl());
|
entity.setAnimationUrl(badgePictureConfig.getAnimationUrl());
|
||||||
|
entity.setUse(badgeBackpack.getUseProps());
|
||||||
entity.setExpireTime(
|
entity.setExpireTime(
|
||||||
Objects.equals(badgeBackpack.getExpireType(), BadgeBackpackExpireType.PERMANENT.name())
|
Objects.equals(badgeBackpack.getExpireType(), BadgeBackpackExpireType.PERMANENT.name())
|
||||||
? TimestampUtils.nowPlusYear(10).getTime()
|
? TimestampUtils.nowPlusYear(10).getTime()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user