自动切换vip校验修复
This commit is contained in:
parent
a01432ea86
commit
74e0aa45bf
@ -86,6 +86,15 @@ public interface PropsBackpackService extends BaseService<PropsBackpack> {
|
||||
*/
|
||||
PropsBackpack getUserNotExpiredUseProps(Long userId, PropsCommodityType type);
|
||||
|
||||
/**
|
||||
* 获取佩戴的道具.
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param type 道具类型
|
||||
* @return ignore
|
||||
*/
|
||||
PropsBackpack getUserUseProps(Long userId, PropsCommodityType type);
|
||||
|
||||
/**
|
||||
* 获取用户资源信息.
|
||||
*
|
||||
|
||||
@ -139,6 +139,17 @@ public class PropsBackpackServiceImpl extends
|
||||
.getOne();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropsBackpack getUserUseProps(Long userId, PropsCommodityType type) {
|
||||
return query()
|
||||
.eq(PropsBackpack::getUserId, userId)
|
||||
.eq(PropsBackpack::getType, type)
|
||||
.eq(PropsBackpack::getUseProps, Boolean.TRUE)
|
||||
.orderByDesc(PropsBackpack::getExpireTime)
|
||||
.last(PageConstant.LIMIT_ONE)
|
||||
.getOne();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropsBackpack getUserProps(Long userId, Long propsId, PropsCommodityType type) {
|
||||
return query()
|
||||
|
||||
@ -434,7 +434,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
|
||||
}
|
||||
|
||||
// 1. 查询当前正在使用的VIP
|
||||
PropsBackpack currentVip = propsBackpackService.getUserNotExpiredUseProps(userId, PropsCommodityType.NOBLE_VIP);
|
||||
PropsBackpack currentVip = propsBackpackService.getUserUseProps(userId, PropsCommodityType.NOBLE_VIP);
|
||||
|
||||
// 2. 检查当前VIP是否过期
|
||||
Timestamp now = TimestampUtils.now();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user