diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserShieldBlackAddCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserShieldBlackAddCmdExe.java index e83823d9..3404dfdd 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserShieldBlackAddCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserShieldBlackAddCmdExe.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.red.circle.framework.core.asserts.ResponseAssert; import com.red.circle.framework.core.response.CommonErrorCode; import com.red.circle.other.app.dto.cmd.user.user.UserShieldBlackUserCmd; +import com.red.circle.other.domain.enums.VipAbilityType; +import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.domain.gateway.user.ability.UserRelationsCalculatorGateway; import com.red.circle.other.domain.model.user.ability.UserRelationsCalculator; import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService; @@ -46,8 +48,13 @@ public class UserShieldBlackAddCmdExe { private final UserSubscriptionService userSubscriptionService; private final UserRelationsCalculatorGateway userRelationsCalculatorGateway; private final UserRelationshipCacheService userRelationshipCacheService; + private final UserProfileGateway userProfileGateway; public void execute(UserShieldBlackUserCmd cmd) { + boolean hasAbility = userProfileGateway.getUserVipAbility(cmd.getShieldUserId(), VipAbilityType.ANTI_BLOCK); + if (hasAbility) { + ResponseAssert.isFalse(CommonErrorCode.INSUFFICIENT_PERMISSION, hasAbility); + } String superAdminIds = enumConfigCacheService.getValue(EnumConfigKey.ASWAT_ADMINS, cmd.requireReqSysOrigin());