|
@@ -2,6 +2,7 @@ package cn.reghao.tnb.user.app.rpc;
|
|
|
|
|
|
|
|
import cn.reghao.jutil.jdk.db.PageList;
|
|
import cn.reghao.jutil.jdk.db.PageList;
|
|
|
import cn.reghao.tnb.account.api.dto.AccountInfo;
|
|
import cn.reghao.tnb.account.api.dto.AccountInfo;
|
|
|
|
|
+import cn.reghao.tnb.account.api.dto.CrawledUser;
|
|
|
import cn.reghao.tnb.account.api.iface.AccountQuery;
|
|
import cn.reghao.tnb.account.api.iface.AccountQuery;
|
|
|
import cn.reghao.tnb.content.api.iface.UserContentService;
|
|
import cn.reghao.tnb.content.api.iface.UserContentService;
|
|
|
import cn.reghao.tnb.user.api.dto.UserInfo;
|
|
import cn.reghao.tnb.user.api.dto.UserInfo;
|
|
@@ -87,4 +88,27 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|
|
int duration = vipPlan.getDuration();
|
|
int duration = vipPlan.getDuration();
|
|
|
return new VipPlanInfo(planId, name, price, duration);
|
|
return new VipPlanInfo(planId, name, price, duration);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public Long getUserId(String username) {
|
|
|
|
|
+ AccountInfo accountInfo = accountQuery.getByUsername(username);
|
|
|
|
|
+ if (accountInfo != null) {
|
|
|
|
|
+ long userId = accountInfo.getUserId();
|
|
|
|
|
+ return userId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public synchronized Long createAccount(CrawledUser crawledUser) {
|
|
|
|
|
+ Long userId = accountQuery.createCrawledAccount(crawledUser);
|
|
|
|
|
+ UserProfile userProfile = userProfileMapper.findByUserId(userId);
|
|
|
|
|
+ if (userProfile == null) {
|
|
|
|
|
+ int gender = crawledUser.getGender();
|
|
|
|
|
+ String signature = crawledUser.getSignature();
|
|
|
|
|
+ userProfile = new UserProfile(userId, gender, signature);
|
|
|
|
|
+ userProfileMapper.save(userProfile);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return userId;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|