|
@@ -41,7 +41,6 @@ import java.util.*;
|
|
|
import java.util.concurrent.ExecutionException;
|
|
import java.util.concurrent.ExecutionException;
|
|
|
import java.util.concurrent.ForkJoinPool;
|
|
import java.util.concurrent.ForkJoinPool;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
-import java.util.regex.Pattern;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -952,22 +951,43 @@ public class AssetService {
|
|
|
.build());
|
|
.build());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public List<MetaPlayerRole> metaPlayerRole(Long userId) {
|
|
|
|
|
- List<MetaPlayerRole> metaPlayerRoles = new ArrayList<>();
|
|
|
|
|
- metaPlayerRoles.add(build(userId, "艾弗森", 1L));
|
|
|
|
|
- metaPlayerRoles.add(build(userId, "开拓猿", 2L));
|
|
|
|
|
- metaPlayerRoles.add(build(userId, "朋克", 3L));
|
|
|
|
|
- metaPlayerRoles.add(build(userId, "MUGEN", 4L));
|
|
|
|
|
- return metaPlayerRoles;
|
|
|
|
|
|
|
+ public List<MetaPlayerRoleClassify> metaPlayerRole(Long userId) {
|
|
|
|
|
+ List<MetaPlayerRoleClassify> metaPlayerRoleClassifies = new ArrayList<>();
|
|
|
|
|
+ metaPlayerRoleClassifies.add(buildMetaPlayerRoleClassify(userId, "艾弗森", 1L));
|
|
|
|
|
+ metaPlayerRoleClassifies.add(buildMetaPlayerRoleClassify(userId, "开拓猿", 2L));
|
|
|
|
|
+ metaPlayerRoleClassifies.add(buildMetaPlayerRoleClassify(userId, "朋克", 3L));
|
|
|
|
|
+ metaPlayerRoleClassifies.add(buildMetaPlayerRoleClassify(userId, "MUGEN", 4L));
|
|
|
|
|
+ return metaPlayerRoleClassifies;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private MetaPlayerRoleClassify buildMetaPlayerRoleClassify(Long userId, String name, Long id) {
|
|
|
|
|
+ MetaPlayerRoleClassify metaPlayerRoleClassify = new MetaPlayerRoleClassify();
|
|
|
|
|
+ metaPlayerRoleClassify.setClassify(name);
|
|
|
|
|
+ List<MetaPlayerRole> metaPlayerRoleList;
|
|
|
|
|
+ if("MUGEN".equals(name)) {
|
|
|
|
|
+ metaPlayerRoleList = Arrays.asList(new MetaPlayerRole(id, "无限集团"),
|
|
|
|
|
+ new MetaPlayerRole(id + 1, "苍茫雷道"),
|
|
|
|
|
+ new MetaPlayerRole(id + 2, "炼炉天族"),
|
|
|
|
|
+ new MetaPlayerRole(id + 3, "未央宗"),
|
|
|
|
|
+ new MetaPlayerRole(id + 4, "八级门"),
|
|
|
|
|
+ new MetaPlayerRole(id + 5, "人族"),
|
|
|
|
|
+ new MetaPlayerRole(id + 6, "凤鸣寺"),
|
|
|
|
|
+ new MetaPlayerRole(id + 7, "九州岛"));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ metaPlayerRoleList = Collections.singletonList(new MetaPlayerRole(id, name));
|
|
|
|
|
+ }
|
|
|
|
|
+ metaPlayerRoleClassify.setMetaPlayerRoleList(build(userId, metaPlayerRoleList));
|
|
|
|
|
+ return metaPlayerRoleClassify;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private MetaPlayerRole build (Long userId, String name, Long id) {
|
|
|
|
|
- MetaPlayerRole metaPlayerRole = new MetaPlayerRole();
|
|
|
|
|
- metaPlayerRole.setId(id);
|
|
|
|
|
- metaPlayerRole.setType(UserHoldTypeEnum.ASSET);
|
|
|
|
|
- metaPlayerRole.setAddress("https://www.raex.vip/9th/productSearch?search=" + name + "&source=TRANSFER");
|
|
|
|
|
- List<Asset> assets = assetRepo.findAllByUserIdAndNameLike(userId, "%" + name + "%");
|
|
|
|
|
- metaPlayerRole.setHold(CollectionUtils.isNotEmpty(assets));
|
|
|
|
|
- return metaPlayerRole;
|
|
|
|
|
|
|
+ private List<MetaPlayerRole> build (Long userId, List<MetaPlayerRole> metaPlayerRoleList) {
|
|
|
|
|
+ metaPlayerRoleList.forEach(metaPlayerRole -> {
|
|
|
|
|
+ metaPlayerRole.setType(UserHoldTypeEnum.ASSET);
|
|
|
|
|
+ metaPlayerRole.setAddress("https://www.raex.vip/9th/productSearch?search=" + metaPlayerRole.getName() + "&source=TRANSFER");
|
|
|
|
|
+ List<Asset> assets = assetRepo.findAllByUserIdAndNameLike(userId, "%" + metaPlayerRole.getName() + "%");
|
|
|
|
|
+ metaPlayerRole.setHold(CollectionUtils.isNotEmpty(assets));
|
|
|
|
|
+ });
|
|
|
|
|
+ return metaPlayerRoleList;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|