From ad741c84c54f1419fe7c00c540a2785265050fb3 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 19 Mar 2026 14:39:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E6=9C=89=E6=A0=A1=E9=AA=8C=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/user/query/FriendCheckQryExe.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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