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 66154914..a5862466 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 @@ -50,9 +50,11 @@ public class UserViolationAdjustCmdExe { @Transactional(rollbackFor = Exception.class) public ViolationHandleResultCO execute(UserViolationHandleCmd cmd) { + ViolationTypeEnum violationTypeEnum = ViolationTypeEnum.getByCode(cmd.getViolationType()); + // 1. 权限验证 ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION, administratorService.existsAdmin(cmd.getReqUserId()) && - administratorAuthService.existsAuth(cmd.requiredReqUserId(), ManagerApprovalType.USER_AVATAR.name())); + administratorAuthService.existsAuth(cmd.requiredReqUserId(), violationTypeEnum.name())); // 2. 查询用户信息 UserProfile userProfile = userProfileGateway.getByUserId(cmd.getUserId()); 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 5e41f70e..635968b4 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 @@ -47,9 +47,11 @@ public class UserViolationWarningCmdExe { @Transactional(rollbackFor = Exception.class) public ViolationHandleResultCO execute(UserViolationHandleCmd cmd) { + ViolationTypeEnum violationTypeEnum = ViolationTypeEnum.getByCode(cmd.getViolationType()); + // 1. 权限验证 ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION,administratorService.existsAdmin(cmd.getReqUserId()) && - administratorAuthService.existsAuth(cmd.requiredReqUserId(), ManagerApprovalType.USER_NICKNAME.name())); + administratorAuthService.existsAuth(cmd.requiredReqUserId(), violationTypeEnum.name())); // 2. 查询用户信息 UserProfile userProfile = userProfileGateway.getByUserId(cmd.getUserId());