|
|
@@ -52,23 +52,23 @@ class CollectionServiceTest extends ApplicationTests {
|
|
|
|
|
|
@Test
|
|
|
public void batchUpload() throws IOException {
|
|
|
- AtomicInteger num = new AtomicInteger(4001);
|
|
|
+ AtomicInteger num = new AtomicInteger(2501);
|
|
|
List<BlindBoxItem> items = new ArrayList<>();
|
|
|
- String jsonStr = FileUtils.readFileToString(new File("/Users/drew/Downloads/003.json"), "UTF-8");
|
|
|
- Arrays.stream(new File("/Users/drew/Downloads/s5-1000").listFiles())
|
|
|
+ String jsonStr = FileUtils.readFileToString(new File("/Users/qiufangchao/Desktop/evo.json"), "UTF-8");
|
|
|
+ Arrays.stream(new File("/Users/qiufangchao/Desktop/evo3").listFiles())
|
|
|
.filter(f -> Pattern.matches("^BJ.*\\.png$", f.getName()))
|
|
|
.parallel().forEach(file -> {
|
|
|
try {
|
|
|
Collection collection = JSON.parseObject(jsonStr, Collection.class);
|
|
|
collection.setId(null);
|
|
|
- collection.setName(String.format("MAYBEMAN #%05d", num.getAndIncrement()));
|
|
|
+ collection.setName(String.format("OASISPUNK.EVO #%04d", num.getAndIncrement()));
|
|
|
collection.setStock(1);
|
|
|
collection.setTotal(1);
|
|
|
collection.setSale(0);
|
|
|
- collection.setMinterId(8666L);
|
|
|
+ collection.setMinterId(7150L);
|
|
|
collection.setOnShelf(false);
|
|
|
collection.setSalable(false);
|
|
|
- collection.setPic(Collections.singletonList(new FileObject("", "https://raex-meta.oss-cn-shenzhen.aliyuncs.com/image/s5/" + file.getName(), null, "png")));
|
|
|
+ collection.setPic(Collections.singletonList(new FileObject("", "https://raex-meta.oss-cn-shenzhen.aliyuncs.com/image/evos3/" + file.getName(), null, "png")));
|
|
|
|
|
|
collectionRepo.save(collection);
|
|
|
System.out.println("保存成功" + collection.getId());
|
|
|
@@ -89,20 +89,21 @@ class CollectionServiceTest extends ApplicationTests {
|
|
|
|
|
|
@Test
|
|
|
public void createBlindBox() throws IOException {
|
|
|
- List<Collection> items = collectionRepo.findByNameLike("MAYBEMAN #%").stream().filter(i -> {
|
|
|
- int num = Integer.parseInt(i.getName().substring("MAYBEMAN #".length()));
|
|
|
- return num > 4000 && num <= 5000;
|
|
|
+ List<Collection> items = collectionRepo.findByNameLike("OASISPUNK.EVO #%").stream().filter(i -> {
|
|
|
+ int num = Integer.parseInt(i.getName().substring("OASISPUNK.EVO #".length()));
|
|
|
+ return num > 2500 && num <= 3000;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
- String jsonStr = FileUtils.readFileToString(new File("/Users/drew/Downloads/003.json"), "UTF-8");
|
|
|
+ String jsonStr = FileUtils.readFileToString(new File("/Users/qiufangchao/Desktop/evo.json"), "UTF-8");
|
|
|
Collection blindBox = JSON.parseObject(jsonStr, Collection.class);
|
|
|
blindBox.setType(CollectionType.BLIND_BOX);
|
|
|
blindBox.setId(null);
|
|
|
blindBox.setOnShelf(false);
|
|
|
blindBox.setSalable(false);
|
|
|
- blindBox.setMinterId(8666L);
|
|
|
- blindBox.setName("MAYBEMAN潮流艺术限定盲盒S5");
|
|
|
- blindBox.setPic(Arrays.asList(new FileObject(null, "https://raex-meta.oss-cn-shenzhen.aliyuncs.com/nft/2022-01-07-10-08-30DpIYYBOv.jpg", null, null)));
|
|
|
+ blindBox.setMinterId(7150L);
|
|
|
+ blindBox.setNoSoldOut(true);
|
|
|
+ blindBox.setName("OASISPUNK.EVO绿洲朋克进化版限定盲盒S3");
|
|
|
+ blindBox.setPic(Arrays.asList(new FileObject(null, "https://raex-meta.oss-cn-shenzhen.aliyuncs.com/image/evos3/fm.jpg", null, null)));
|
|
|
collectionService.createBlindBox(new CreateBlindBox(blindBox, items.stream().map(i -> {
|
|
|
BlindBoxItem item = new BlindBoxItem();
|
|
|
item.setCollectionId(i.getId());
|