Jelajahi Sumber

使用 AccountQuery 接口提供的 userId 混淆方法

reghao 10 bulan lalu
induk
melakukan
22057cc730
21 mengubah file dengan 95 tambahan dan 159 penghapusan
  1. 5 5
      account/account-service/src/main/java/cn/reghao/tnb/account/app/controller/AccountResourceController.java
  2. 6 6
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/AuthSuccessHandlerImpl.java
  3. 10 7
      account/account-service/src/main/java/cn/reghao/tnb/account/app/service/impl/AccountTokenServiceImpl.java
  4. 7 10
      content/content-service/src/main/java/cn/reghao/tnb/content/app/chat/service/ChatRecordService.java
  5. 0 6
      content/content-service/src/main/java/cn/reghao/tnb/content/app/config/BeansConfig.java
  6. 0 1
      content/content-service/src/main/java/cn/reghao/tnb/content/app/config/web/TokenFilter.java
  7. 6 6
      content/content-service/src/main/java/cn/reghao/tnb/content/app/data/controller/ImageQueryController.java
  8. 6 6
      content/content-service/src/main/java/cn/reghao/tnb/content/app/data/service/ImagePostService.java
  9. 5 14
      content/content-service/src/main/java/cn/reghao/tnb/content/app/mobile/service/AndroidService.java
  10. 6 5
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/controller/ContentController.java
  11. 1 4
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/controller/RecommendController.java
  12. 6 7
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/controller/VideoQueryController.java
  13. 5 6
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/impl/VideoPostQueryImpl.java
  14. 0 17
      file/file-service/src/main/java/cn/reghao/tnb/file/app/config/BeansConfig.java
  15. 0 17
      user/user-service/src/main/java/cn/reghao/tnb/user/app/config/BeansConfig.java
  16. 7 5
      user/user-service/src/main/java/cn/reghao/tnb/user/app/controller/UserProfileController.java
  17. 11 9
      user/user-service/src/main/java/cn/reghao/tnb/user/app/controller/UserRelationController.java
  18. 3 6
      user/user-service/src/main/java/cn/reghao/tnb/user/app/rpc/UserServiceImpl.java
  19. 3 7
      user/user-service/src/main/java/cn/reghao/tnb/user/app/service/ContactService.java
  20. 3 6
      user/user-service/src/main/java/cn/reghao/tnb/user/app/service/CrawledUserService.java
  21. 5 9
      user/user-service/src/main/java/cn/reghao/tnb/user/app/service/UserProfileService.java

+ 5 - 5
account/account-service/src/main/java/cn/reghao/tnb/account/app/controller/AccountResourceController.java

@@ -1,10 +1,10 @@
 package cn.reghao.tnb.account.app.controller;
 
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
 import cn.reghao.jutil.jdk.string.StringRegexp;
 import cn.reghao.tnb.account.api.dto.AccountInfo;
 import cn.reghao.tnb.account.api.dto.OAuthAccountInfo;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.account.app.db.mapper.UserAccountMapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -24,11 +24,11 @@ import org.springframework.web.bind.annotation.*;
 @RequestMapping("/api/account/resource")
 public class AccountResourceController {
     private final UserAccountMapper userAccountMapper;
-    private final IDObfuscation userIdObfuscation;
+    private final AccountQuery accountQuery;
 
-    public AccountResourceController(UserAccountMapper userAccountMapper, IDObfuscation userIdObfuscation) {
+    public AccountResourceController(UserAccountMapper userAccountMapper, AccountQuery accountQuery) {
         this.userAccountMapper = userAccountMapper;
-        this.userIdObfuscation = userIdObfuscation;
+        this.accountQuery = accountQuery;
     }
 
     @ApiOperation(value = "OAuth2 认证访问", notes = "N")
@@ -43,7 +43,7 @@ public class AccountResourceController {
             AccountInfo accountInfo = getAccountInfo(principal);
             if (accountInfo != null) {
                 String userIdStr = accountInfo.getUserId();
-                long userId = userIdObfuscation.restore(userIdStr);
+                long userId = accountQuery.getUserId(userIdStr);
                 OAuthAccountInfo oAuthAccountInfo = new OAuthAccountInfo(userId, accountInfo.getScreenName());
                 return WebResult.success(oAuthAccountInfo);
             }

+ 6 - 6
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/AuthSuccessHandlerImpl.java

@@ -1,9 +1,9 @@
 package cn.reghao.tnb.account.app.security.handler;
 
 import cn.reghao.jutil.jdk.converter.DateTimeConverter;
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
 import cn.reghao.jutil.web.ServletUtil;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.account.app.middleware.RabbitProducer;
 import cn.reghao.tnb.account.app.model.constant.LoginPlat;
 import cn.reghao.tnb.account.api.dto.AccountInfo;
@@ -41,16 +41,16 @@ public class AuthSuccessHandlerImpl implements AuthenticationSuccessHandler {
     private final LoginAttemptService loginAttemptService;
     private final UserAccountMapper userAccountMapper;
     private final AccountTokenService accountTokenService;
-    private final IDObfuscation userIdObfuscation;
+    private final AccountQuery accountQuery;
 
     public AuthSuccessHandlerImpl(RabbitProducer rabbitProducer, LoginAttemptService loginAttemptService,
                                   UserAccountMapper userAccountMapper, AccountTokenService accountTokenService,
-                                  IDObfuscation userIdObfuscation) {
+                                  AccountQuery accountQuery) {
         this.rabbitProducer = rabbitProducer;
         this.loginAttemptService = loginAttemptService;
         this.userAccountMapper = userAccountMapper;
         this.accountTokenService = accountTokenService;
-        this.userIdObfuscation = userIdObfuscation;
+        this.accountQuery = accountQuery;
     }
 
     @Override
@@ -99,11 +99,11 @@ public class AuthSuccessHandlerImpl implements AuthenticationSuccessHandler {
         AccountLoginRet accountLoginRet = new AccountLoginRet(redirectPath);
         if (LoginPlat.web.getValue() == plat) {
             accountTokenService.setCookie(authToken, timeout);
-            String userIdStr = userIdObfuscation.obfuscate(userId);
+            String userIdStr = accountQuery.getUserIdStr(userId);
             accountLoginRet = new AccountLoginRet(userIdStr, loginId, plat, redirectPath);
         } else if (LoginPlat.android.getValue() == plat) {
             AccountInfo accountInfo = userAccountMapper.findAccountInfo(userId);
-            String userIdStr = userIdObfuscation.obfuscate(Long.parseLong(accountInfo.getUserId()));
+            String userIdStr = accountQuery.getUserIdStr(Long.parseLong(accountInfo.getUserId()));
             accountInfo.setUserId(userIdStr);
             AccountToken accountToken = accountTokenService.grantUserToken(authToken);
             accountLoginRet = new AccountLoginRet(accountInfo, accountToken, redirectPath);

+ 10 - 7
account/account-service/src/main/java/cn/reghao/tnb/account/app/service/impl/AccountTokenServiceImpl.java

@@ -4,6 +4,7 @@ import cn.reghao.jutil.jdk.security.RandomString;
 import cn.reghao.jutil.jdk.security.RsaCryptor;
 import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.tnb.account.api.constant.TokenType;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.account.app.db.mapper.LoginAttemptsMapper;
 import cn.reghao.tnb.account.app.model.constant.LoginPlat;
 import cn.reghao.tnb.account.api.dto.AccountInfo;
@@ -50,12 +51,13 @@ public class AccountTokenServiceImpl implements AccountTokenService {
     private final UserAccountMapper userAccountMapper;
     private final LoginAttemptsMapper loginAttemptsMapper;
     private final PubkeyService pubkeyService;
-    private final IDObfuscation userIdObfuscation;
+    private final IDObfuscation idObfuscation;
+    private final AccountQuery accountQuery;
 
     public AccountTokenServiceImpl(RedisOps redisOps, RedisString redisString, RedisStringObject redisStringObject,
                                    UserAccountMapper userAccountMapper, LoginAttemptsMapper loginAttemptsMapper,
                                    ServerProperties serverProperties, PubkeyService pubkeyService,
-                                   IDObfuscation userIdObfuscation) {
+                                   IDObfuscation idObfuscation, AccountQuery accountQuery) {
         long sessionTimeout = serverProperties.getServlet().getSession().getTimeout().getSeconds();
         this.redisOps = redisOps;
         this.redisString = redisString;
@@ -63,7 +65,8 @@ public class AccountTokenServiceImpl implements AccountTokenService {
         this.userAccountMapper = userAccountMapper;
         this.loginAttemptsMapper = loginAttemptsMapper;
         this.pubkeyService = pubkeyService;
-        this.userIdObfuscation = userIdObfuscation;
+        this.idObfuscation = idObfuscation;
+        this.accountQuery = accountQuery;
     }
 
     @Override
@@ -114,7 +117,7 @@ public class AccountTokenServiceImpl implements AccountTokenService {
         String savedSignKey = redisString.get(RedisKeys.getJwtSignKey("pubkey"));
         RSAPublicKey rsaPublicKey = RsaCryptor.getRSAPublicKey(savedSignKey);
         try {
-            AccountAuthToken userAuthToken = JwtUtil.getAuthentication1(token, rsaPublicKey, userIdObfuscation);
+            AccountAuthToken userAuthToken = JwtUtil.getAuthentication1(token, rsaPublicKey, idObfuscation);
             if (userAuthToken != null) {
                 return userAuthToken;
             }
@@ -137,7 +140,7 @@ public class AccountTokenServiceImpl implements AccountTokenService {
         int plat = refreshPayload.getPlat();
         String loginId = refreshPayload.getLoginId();
         long userId = refreshPayload.getUserId();
-        String userIdStr = userIdObfuscation.obfuscate(userId);
+        String userIdStr = accountQuery.getUserIdStr(userId);
         Object object = redisStringObject.get(RedisKeys.getAuthTokenKey(userIdStr, plat, loginId));
         AccountAuthToken authToken = (AccountAuthToken) object;
 
@@ -153,7 +156,7 @@ public class AccountTokenServiceImpl implements AccountTokenService {
     @Override
     public AccountToken grantUserToken(AccountAuthToken authToken) {
         long userId = authToken.getUserId();
-        String userIdStr = userIdObfuscation.obfuscate(userId);
+        String userIdStr = accountQuery.getUserIdStr(userId);
         int plat = authToken.getPlat();
         long accessExpireIn = 1000L*3600*24*7;
         long accessExpireAt = System.currentTimeMillis() + accessExpireIn;
@@ -268,7 +271,7 @@ public class AccountTokenServiceImpl implements AccountTokenService {
     }
 
     private void revokeUserToken(long userId, int plat, String loginId) {
-        String userIdStr = userIdObfuscation.obfuscate(userId);
+        String userIdStr = accountQuery.getUserIdStr(userId);
         String refreshToken = redisString.get(RedisKeys.getRefreshTokenKey(userIdStr, loginId));
         String accessToken = redisString.get(RedisKeys.getAccessTokenKey(userIdStr, loginId));
         String[] keys = List.of(RedisKeys.getRefreshTokenKey(userIdStr, loginId),

+ 7 - 10
content/content-service/src/main/java/cn/reghao/tnb/content/app/chat/service/ChatRecordService.java

@@ -1,7 +1,7 @@
 package cn.reghao.tnb.content.app.chat.service;
 
 import cn.reghao.file.api.iface.OssService;
-import cn.reghao.jutil.jdk.string.IDObfuscation;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.common.auth.UserContext;
 import cn.reghao.tnb.content.app.chat.db.mapper.*;
 import cn.reghao.tnb.content.app.chat.model.constant.MsgType;
@@ -26,27 +26,24 @@ import java.util.List;
  */
 @Service
 public class ChatRecordService {
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
+    private AccountQuery accountQuery;
     @DubboReference(check = false)
     private UserContactService contactService;
     @DubboReference(check = false)
     private OssService ossService;
 
-    private final ChatDialogMapper chatDialogMapper;
     private final ChatRecordMapper chatRecordMapper;
     private final TextMessageMapper textMessageMapper;
     private final CodeBlockMessageMapper codeBlockMessageMapper;
     private final FileMessageMapper fileMessageMapper;
-    private IDObfuscation userIdObfuscation;
 
-    public ChatRecordService(ChatDialogMapper chatDialogMapper, ChatRecordMapper chatRecordMapper,
-                             TextMessageMapper textMessageMapper, CodeBlockMessageMapper codeBlockMessageMapper,
-                             FileMessageMapper fileMessageMapper, IDObfuscation userIdObfuscation) {
-        this.chatDialogMapper = chatDialogMapper;
+    public ChatRecordService(ChatRecordMapper chatRecordMapper, TextMessageMapper textMessageMapper,
+                             CodeBlockMessageMapper codeBlockMessageMapper, FileMessageMapper fileMessageMapper) {
         this.chatRecordMapper = chatRecordMapper;
         this.textMessageMapper = textMessageMapper;
         this.codeBlockMessageMapper = codeBlockMessageMapper;
         this.fileMessageMapper = fileMessageMapper;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
 
@@ -55,7 +52,7 @@ public class ChatRecordService {
         List<ChatRecordGetRet> list = chatRecordMapper.findChatRecordGetRet(receiverId, loginUser, recordId, limit);
         list.forEach(chatRecordGetRet -> {
             try {
-                long userId1 = userIdObfuscation.restore(chatRecordGetRet.getUserId());
+                long userId1 = accountQuery.getUserId(chatRecordGetRet.getUserId());
                 UserInfo userInfo = contactService.getUserInfo(userId1);
                 if (userInfo != null) {
                     chatRecordGetRet.setNickname(userInfo.getScreenName());
@@ -120,7 +117,7 @@ public class ChatRecordService {
         List<ChatRecordGetRet> list =
                 chatRecordMapper.findChatRecordGetRetByMsgType(msgType, receiverId, loginUser, recordId, limit);
         list.forEach(chatRecordGetRet -> {
-            long userId = userIdObfuscation.restore(chatRecordGetRet.getUserId());
+            long userId = accountQuery.getUserId(chatRecordGetRet.getUserId());
             ContactDetail contactDetail = contactService.getContactDetail(userId);
             chatRecordGetRet.setNickname(contactDetail.getScreenName());
             chatRecordGetRet.setAvatar(contactDetail.getAvatarUrl());

+ 0 - 6
content/content-service/src/main/java/cn/reghao/tnb/content/app/config/BeansConfig.java

@@ -1,6 +1,5 @@
 package cn.reghao.tnb.content.app.config;
 
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.config.BeanPostProcessor;
 import org.springframework.context.annotation.Bean;
@@ -20,11 +19,6 @@ import java.util.stream.Collectors;
  */
 @Configuration
 public class BeansConfig {
-    @Bean
-    public IDObfuscation userIdObfuscation() {
-        return new IDObfuscation(0x12345);
-    }
-
     @Bean
     public static BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() {
         return new BeanPostProcessor() {

+ 0 - 1
content/content-service/src/main/java/cn/reghao/tnb/content/app/config/web/TokenFilter.java

@@ -1,6 +1,5 @@
 package cn.reghao.tnb.content.app.config.web;
 
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.ServletUtil;
 import cn.reghao.tnb.common.auth.LoginUser;
 import cn.reghao.tnb.common.auth.UserContext;

+ 6 - 6
content/content-service/src/main/java/cn/reghao/tnb/content/app/data/controller/ImageQueryController.java

@@ -1,14 +1,14 @@
 package cn.reghao.tnb.content.app.data.controller;
 
 import cn.reghao.jutil.jdk.db.PageList;
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
-import cn.reghao.tnb.content.app.data.model.po.ImagePost;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.content.app.data.model.vo.AlbumCard;
 import cn.reghao.tnb.content.app.data.service.ImagePostService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
@@ -21,18 +21,18 @@ import org.springframework.web.bind.annotation.*;
 @RestController
 @RequestMapping("/api/content/image")
 public class ImageQueryController {
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
+    private AccountQuery accountQuery;
     private final ImagePostService imagePostService;
-    private final IDObfuscation userIdObfuscation;
 
-    public ImageQueryController(ImagePostService imagePostService, IDObfuscation userIdObfuscation) {
+    public ImageQueryController(ImagePostService imagePostService) {
         this.imagePostService = imagePostService;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     @ApiOperation(value = "获取用户的图片稿件列表", notes = "N")
     @GetMapping(value = "/user", produces = MediaType.APPLICATION_JSON_VALUE)
     public String getUserImageAlbum(@RequestParam("userId") String userId, @RequestParam("page") int page) {
-        long userId1 = userIdObfuscation.restore(userId);
+        long userId1 = accountQuery.getUserId(userId);
         PageList<AlbumCard> pageList = imagePostService.getUserAlbums(userId1, page);
         return WebResult.success(pageList);
     }

+ 6 - 6
content/content-service/src/main/java/cn/reghao/tnb/content/app/data/service/ImagePostService.java

@@ -4,10 +4,10 @@ import cn.reghao.file.api.iface.OssService;
 import cn.reghao.jutil.jdk.db.Page;
 import cn.reghao.jutil.jdk.db.PageList;
 import cn.reghao.jutil.jdk.result.Result;
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
 import cn.reghao.jutil.tool.id.SnowFlake;
 import cn.reghao.oss.sdk.model.dto.media.ImageInfo;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.common.auth.UserContext;
 import cn.reghao.tnb.content.api.constant.PostScope;
 import cn.reghao.tnb.content.api.dto.ImagePublishSbt;
@@ -38,6 +38,8 @@ import java.util.stream.Collectors;
 @Slf4j
 @Service
 public class ImagePostService {
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
+    private AccountQuery accountQuery;
     @DubboReference(check = false, timeout = 60_000)
     private OssService ossService;
 
@@ -46,15 +48,13 @@ public class ImagePostService {
     private final ImageRepository imageRepository;
     private final AlbumRepository albumRepository;
     private final ContentPermission contentPermission;
-    private final IDObfuscation userIdObfuscation;
 
     public ImagePostService(ImageRepository imageRepository, AlbumRepository albumRepository,
-                            ContentPermission contentPermission, IDObfuscation userIdObfuscation) {
+                            ContentPermission contentPermission) {
         this.idGenerator = new SnowFlake(1L, 1L);
         this.imageRepository = imageRepository;
         this.albumRepository = albumRepository;
         this.contentPermission = contentPermission;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     public Result create(ImagePublishSbt imagePublishSbt) {
@@ -142,7 +142,7 @@ public class ImagePostService {
                         imagePost.setCoverUrl(ossService.getSignedUrl(channelId, objectId));
                     }
                 }
-                String userIdStr = userIdObfuscation.obfuscate(imagePost.getUserId());
+                String userIdStr = accountQuery.getUserIdStr(imagePost.getUserId());
                 return new AlbumCard(imagePost, userIdStr);
             } catch (Exception e) {
                 e.printStackTrace();
@@ -200,7 +200,7 @@ public class ImagePostService {
         });
 
         PageList<ImageData> pageList = PageList.pageList(pageNumber, pageSize, total, list);
-        String userIdStr = userIdObfuscation.obfuscate(imagePost.getUserId());
+        String userIdStr = accountQuery.getUserIdStr(imagePost.getUserId());
         ImageAlbumCard imageAlbumCard = new ImageAlbumCard(imagePost, userIdStr);
         imageAlbumCard.setImages(pageList);
         if (scope != PostScope.PUBLIC.getCode()) {

+ 5 - 14
content/content-service/src/main/java/cn/reghao/tnb/content/app/mobile/service/AndroidService.java

@@ -1,7 +1,7 @@
 package cn.reghao.tnb.content.app.mobile.service;
 
 import cn.reghao.jutil.jdk.db.PageList;
-import cn.reghao.jutil.jdk.string.IDObfuscation;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.content.api.dto.VideoUrls;
 import cn.reghao.tnb.content.app.vod.model.vo.VideoDetail;
 import cn.reghao.tnb.content.app.vod.model.query.VideoQuery;
@@ -33,6 +33,8 @@ import java.util.stream.Collectors;
  */
 @Service
 public class AndroidService {
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
+    private AccountQuery accountQuery;
     @DubboReference(check = false)
     private UserService userService;
 
@@ -42,21 +44,16 @@ public class AndroidService {
     private final VideoTagMapper videoTagMapper;
     private final CategoryService categoryService;
     private final ContentPermission contentPermission;
-    private final VideoPostQuery videoPostQuery;
-    private IDObfuscation userIdObfuscation;
 
     public AndroidService(VideoPlayService videoPlayService, SearchService searchService,
                           VideoPostMapper videoPostMapper, VideoTagMapper videoTagMapper,
-                          CategoryService categoryService, ContentPermission contentPermission,
-                          VideoPostQuery videoPostQuery, IDObfuscation userIdObfuscation) {
+                          CategoryService categoryService, ContentPermission contentPermission) {
         this.videoPlayService = videoPlayService;
         this.searchService = searchService;
         this.videoPostMapper = videoPostMapper;
         this.videoTagMapper = videoTagMapper;
         this.categoryService = categoryService;
         this.contentPermission = contentPermission;
-        this.videoPostQuery = videoPostQuery;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     public HotSearchTag getSearchTag() {
@@ -83,8 +80,6 @@ public class AndroidService {
     }
 
     public SearchVideoResult searchVideo(String keyword) {
-        /*PageScroll<VideoCard> pageList = searchService.searchByKeyword(keyword, "1");
-        List<VideoBean> list = pageList.getList().stream().map(VideoBean::new).collect(Collectors.toList());*/
         return new SearchVideoResult(Collections.emptyList());
     }
 
@@ -110,10 +105,6 @@ public class AndroidService {
         pageParam.setCategoryId(12);
         pageParam.setPrevId("0");
         pageParam.setNextId("0");
-        //PageList<VideoCard> pageList = PageList.empty();
-        int categoryId = 5;
-        int pn = 1;
-        //PageList<VideoCard> pageList = videoPostQuery.getCategoryShortVideos(categoryId, pn);
         PageList<VideoCard> pageList = PageList.empty();
 
         List<VideoBean> list =  pageList.getList().stream().map(VideoBean::new).collect(Collectors.toList());
@@ -131,7 +122,7 @@ public class AndroidService {
         List<String> tags = videoTagMapper.findVideoTags(videoId);
         videoDetail.setTags(tags);
         String publishByStr = videoDetail.getUserId();
-        long publishBy = userIdObfuscation.restore(publishByStr);
+        long publishBy = accountQuery.getUserId(publishByStr);
         UserCard userCard = userService.getUserAvatar(publishBy);
 
         VideoDetails videoDetails = new VideoDetails(videoDetail, userCard);

+ 6 - 5
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/controller/ContentController.java

@@ -1,7 +1,7 @@
 package cn.reghao.tnb.content.app.vod.controller;
 
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.content.api.iface.AdminSiteService;
 import cn.reghao.tnb.content.app.vod.model.vo.UserContentData;
 import cn.reghao.tnb.content.app.vod.service.ContentService;
@@ -9,6 +9,7 @@ import cn.reghao.tnb.content.app.vod.service.LogService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
@@ -22,14 +23,14 @@ import org.springframework.web.bind.annotation.*;
 @RestController
 @RequestMapping("/api/content")
 public class ContentController {
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
+    private AccountQuery accountQuery;
     private final AdminSiteService siteService;
     private final ContentService contentService;
-    private final IDObfuscation userIdObfuscation;
 
-    public ContentController(AdminSiteService siteService, ContentService contentService, IDObfuscation userIdObfuscation) {
+    public ContentController(AdminSiteService siteService, ContentService contentService) {
         this.siteService = siteService;
         this.contentService = contentService;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     @ApiOperation(value = "获取站点公告", notes = "N")
@@ -42,7 +43,7 @@ public class ContentController {
     @ApiOperation(value = "获取用户内容数据", notes = "N")
     @GetMapping(value = "/userdata", produces = MediaType.APPLICATION_JSON_VALUE)
     public String getUserContentData(@RequestParam("userId") String userId) {
-        long userId1 = userIdObfuscation.restore(userId);
+        long userId1 = accountQuery.getUserId(userId);
         UserContentData userContentData = contentService.getUserContentData(userId1);
         return WebResult.success(userContentData);
     }

+ 1 - 4
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/controller/RecommendController.java

@@ -1,6 +1,5 @@
 package cn.reghao.tnb.content.app.vod.controller;
 
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
 import cn.reghao.tnb.common.auth.AuthUser;
 import cn.reghao.tnb.common.auth.UserContext;
@@ -27,11 +26,9 @@ public class RecommendController {
     private UserService userService;
 
     private final RecommendService recommendService;
-    private final IDObfuscation userIdObfuscation;
 
-    public RecommendController(RecommendService recommendService, IDObfuscation userIdObfuscation) {
+    public RecommendController(RecommendService recommendService) {
         this.recommendService = recommendService;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     @AuthUser

+ 6 - 7
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/controller/VideoQueryController.java

@@ -1,13 +1,12 @@
 package cn.reghao.tnb.content.app.vod.controller;
 
 import cn.reghao.jutil.jdk.db.PageList;
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.common.auth.AuthUser;
 import cn.reghao.tnb.common.auth.UserContext;
 import cn.reghao.tnb.common.db.PageScroll;
 import cn.reghao.tnb.content.app.aop.TimeConsumed;
-import cn.reghao.tnb.content.app.vod.model.po.BannerVideo;
 import cn.reghao.tnb.content.api.dto.VideoCard;
 import cn.reghao.tnb.content.app.vod.model.vo.BannerVideoVO;
 import cn.reghao.tnb.content.app.vod.model.vo.VideoDetail;
@@ -16,6 +15,7 @@ import cn.reghao.tnb.content.app.vod.service.VideoPostQuery;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
@@ -31,15 +31,14 @@ import java.util.List;
 @RestController
 @RequestMapping("/api/content/video")
 public class VideoQueryController {
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
+    private AccountQuery accountQuery;
     private final VideoPostQuery videoPostQuery;
     private final RecommendService recommendService;
-    private final IDObfuscation userIdObfuscation;
 
-    public VideoQueryController(VideoPostQuery videoPostQuery, RecommendService recommendService,
-                                IDObfuscation userIdObfuscation) {
+    public VideoQueryController(VideoPostQuery videoPostQuery, RecommendService recommendService) {
         this.videoPostQuery = videoPostQuery;
         this.recommendService = recommendService;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     @TimeConsumed
@@ -61,7 +60,7 @@ public class VideoQueryController {
     @ApiOperation(value = "获取某个用户发布的视频", notes = "N")
     @GetMapping(value = "/user", produces = MediaType.APPLICATION_JSON_VALUE)
     public String getUserVideos(@RequestParam("userId") String userId, @RequestParam("page") int page) {
-        long userId1 = userIdObfuscation.restore(userId);
+        long userId1 = accountQuery.getUserId(userId);
         PageList<VideoCard> pageList = videoPostQuery.getUserVideos(userId1, page);
         return WebResult.success(pageList);
     }

+ 5 - 6
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/impl/VideoPostQueryImpl.java

@@ -3,10 +3,10 @@ package cn.reghao.tnb.content.app.vod.service.impl;
 import cn.reghao.file.api.iface.OssService;
 import cn.reghao.jutil.jdk.db.Page;
 import cn.reghao.jutil.jdk.db.PageList;
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
 import cn.reghao.oss.sdk.model.dto.media.VideoInfo;
 import cn.reghao.oss.sdk.model.dto.media.VideoUrlDto;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.common.auth.UserContext;
 import cn.reghao.tnb.common.util.StringUtil;
 import cn.reghao.tnb.content.api.constant.PostScope;
@@ -17,7 +17,6 @@ import cn.reghao.tnb.content.api.dto.VideoPostCard;
 import cn.reghao.tnb.content.app.vod.db.mapper.*;
 import cn.reghao.tnb.content.app.vod.db.repository.VideoRepository;
 import cn.reghao.tnb.content.app.vod.model.po.*;
-import cn.reghao.tnb.content.app.vod.model.po.BannerVideo;
 import cn.reghao.tnb.content.app.vod.model.vo.BannerVideoVO;
 import cn.reghao.tnb.content.app.vod.model.vo.VideoDetail;
 import cn.reghao.tnb.content.app.vod.model.query.VideoQuery;
@@ -43,6 +42,8 @@ import java.util.stream.Collectors;
  */
 @Service
 public class VideoPostQueryImpl implements VideoPostQuery {
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
+    private AccountQuery accountQuery;
     @DubboReference(check = false)
     private UserService userService;
     @DubboReference(check = false)
@@ -59,7 +60,6 @@ public class VideoPostQueryImpl implements VideoPostQuery {
     private final CategoryService categoryService;
     private final VideoRepository videoRepository;
     private final Random random = new SecureRandom();
-    private final IDObfuscation userIdObfuscation;
     private final BannerVideoMapper bannerVideoMapper;
 
     public VideoPostQueryImpl(VideoPostMapper videoPostMapper, VideoFileMapper videoFileMapper, VideoTagMapper videoTagMapper,
@@ -75,7 +75,6 @@ public class VideoPostQueryImpl implements VideoPostQuery {
         this.contentPermission = contentPermission;
         this.categoryService = categoryService;
         this.videoRepository = videoRepository;
-        this.userIdObfuscation = new IDObfuscation(0x12345);
         this.videoPostTagMapper = videoPostTagMapper;
         this.bannerVideoMapper = bannerVideoMapper;
     }
@@ -125,7 +124,7 @@ public class VideoPostQueryImpl implements VideoPostQuery {
         VideoStatistic videoStatistic = videoStatisticMapper.findByVideoId(videoId);
 
         long publishBy = videoPost.getPublishBy();
-        String publishByStr = userIdObfuscation.obfuscate(publishBy);
+        String publishByStr = accountQuery.getUserIdStr(publishBy);
         VideoDetail videoDetail = new VideoDetail(videoPost, videoStatistic, publishByStr);
         List<String> tags = videoTagMapper.findVideoTags(videoId);
         videoDetail.setTags(tags);
@@ -258,7 +257,7 @@ public class VideoPostQueryImpl implements VideoPostQuery {
         }
 
         long publishBy = videoPost.getPublishBy();
-        String publishByStr = userIdObfuscation.obfuscate(publishBy);
+        String publishByStr = accountQuery.getUserIdStr(publishBy);
         VideoStatistic videoStatistic = videoStatisticMapper.findByVideoId(videoId);
         VideoDetail videoDetail = new VideoDetail(videoPost, videoStatistic, publishByStr);
         List<String> tags = videoTagMapper.findVideoTags(videoId);

+ 0 - 17
file/file-service/src/main/java/cn/reghao/tnb/file/app/config/BeansConfig.java

@@ -1,17 +0,0 @@
-package cn.reghao.tnb.file.app.config;
-
-import cn.reghao.jutil.jdk.string.IDObfuscation;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author reghao
- * @date 2025-04-02 20:49:55
- */
-@Configuration
-public class BeansConfig {
-    @Bean
-    public IDObfuscation userIdObfuscation() {
-        return new IDObfuscation(0x12345);
-    }
-}

+ 0 - 17
user/user-service/src/main/java/cn/reghao/tnb/user/app/config/BeansConfig.java

@@ -1,17 +0,0 @@
-package cn.reghao.tnb.user.app.config;
-
-import cn.reghao.jutil.jdk.string.IDObfuscation;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author reghao
- * @date 2025-03-29 21:58:56
- */
-@Configuration
-public class BeansConfig {
-    @Bean
-    public IDObfuscation userIdObfuscation() {
-        return new IDObfuscation(0x12345);
-    }
-}

+ 7 - 5
user/user-service/src/main/java/cn/reghao/tnb/user/app/controller/UserProfileController.java

@@ -1,12 +1,13 @@
 package cn.reghao.tnb.user.app.controller;
 
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.user.api.dto.UserInfo;
 import cn.reghao.tnb.user.app.model.dto.UserProfileUpdate;
 import cn.reghao.tnb.user.app.service.UserProfileService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.http.MediaType;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -21,12 +22,13 @@ import java.util.Collections;
 @RestController
 @RequestMapping("/api/user")
 public class UserProfileController {
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
+    private AccountQuery accountQuery;
+
     private final UserProfileService userProfileService;
-    private final IDObfuscation userIdObfuscation;
 
-    public UserProfileController(UserProfileService userProfileService, IDObfuscation userIdObfuscation) {
+    public UserProfileController(UserProfileService userProfileService) {
         this.userProfileService = userProfileService;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     @ApiOperation(value = "修改用户资料", notes = "N")
@@ -39,7 +41,7 @@ public class UserProfileController {
     @ApiOperation(value = "获取用户资料", notes = "N")
     @GetMapping(value = "/info", produces = MediaType.APPLICATION_JSON_VALUE)
     public String getUserInfo(@RequestParam("userId") String userId) {
-        long userId1 = userIdObfuscation.restore(userId);
+        long userId1 = accountQuery.getUserId(userId);
         UserInfo userInfo = userProfileService.getUserInfo(userId1);
         return WebResult.success(userInfo);
     }

+ 11 - 9
user/user-service/src/main/java/cn/reghao/tnb/user/app/controller/UserRelationController.java

@@ -1,13 +1,14 @@
 package cn.reghao.tnb.user.app.controller;
 
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.jutil.web.WebResult;
+import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.user.api.dto.UserCard;
 import cn.reghao.tnb.common.auth.AuthUser;
 import cn.reghao.tnb.common.auth.UserContext;
 import cn.reghao.tnb.user.app.service.UserRelationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -20,18 +21,19 @@ import java.util.List;
 @RestController
 @RequestMapping("/api/user/relation")
 public class UserRelationController {
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
+    private AccountQuery accountQuery;
+
     private final UserRelationService userRelationService;
-    private final IDObfuscation userIdObfuscation;
 
-    public UserRelationController(UserRelationService userRelationService, IDObfuscation userIdObfuscation) {
+    public UserRelationController(UserRelationService userRelationService) {
         this.userRelationService = userRelationService;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     @ApiOperation(value = "关注用户", notes = "N")
     @PostMapping("/follow/{followingId}")
     public String followUser(@PathVariable("followingId") String followingId) {
-        long followingId1 = userIdObfuscation.restore(followingId);
+        long followingId1 = accountQuery.getUserId(followingId);
         long loginUser = UserContext.getUser();
         userRelationService.followUser(loginUser, followingId1);
         return WebResult.success();
@@ -41,7 +43,7 @@ public class UserRelationController {
     @ApiOperation(value = "取消关注用户", notes = "N")
     @PostMapping("/unfollow/{followingId}")
     public String unfollowUser(@PathVariable("followingId") String followingId) {
-        long followingId1 = userIdObfuscation.restore(followingId);
+        long followingId1 = accountQuery.getUserId(followingId);
         long loginUser = UserContext.getUser();
         userRelationService.unfollowUser(loginUser, followingId1);
         return WebResult.success();
@@ -50,7 +52,7 @@ public class UserRelationController {
     @ApiOperation(value = "检查是否关注了用户", notes = "N")
     @GetMapping("/check/{userId}")
     public String check(@PathVariable("userId") String userId) {
-        long userId1 = userIdObfuscation.restore(userId);
+        long userId1 = accountQuery.getUserId(userId);
         long loginUser = UserContext.getUser();
         boolean followed;
         if (loginUser == -1) {
@@ -64,7 +66,7 @@ public class UserRelationController {
     @ApiOperation(value = "获取用户的关注列表", notes = "N")
     @GetMapping("/following/{userId}")
     public String getFollowing(@PathVariable("userId") String userId) {
-        long userId1 = userIdObfuscation.restore(userId);
+        long userId1 = accountQuery.getUserId(userId);
         List<UserCard> list = userRelationService.getFollowingCards(userId1);
         return WebResult.success(list);
     }
@@ -72,7 +74,7 @@ public class UserRelationController {
     @ApiOperation(value = "获取用户的粉丝列表", notes = "N")
     @GetMapping("/follower/{userId}")
     public String getFollower(@PathVariable("userId") String userId) {
-        long userId1 = userIdObfuscation.restore(userId);
+        long userId1 = accountQuery.getUserId(userId);
         List<UserCard> list = userRelationService.getFollowerCards(userId1);
         return WebResult.success(list);
     }

+ 3 - 6
user/user-service/src/main/java/cn/reghao/tnb/user/app/rpc/UserServiceImpl.java

@@ -1,6 +1,5 @@
 package cn.reghao.tnb.user.app.rpc;
 
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.user.api.dto.UserCard;
 import cn.reghao.tnb.user.api.dto.UserMessageDto;
@@ -32,17 +31,15 @@ public class UserServiceImpl implements UserService {
     private final UserVipService userVipService;
     private final UserProfileService userProfileService;
     private final UserMessageService userMessageService;
-    private final IDObfuscation userIdObfuscation;
-    private UserRecommendMapper userRecommendMapper;
+    private final UserRecommendMapper userRecommendMapper;
 
     public UserServiceImpl(UserRelationService userRelationService, UserVipService userVipService,
                            UserProfileService userProfileService, UserMessageService userMessageService,
-                           IDObfuscation userIdObfuscation, UserRecommendMapper userRecommendMapper) {
+                           UserRecommendMapper userRecommendMapper) {
         this.userRelationService = userRelationService;
         this.userVipService = userVipService;
         this.userProfileService = userProfileService;
         this.userMessageService = userMessageService;
-        this.userIdObfuscation = userIdObfuscation;
         this.userRecommendMapper = userRecommendMapper;
     }
 
@@ -56,7 +53,7 @@ public class UserServiceImpl implements UserService {
         return userRelationService.getFollowingCards(userId).stream()
                 .map(userCard -> {
                     String userIdStr = userCard.getUserId();
-                    return userIdObfuscation.restore(userIdStr);
+                    return accountQuery.getUserId(userIdStr);
                 })
                 .collect(Collectors.toList());
     }

+ 3 - 7
user/user-service/src/main/java/cn/reghao/tnb/user/app/service/ContactService.java

@@ -1,7 +1,6 @@
 package cn.reghao.tnb.user.app.service;
 
 import cn.reghao.jutil.jdk.result.Result;
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.tnb.account.api.dto.AccountInfo;
 import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.common.auth.UserContext;
@@ -34,22 +33,19 @@ public class ContactService {
     private final UserContactMapper userContactMapper;
     private final UserContactRecordMapper userContactRecordMapper;
     private final UserProfileService userProfileService;
-    private final IDObfuscation userIdObfuscation;
 
     public ContactService(UserProfileService userProfileService, UserContactMapper userContactMapper,
-                          UserContactRecordMapper userContactRecordMapper, UserMessageService userMessageService,
-                          IDObfuscation userIdObfuscation) {
+                          UserContactRecordMapper userContactRecordMapper) {
         this.userProfileService = userProfileService;
         this.userContactMapper = userContactMapper;
         this.userContactRecordMapper = userContactRecordMapper;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     public SearchContactResult searchUser(String mobile) {
         AccountInfo accountInfo = accountQuery.getByMobile(mobile);
         if (accountInfo != null) {
             String userIdStr = accountInfo.getUserId();
-            long userId = userIdObfuscation.restore(userIdStr);
+            long userId = accountQuery.getUserId(userIdStr);
             UserInfo userInfo = userProfileService.getUserInfo(userId);
             return new SearchContactResult(userInfo);
         }
@@ -60,7 +56,7 @@ public class ContactService {
     public ContactInfoResult getContactInfoResult(long friendId) {
         AccountInfo accountInfo = accountQuery.getAccountInfo(friendId);
         String userIdStr = accountInfo.getUserId();
-        long userId = userIdObfuscation.restore(userIdStr);
+        long userId = accountQuery.getUserId(userIdStr);
         UserInfo userInfo = userProfileService.getUserInfo(userId);
         ContactInfoResult contactInfoResult = new ContactInfoResult(userInfo);
 

+ 3 - 6
user/user-service/src/main/java/cn/reghao/tnb/user/app/service/CrawledUserService.java

@@ -1,6 +1,5 @@
 package cn.reghao.tnb.user.app.service;
 
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.tnb.account.api.dto.AccountInfo;
 import cn.reghao.tnb.account.api.dto.CrawledUser;
 import cn.reghao.tnb.account.api.iface.AccountQuery;
@@ -15,21 +14,19 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class CrawledUserService {
-    @DubboReference(check = false)
+    @DubboReference(check = false, retries = 0, timeout = 60_000)
     private AccountQuery accountQuery;
     private final UserProfileMapper userProfileMapper;
-    private final IDObfuscation userIdObfuscation;
 
-    public CrawledUserService(UserProfileMapper userProfileMapper, IDObfuscation userIdObfuscation) {
+    public CrawledUserService(UserProfileMapper userProfileMapper) {
         this.userProfileMapper = userProfileMapper;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     public Long getUserId(String username) {
         AccountInfo accountInfo = accountQuery.getByUsername(username);
         if (accountInfo != null) {
             String userIdStr = accountInfo.getUserId();
-            long userId = userIdObfuscation.restore(userIdStr);
+            long userId = accountQuery.getUserId(userIdStr);
             return userId;
         }
 

+ 5 - 9
user/user-service/src/main/java/cn/reghao/tnb/user/app/service/UserProfileService.java

@@ -2,7 +2,6 @@ package cn.reghao.tnb.user.app.service;
 
 import cn.reghao.jutil.jdk.db.Page;
 import cn.reghao.jutil.jdk.db.PageList;
-import cn.reghao.jutil.jdk.string.IDObfuscation;
 import cn.reghao.tnb.account.api.dto.AccountInfo;
 import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.common.auth.UserContext;
@@ -35,14 +34,12 @@ public class UserProfileService {
     private final UserProfileMapper userProfileMapper;
     private final UserRelationMapper userRelationMapper;
     private final UserVipService userVipService;
-    private final IDObfuscation userIdObfuscation;
 
     public UserProfileService(UserProfileMapper userProfileMapper, UserRelationMapper userRelationMapper,
-                              UserVipService userVipService, IDObfuscation userIdObfuscation) {
+                              UserVipService userVipService) {
         this.userProfileMapper = userProfileMapper;
         this.userVipService = userVipService;
         this.userRelationMapper = userRelationMapper;
-        this.userIdObfuscation = userIdObfuscation;
     }
 
     public void updateUserProfile(UserProfileUpdate userProfileUpdate) {
@@ -67,7 +64,7 @@ public class UserProfileService {
         int following = userProfile.getFollowing();
         int follower = userProfile.getFollower();
         boolean vip = userVipService.isVip(userId);
-        String userIdStr = userIdObfuscation.obfuscate(userId);
+        String userIdStr = accountQuery.getUserIdStr(userId);
         UserInfo userInfo = new UserInfo(accountInfo, userIdStr, gender, signature, following, follower, vip);
         String username = accountInfo.getUsername();
         if (username.startsWith("bilibili_")) {
@@ -91,7 +88,7 @@ public class UserProfileService {
         return list.stream()
                 .map(accountInfo -> {
                     String userIdStr = accountInfo.getUserId();
-                    long userId = userIdObfuscation.restore(userIdStr);
+                    long userId = accountQuery.getUserId(userIdStr);
                     UserProfile userProfile = userProfileMapper.findByUserId(userId);
                     if (userProfile == null) {
                         userProfile = new UserProfile(userId);
@@ -103,7 +100,6 @@ public class UserProfileService {
                     int following = userProfile.getFollowing();
                     int follower = userProfile.getFollower();
                     boolean vip = userVipService.isVip(userId);
-                    //String userIdStr = userIdObfuscation.obfuscate(userId);
                     return new UserInfo(accountInfo, userIdStr, gender, signature, following, follower, vip);
                 })
                 .collect(Collectors.toList());
@@ -113,7 +109,7 @@ public class UserProfileService {
         long loginUser = UserContext.getUser();
         UserInfo userInfo = getUserInfo(userId);
         boolean followed = isFollowing(loginUser, userId);
-        String userIdStr = userIdObfuscation.obfuscate(userId);
+        String userIdStr = accountQuery.getUserIdStr(userId);
         return new UserCard(userInfo, userIdStr, followed);
     }
 
@@ -126,7 +122,7 @@ public class UserProfileService {
         return list.stream().map(userId -> {
             UserInfo userInfo = getUserInfo(userId);
             boolean followed = isFollowing(loginUser, userId);
-            String userIdStr = userIdObfuscation.obfuscate(userId);
+            String userIdStr = accountQuery.getUserIdStr(userId);
             return new UserCard(userInfo, userIdStr, followed);
         }).collect(Collectors.toList());
     }