From 425525f5326eecc2e16d8cb3945f500ada66088d Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 16 Mar 2026 18:30:16 +0800 Subject: [PATCH] =?UTF-8?q?VIP=E6=9D=83=E7=9B=8A-=E7=A5=9E=E7=A7=98?= =?UTF-8?q?=E9=9A=90=E8=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/query/RankingListQryExe.java | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/RankingListQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/RankingListQryExe.java index c572f88d..6741f4e8 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/RankingListQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/RankingListQryExe.java @@ -7,6 +7,7 @@ import com.red.circle.other.app.dto.clientobject.activity.RankingActivityRecordC import com.red.circle.other.app.dto.clientobject.activity.RankingListCO; import com.red.circle.other.app.dto.clientobject.activity.UserRankInfoCO; import com.red.circle.other.app.dto.cmd.activity.RankingListQueryCmd; +import com.red.circle.other.domain.enums.VipAbilityType; import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.domain.model.user.UserProfile; import com.red.circle.other.domain.ranking.RankingActivityType; @@ -41,6 +42,8 @@ import java.util.stream.IntStream; @RequiredArgsConstructor public class RankingListQryExe { + private static final String INVISIBLE_AVATAR = "https://tkm-likei.oss-ap-southeast-1.aliyuncs.com/default_avatar/yinshen.png"; + private final RankingActivityGateway rankingActivityGateway; private final RankingActivityConvertor convertor; private final UserProfileGateway userProfileGateway; @@ -81,9 +84,18 @@ public class RankingListQryExe { UserProfileDTO userProfileDTO = userProfileMap.get(record.getUserId()); if (userProfileDTO != null) { - co.setAccount(userProfileDTO.getAccount()); - co.setNickname(userProfileDTO.getUserNickname()); - co.setAvatar(userProfileDTO.getUserAvatar()); + boolean invisible = userProfileGateway.getUserVipAbility( + record.getUserId(), VipAbilityType.MYSTERIOUS_INVISIBILITY); + if (invisible) { + co.setUserId(null); + co.setAccount(null); + co.setNickname(maskNickname(userProfileDTO.getUserNickname())); + co.setAvatar(INVISIBLE_AVATAR); + } else { + co.setAccount(userProfileDTO.getAccount()); + co.setNickname(userProfileDTO.getUserNickname()); + co.setAvatar(userProfileDTO.getUserAvatar()); + } } return co; }) @@ -244,6 +256,19 @@ public class RankingListQryExe { } } + /** + * 昵称脱敏,只显示前两位 + */ + private String maskNickname(String nickname) { + if (nickname == null || nickname.isEmpty()) { + return "**"; + } + if (nickname.length() <= 2) { + return nickname; + } + return nickname.substring(0, 2) + "**"; + } + /** * 计算是一年中的第几周(简化实现) */