diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/FriendCheckQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/FriendCheckQryExe.java index 2ed415d1..997c35b0 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/FriendCheckQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/FriendCheckQryExe.java @@ -51,26 +51,25 @@ public class FriendCheckQryExe { return Boolean.TRUE; } - // 3. ContactMode - ContactMode contactMode = userVipAbilitySettingService.getContactMode(reqUserId); + // 3. 取目标用户的 ContactMode设置 + ContactMode contactMode = userVipAbilitySettingService.getContactMode(targetUserId); // 4. 拒绝联系 if (ContactMode.DO_NOT_DISTURB.equals(contactMode)) { - // 检查是否好友 boolean isFriend = relationshipFriendService.checkFriend(reqUserId, targetUserId); if (!isFriend) { return Boolean.FALSE; } - // 好友可以联系 return Boolean.TRUE; } - // 5. VIP2_ABOVE / VIP5_ABOVE → 限制联系对象 VIP 等级 - String targetVipLevel = userProfileGateway.getUserVipName(targetUserId); - // 检查联系对象 VIP 等级 - SysNobleVipTypeEnum targetVip = SysNobleVipTypeEnum.getByName(targetVipLevel); - if (contactMode.getMinTargetVipLevel() != null && (targetVip == null || targetVip.ordinal() < contactMode.getMinTargetVipLevel().ordinal())) { - return false; // 目标等级不够 + // 5. VIP2_ABOVE / VIP5_ABOVE → 检查发起方(reqUserId)的VIP等级是否足够 + if (contactMode.getMinTargetVipLevel() != null) { + String reqVipName = userProfileGateway.getUserVipName(reqUserId); + SysNobleVipTypeEnum reqVip = SysNobleVipTypeEnum.getByName(reqVipName); + if (reqVip != null && reqVip.ordinal() >= contactMode.getMinTargetVipLevel().ordinal()) { + return Boolean.TRUE; + } } return relationshipFriendService