licailing преди 3 години
родител
ревизия
003bce42c2
променени са 1 файла, в които са добавени 16 реда и са изтрити 16 реда
  1. 16 16
      src/test/java/com/izouma/nineth/service/CollectionServiceTest.java

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

@@ -61,22 +61,22 @@ class CollectionServiceTest extends ApplicationTests {
 
     @Test
     public void batchUpload() throws IOException {
-        AtomicInteger num = new AtomicInteger(1);
+        AtomicInteger num = new AtomicInteger(5001);
         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/pfa.json"), "UTF-8");
+        Arrays.stream(new File("/Users/qiufangchao/Desktop/PFA").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("Pathfinder Ape #" + num);
                         collection.setStock(1);
                         collection.setTotal(1);
                         collection.setSale(0);
@@ -85,7 +85,7 @@ class CollectionServiceTest extends ApplicationTests {
                         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/PFA1/" + file.getName(), null, "image/png")));
 
                         collectionRepo.save(collection);
                         System.out.println("保存成功" + collection.getId());
@@ -106,12 +106,12 @@ 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;
+        List<Collection> items = collectionRepo.findByNameLike("Pathfinder Ape #%").stream().filter(i -> {
+            int num = Integer.parseInt(i.getName().substring("Pathfinder Ape #".length()));
+            return num > 5000 && num <= 9999;
         }).collect(Collectors.toList());
 
-        String jsonStr = FileUtils.readFileToString(new File("/Users/qiufangchao/Desktop/evo.json"), "UTF-8");
+        String jsonStr = FileUtils.readFileToString(new File("/Users/qiufangchao/Desktop/pfa.json"), "UTF-8");
         Collection blindBox = JSON.parseObject(jsonStr, Collection.class);
         blindBox.setType(CollectionType.BLIND_BOX);
         blindBox.setId(null);
@@ -119,8 +119,8 @@ class CollectionServiceTest extends ApplicationTests {
         blindBox.setSalable(false);
         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)));
+        blindBox.setName("Pathfinder Ape 开拓猿S2");
+        blindBox.setPic(Arrays.asList(new FileObject(null, "https://raex-meta.oss-cn-shenzhen.aliyuncs.com/nft/PFA1/fm.jpg", null, null)));
         collectionService.createBlindBox(new CreateBlindBox(blindBox, items.stream().map(i -> {
             BlindBoxItem item = new BlindBoxItem();
             item.setCollectionId(i.getId());