diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/room/RoomViolationAdjustCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/room/RoomViolationAdjustCmdExe.java index 1fabca28..675fe4b4 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/room/RoomViolationAdjustCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/room/RoomViolationAdjustCmdExe.java @@ -23,6 +23,7 @@ import com.red.circle.other.infra.database.mongo.service.live.RoomProfileManager import com.red.circle.other.infra.database.rds.entity.props.RoomThemeUserBackpack; import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserBackpackService; 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.asserts.RoomErrorCode; import com.red.circle.other.inner.enums.config.EnumConfigKey; import com.red.circle.other.inner.enums.material.PropsCommodityType; @@ -52,7 +53,7 @@ public class RoomViolationAdjustCmdExe { private final OfficialNoticeClient officialNoticeClient; private final UserProfileGateway userProfileGateway; private final EnumConfigCacheService enumConfigCacheService; - private final RoomThemeService roomThemeService; + private final AdministratorService administratorService; private final RoomThemeUserBackpackService roomThemeUserBackpackService; @@ -65,7 +66,7 @@ public class RoomViolationAdjustCmdExe { ResponseAssert.notNull(CommonErrorCode.DATA_ERROR, violationTypeEnum); // 1. 验证管理员权限 - ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION, + ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION, administratorService.existsAdmin(cmd.getReqUserId()) && administratorAuthService.existsAuth(cmd.requiredReqUserId(), violationTypeEnum.name())); // 2. 查询房间信息 diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/room/RoomViolationWarningCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/room/RoomViolationWarningCmdExe.java index fcc84750..ede6ae58 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/room/RoomViolationWarningCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/room/RoomViolationWarningCmdExe.java @@ -18,6 +18,7 @@ import com.red.circle.other.domain.violation.ViolationRecord; import com.red.circle.other.infra.database.mongo.entity.live.RoomProfile; import com.red.circle.other.infra.database.mongo.service.live.RoomProfileManagerService; 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.asserts.RoomErrorCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -39,13 +40,14 @@ public class RoomViolationWarningCmdExe { private final AdministratorAuthService administratorAuthService; private final OfficialNoticeClient officialNoticeClient; private final UserProfileGateway userProfileGateway; + private final AdministratorService administratorService; public ViolationHandleResultCO execute(RoomViolationHandleCmd cmd) { ViolationTypeEnum violationTypeEnum = ViolationTypeEnum.getByCode(cmd.getViolationType()); ResponseAssert.notNull(CommonErrorCode.DATA_ERROR, violationTypeEnum); // 1. 验证管理员权限 - ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION, + ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION, administratorService.existsAdmin(cmd.getReqUserId()) && administratorAuthService.existsAuth(cmd.requiredReqUserId(), violationTypeEnum.name())); // 2. 查询房间信息 diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/user/UserViolationAdjustCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/user/UserViolationAdjustCmdExe.java index 8a370ae1..66e3fcfa 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/user/UserViolationAdjustCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/user/UserViolationAdjustCmdExe.java @@ -17,6 +17,7 @@ import com.red.circle.other.domain.model.user.UserProfile; import com.red.circle.other.domain.violation.ViolationRecord; import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService; 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.asserts.user.UserErrorCode; import com.red.circle.other.inner.enums.config.EnumConfigKey; import com.red.circle.other.inner.enums.sys.appmanager.ManagerApprovalType; @@ -43,11 +44,12 @@ public class UserViolationAdjustCmdExe { private final AdministratorAuthService administratorAuthService; private final OfficialNoticeClient officialNoticeClient; private final EnumConfigCacheService enumConfigCacheService; + private final AdministratorService administratorService; @Transactional(rollbackFor = Exception.class) public ViolationHandleResultCO execute(UserViolationHandleCmd cmd) { // 1. 权限验证 - ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION, + ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION, administratorService.existsAdmin(cmd.getReqUserId()) && administratorAuthService.existsAuth(cmd.requiredReqUserId(), ManagerApprovalType.USER_AVATAR.name())); // 2. 查询用户信息 diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/user/UserViolationWarningCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/user/UserViolationWarningCmdExe.java index 6ccedaf4..20823b07 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/user/UserViolationWarningCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/violation/user/UserViolationWarningCmdExe.java @@ -16,6 +16,7 @@ import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.domain.model.user.UserProfile; import com.red.circle.other.domain.violation.ViolationRecord; 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.asserts.user.UserErrorCode; import com.red.circle.other.inner.enums.sys.appmanager.ManagerApprovalType; import lombok.RequiredArgsConstructor; @@ -39,12 +40,13 @@ public class UserViolationWarningCmdExe { private final UserProfileGateway userProfileGateway; private final ViolationRecordGateway violationRecordGateway; private final AdministratorAuthService administratorAuthService; + private final AdministratorService administratorService; private final OfficialNoticeClient officialNoticeClient; @Transactional(rollbackFor = Exception.class) public ViolationHandleResultCO execute(UserViolationHandleCmd cmd) { // 1. 权限验证 - ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION, + ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION,administratorService.existsAdmin(cmd.getReqUserId()) && administratorAuthService.existsAuth(cmd.requiredReqUserId(), ManagerApprovalType.USER_NICKNAME.name())); // 2. 查询用户信息