From 74e0aa45bf9e4e327caa1d76d9ef2e33bdb820c0 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Sat, 28 Feb 2026 10:52:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=87=E6=8D=A2vip?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rds/service/props/PropsBackpackService.java | 9 +++++++++ .../service/props/impl/PropsBackpackServiceImpl.java | 11 +++++++++++ .../user/UserRunProfileTransportGatewayImpl.java | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/PropsBackpackService.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/PropsBackpackService.java index 1ef72306..2dd394bc 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/PropsBackpackService.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/PropsBackpackService.java @@ -86,6 +86,15 @@ public interface PropsBackpackService extends BaseService { */ PropsBackpack getUserNotExpiredUseProps(Long userId, PropsCommodityType type); + /** + * 获取佩戴的道具. + * + * @param userId 用户id + * @param type 道具类型 + * @return ignore + */ + PropsBackpack getUserUseProps(Long userId, PropsCommodityType type); + /** * 获取用户资源信息. * diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/impl/PropsBackpackServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/impl/PropsBackpackServiceImpl.java index b92572c3..295566a1 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/impl/PropsBackpackServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/impl/PropsBackpackServiceImpl.java @@ -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() diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java index 7e44ed40..1a90c7ea 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java @@ -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();