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