用户信息接口处理为 获取未过期的道具信息
This commit is contained in:
parent
ef1eb37af5
commit
5bcf9c36ce
@ -131,9 +131,9 @@ public interface PropsBackpackService extends BaseService<PropsBackpack> {
|
||||
List<PropsBackpack> listNotExpiredUseProps(Long userId);
|
||||
|
||||
/**
|
||||
* 获取一组正在使用道具信息.
|
||||
* 获取一组未过期的道具信息.
|
||||
*/
|
||||
List<PropsBackpack> listNotExpiredUseProps(Set<Long> userIds);
|
||||
List<PropsBackpack> listNotExpiredProps(Set<Long> userIds);
|
||||
|
||||
/**
|
||||
* 获取一组正在使用道具信息.
|
||||
|
||||
@ -194,14 +194,13 @@ public class PropsBackpackServiceImpl extends
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PropsBackpack> listNotExpiredUseProps(Set<Long> userIds) {
|
||||
public List<PropsBackpack> listNotExpiredProps(Set<Long> userIds) {
|
||||
if (CollectionUtils.isEmpty(userIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return Optional.ofNullable(query()
|
||||
.in(userIds.size() > 1, PropsBackpack::getUserId, userIds)
|
||||
.eq(Objects.equals(userIds.size(), 1), PropsBackpack::getUserId, userIds.iterator().next())
|
||||
.eq(PropsBackpack::getUseProps, Boolean.TRUE)
|
||||
.gt(PropsBackpack::getExpireTime, TimestampUtils.now())
|
||||
.list())
|
||||
.orElse(Lists.newArrayList());
|
||||
|
||||
@ -21,7 +21,6 @@ import com.red.circle.other.infra.database.rds.entity.family.FamilyMemberInfo;
|
||||
import com.red.circle.other.infra.database.rds.entity.props.PropsBackpack;
|
||||
import com.red.circle.other.infra.database.rds.entity.user.user.BaseInfo;
|
||||
import com.red.circle.other.infra.database.rds.entity.user.user.OneTimeTask;
|
||||
import com.red.circle.other.infra.database.rds.entity.user.user.CpRelationship;
|
||||
import com.red.circle.other.infra.database.rds.service.badge.BadgeConfigService;
|
||||
import com.red.circle.other.infra.database.rds.service.badge.BadgePictureConfigService;
|
||||
import com.red.circle.other.infra.database.rds.service.family.FamilyMemberInfoService;
|
||||
@ -31,8 +30,6 @@ import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserBackpa
|
||||
import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserCustomizeService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.BaseInfoService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.OneTimeTaskService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.CpRelationshipService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.CpValueService;
|
||||
import com.red.circle.other.infra.utils.ZonedDateTimeUtils;
|
||||
import com.red.circle.other.inner.enums.material.BadgeBackpackExpireType;
|
||||
import com.red.circle.other.inner.enums.material.BadgeConfigTypeEnum;
|
||||
@ -48,17 +45,13 @@ 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.CpSimpleUserProfileCO;
|
||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||
import com.red.circle.tool.core.date.DateUtils;
|
||||
import com.red.circle.tool.core.date.TimestampUtils;
|
||||
import com.red.circle.tool.core.json.JacksonUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@ -389,7 +382,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
|
||||
}
|
||||
|
||||
List<PropsBackpackDTO> propsBackpacks = propsUserInfraConvertor.toListPropsBackpackDTO(
|
||||
propsBackpackService.listNotExpiredUseProps(userIds)
|
||||
propsBackpackService.listNotExpiredProps(userIds)
|
||||
);
|
||||
|
||||
if (CollectionUtils.isEmpty(propsBackpacks)) {
|
||||
|
||||
@ -22,7 +22,6 @@ import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -145,7 +144,7 @@ public class PropsBackpackClientServiceImpl implements PropsBackpackClientServic
|
||||
@Override
|
||||
public List<PropsBackpackDTO> listNotExpiredUseProps(Set<Long> userIds) {
|
||||
return propsInnerConvertor.toListPropsBackpackDTO(
|
||||
propsBackpackService.listNotExpiredUseProps(userIds)
|
||||
propsBackpackService.listNotExpiredProps(userIds)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user