From 602e384cd50eb62c5881b3840943ce4b151bc066 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 16 Sep 2025 16:25:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=98=AF=E5=90=A6=E6=9C=89=E8=B5=A0=E9=80=81?= =?UTF-8?q?VIP=E6=9D=83=E9=99=90=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/app/h5/MemberActiveController.java | 9 +++++++++ .../user/user/UserIdentityServiceImpl.java | 18 ++++++++++++++++++ .../service/user/user/UserIdentityService.java | 7 +++++++ 3 files changed, 34 insertions(+) diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/h5/MemberActiveController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/h5/MemberActiveController.java index 1ec4e34c..2414d78c 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/h5/MemberActiveController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/h5/MemberActiveController.java @@ -8,6 +8,7 @@ import com.red.circle.order.inner.endpoint.UserFreightRechargeRecordClient; import com.red.circle.order.inner.endpoint.UserMonthlyRechargeClient; import com.red.circle.order.inner.endpoint.api.UserMonthlyRechargeClientApi; import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; +import com.red.circle.other.app.dto.cmd.material.PropsStoreTypeQryCmd; import com.red.circle.other.app.dto.h5.MemberActiveDTO; import com.red.circle.other.app.dto.h5.RechargePageVO; import com.red.circle.other.app.dto.h5.UserIdentityVO; @@ -73,4 +74,12 @@ public class MemberActiveController extends BaseController { return rechargeUserService.getRechargeSummary(cmd); } + /** + * 是否有指定道具类型的权限 + */ + @GetMapping("/own-permission") + public Boolean permission(PropsStoreTypeQryCmd cmd) { + return userIdentityService.hasPermission(cmd); + } + } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/UserIdentityServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/UserIdentityServiceImpl.java index a7115151..ebf1cc89 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/UserIdentityServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/UserIdentityServiceImpl.java @@ -2,16 +2,20 @@ package com.red.circle.other.app.service.user.user; import com.red.circle.framework.core.asserts.ResponseAssert; +import com.red.circle.other.app.dto.cmd.material.PropsStoreTypeQryCmd; import com.red.circle.other.app.dto.h5.UserIdentityVO; +import com.red.circle.other.infra.database.rds.service.sys.AdministratorAuthService; import com.red.circle.other.infra.database.rds.service.sys.AdministratorService; import com.red.circle.other.inner.endpoint.team.bd.BdTeamInfoClient; import com.red.circle.other.inner.endpoint.team.target.TeamProfileClient; +import com.red.circle.other.inner.enums.material.PropsCommodityType; import com.red.circle.other.inner.enums.team.TeamMemberRole; import com.red.circle.other.inner.model.dto.agency.agency.TeamMemberDTO; import com.red.circle.wallet.inner.endpoint.freight.FreightGoldClient; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.List; import java.util.Objects; @Service @@ -22,6 +26,7 @@ public class UserIdentityServiceImpl implements UserIdentityService { private final FreightGoldClient freightGoldClient; private final BdTeamInfoClient bdTeamInfoClient; private final AdministratorService administratorService; + private final AdministratorAuthService administratorAuthService; @Override public UserIdentityVO getUserIdentity(Long userId) { @@ -35,4 +40,17 @@ public class UserIdentityServiceImpl implements UserIdentityService { .setAdmin(administratorService.existsAdmin(userId)); } + @Override + public Boolean hasPermission(PropsStoreTypeQryCmd cmd) { + List authResources = administratorAuthService.listAuthResources(cmd.requiredReqUserId()); + boolean isHaveAuth = false; + if (PropsCommodityType.RIDE.equals(cmd.getPropsType())) { + isHaveAuth = authResources.contains("ALL_VEHICLE"); + } + if (PropsCommodityType.NOBLE_VIP.equals(cmd.getPropsType())) { + isHaveAuth = authResources.contains("ALL_VIP"); + } + return isHaveAuth; + } + } diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/user/user/UserIdentityService.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/user/user/UserIdentityService.java index 8c0dea40..15e8ebd9 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/user/user/UserIdentityService.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/user/user/UserIdentityService.java @@ -1,5 +1,6 @@ package com.red.circle.other.app.service.user.user; +import com.red.circle.other.app.dto.cmd.material.PropsStoreTypeQryCmd; import com.red.circle.other.app.dto.h5.UserIdentityVO; public interface UserIdentityService { @@ -9,4 +10,10 @@ public interface UserIdentityService { */ UserIdentityVO getUserIdentity(Long userId); + /** + * 用户是否有指定道具类型的权限 + * @param cmd + * @return + */ + Boolean hasPermission(PropsStoreTypeQryCmd cmd); }