licailing пре 4 година
родитељ
комит
26f07dd5b6
1 измењених фајлова са 22 додато и 19 уклоњено
  1. 22 19
      src/test/java/com/izouma/nineth/service/CollectionServiceTest.java

+ 22 - 19
src/test/java/com/izouma/nineth/service/CollectionServiceTest.java

@@ -59,29 +59,29 @@ class CollectionServiceTest extends ApplicationTests {
     public void batchUpload() throws IOException {
         AtomicInteger num = new AtomicInteger(1);
         List<BlindBoxItem> items = new ArrayList<>();
-        String jsonStr = FileUtils.readFileToString(new File("/Users/qiufangchao/Desktop/OASISPUNK.json"), "UTF-8");
-        Arrays.stream(new File("/Users/qiufangchao/Desktop/avatar").listFiles())
+        String jsonStr = FileUtils.readFileToString(new File("/Users/qiufangchao/Desktop/mugen_mu.json"), "UTF-8");
+        Arrays.stream(new File("/Users/qiufangchao/Desktop/mugen_mu").listFiles())
                 .filter(f -> !f.getName().contains(".DS_Store"))
                 .parallel().forEach(file -> {
                     try {
-                        String name = file.getName();
-                        Pattern p = Pattern.compile("(\\d+)");
-                        Matcher matcher = p.matcher(name);
-                        matcher.find();
-                        String findname = matcher.group();
+//                        String name = file.getName();
+//                        Pattern p = Pattern.compile("(\\d+)");
+//                        Matcher matcher = p.matcher(name);
+//                        matcher.find();
+//                        String findname = matcher.group();
 
                         Collection collection = JSON.parseObject(jsonStr, Collection.class);
                         collection.setId(null);
-                        collection.setName("OASISPUNK #" + findname);
+                        collection.setName("MUGEN无限:未央宗#" + num.getAndIncrement());
                         collection.setStock(1);
                         collection.setTotal(1);
                         collection.setSale(0);
-                        collection.setMinterId(7150L);
+                        collection.setMinterId(5868950L);
                         collection.setOnShelf(false);
                         collection.setSalable(false);
 //                        String thumbPath = "https://cdn.raex.vip/thumb_image/mahjongman/" + file.getName()
 //                                .substring(0, file.getName().lastIndexOf(".")) + ".jpg";
-                        collection.setPic(Collections.singletonList(new FileObject("", "https://cdn.raex.vip/image/evo1/" + file.getName(), null, "image/png")));
+                        collection.setPic(Collections.singletonList(new FileObject("", "https://cdn.raex.vip/nft/mugen_mu/" + file.getName(), null, "image/png")));
 
                         collectionRepo.save(collection);
                         System.out.println("保存成功" + collection.getId());
@@ -102,21 +102,24 @@ class CollectionServiceTest extends ApplicationTests {
 
     @Test
     public void createBlindBox() throws IOException {
-        List<Collection> items = collectionRepo.findByNameLike("OASISPUNK.EVO #%").stream().filter(i -> {
-            int num = Integer.parseInt(i.getName().substring("OASISPUNK.EVO #".length()));
-            return num > 0 && num <= 280;
-        }).collect(Collectors.toList());
-
-        String jsonStr = FileUtils.readFileToString(new File("/Users/qiufangchao/Desktop/evo.json"), "UTF-8");
+        List<Long> arr = Arrays.asList(6862110L, 6862511L, 6862516L, 6862533L, 6862689L, 6862792L, 6862867L, 6863009L, 6863047L,
+                6863188L, 6863438L, 6863449L, 6863588L, 6863608L, 6863671L, 6863745L, 6863760L, 6863938L, 6863954L, 6864008L, 6864081L);
+        List<Collection> items = collectionRepo.findByNameLike("MUGEN无限:未央宗#%").stream().filter(i -> {
+            int num = Integer.parseInt(i.getName().substring("MUGEN无限:未央宗#".length()));
+            return num > 0 && num <= 2000 && !arr.contains(i.getId());
+        }).limit(1879).collect(Collectors.toList());
+
+        String jsonStr = FileUtils.readFileToString(new File("/Users/qiufangchao/Desktop/mugen_mu.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(7150L);
+        blindBox.setMinterId(5868950L);
         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)));
+        blindBox.setMaxCount(1);
+        blindBox.setName("MUGEN无限未央宗数字艺术品盲盒");
+        blindBox.setPic(Arrays.asList(new FileObject(null, "https://cdn.raex.vip/nft/2022-04-16-19-24-54WTJLmsmR.jpg", null, "image/jpeg")));
         collectionService.createBlindBox(new CreateBlindBox(blindBox, items.stream().map(i -> {
             BlindBoxItem item = new BlindBoxItem();
             item.setCollectionId(i.getId());