|
@@ -5,13 +5,13 @@ import cn.reghao.jutil.jdk.thread.ThreadPoolWrapper;
|
|
|
import cn.reghao.tnb.auth.api.dto.AccountInfo;
|
|
import cn.reghao.tnb.auth.api.dto.AccountInfo;
|
|
|
import cn.reghao.tnb.auth.api.iface.AccountQuery;
|
|
import cn.reghao.tnb.auth.api.iface.AccountQuery;
|
|
|
import cn.reghao.tnb.auth.api.iface.AdminAccountService;
|
|
import cn.reghao.tnb.auth.api.iface.AdminAccountService;
|
|
|
-import cn.reghao.tnb.user.api.dto.UserInfo;
|
|
|
|
|
-import cn.reghao.tnb.user.api.dto.UserSearch;
|
|
|
|
|
|
|
+import cn.reghao.tnb.user.app.model.dto.UserQuery;
|
|
|
import cn.reghao.tnb.user.api.dto.VipPlanInfo;
|
|
import cn.reghao.tnb.user.api.dto.VipPlanInfo;
|
|
|
import cn.reghao.tnb.user.api.dto.WalletChargeDto;
|
|
import cn.reghao.tnb.user.api.dto.WalletChargeDto;
|
|
|
import cn.reghao.tnb.user.api.iface.UserWalletService;
|
|
import cn.reghao.tnb.user.api.iface.UserWalletService;
|
|
|
import cn.reghao.tnb.user.app.db.mapper.UserProfileMapper;
|
|
import cn.reghao.tnb.user.app.db.mapper.UserProfileMapper;
|
|
|
import cn.reghao.tnb.user.app.model.po.UserProfile;
|
|
import cn.reghao.tnb.user.app.model.po.UserProfile;
|
|
|
|
|
+import cn.reghao.tnb.user.app.model.vo.AdminUser;
|
|
|
import cn.reghao.tnb.user.app.model.vo.VipPlan;
|
|
import cn.reghao.tnb.user.app.model.vo.VipPlan;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
@@ -54,14 +54,10 @@ public class AdminUserService {
|
|
|
return new PageImpl<>(pageList.getList(), pageRequest, pageList.getTotalSize());
|
|
return new PageImpl<>(pageList.getList(), pageRequest, pageList.getTotalSize());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public PageList<UserInfo> getUserList(UserSearch userSearch) {
|
|
|
|
|
- return PageList.empty();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public PageList<UserInfo> getUserList(int nextId) {
|
|
|
|
|
|
|
+ public PageList<AdminUser> getUserList(UserQuery userQuery, int nextId) {
|
|
|
int total = userProfileMapper.countAll();
|
|
int total = userProfileMapper.countAll();
|
|
|
List<UserProfile> userProfileList = userProfileMapper.findAllById(pageSize, nextId);
|
|
List<UserProfile> userProfileList = userProfileMapper.findAllById(pageSize, nextId);
|
|
|
- List<UserInfo> list = userProfileList.stream().map(this::getUserInfo).collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<AdminUser> list = userProfileList.stream().map(this::getAdminUser).collect(Collectors.toList());
|
|
|
if (!userProfileList.isEmpty()) {
|
|
if (!userProfileList.isEmpty()) {
|
|
|
nextId = userProfileList.get(userProfileList.size()-1).getId();
|
|
nextId = userProfileList.get(userProfileList.size()-1).getId();
|
|
|
}
|
|
}
|
|
@@ -69,23 +65,17 @@ public class AdminUserService {
|
|
|
return PageList.pageList(""+nextId, list);
|
|
return PageList.pageList(""+nextId, list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private UserInfo getUserInfo(UserProfile userProfile) {
|
|
|
|
|
|
|
+ private AdminUser getAdminUser(UserProfile userProfile) {
|
|
|
long userId = userProfile.getUserId();
|
|
long userId = userProfile.getUserId();
|
|
|
AccountInfo accountInfo = accountQuery.getAccountInfo(userId);
|
|
AccountInfo accountInfo = accountQuery.getAccountInfo(userId);
|
|
|
- int gender = userProfile.getGender();
|
|
|
|
|
- String signature = userProfile.getSignature();
|
|
|
|
|
- int following = userProfile.getFollowing();
|
|
|
|
|
- int follower = userProfile.getFollower();
|
|
|
|
|
boolean vip = userVipService.isVip(userId);
|
|
boolean vip = userVipService.isVip(userId);
|
|
|
- String userIdStr = accountQuery.getUserIdStr(userId);
|
|
|
|
|
- UserInfo userInfo = new UserInfo(accountInfo, userIdStr, gender, signature, following, follower, vip);
|
|
|
|
|
|
|
+ AdminUser adminUser = new AdminUser(accountInfo, userProfile, vip);
|
|
|
String username = accountInfo.getUsername();
|
|
String username = accountInfo.getUsername();
|
|
|
if (username.startsWith("bilibili_")) {
|
|
if (username.startsWith("bilibili_")) {
|
|
|
long biliUserId = Long.parseLong(username.replace("bilibili_", ""));
|
|
long biliUserId = Long.parseLong(username.replace("bilibili_", ""));
|
|
|
- userInfo.setBiliUserId(biliUserId);
|
|
|
|
|
|
|
+ adminUser.setBiliUserId(biliUserId);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- return userInfo;
|
|
|
|
|
|
|
+ return adminUser;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<VipPlanInfo> getVipPlans() {
|
|
public List<VipPlanInfo> getVipPlans() {
|