Переглянути джерело

二手市场banner,多藏品

licailing 4 роки тому
батько
коміт
6ec9750957

+ 5 - 3
src/main/vue/src/views/BannerEdit.vue

@@ -53,7 +53,8 @@
                         </el-select>
                     </el-form-item>
                     <el-form-item prop="linkContent" label="跳转内容" v-if="formData.link">
-                        <el-input v-model="formData.linkContent" placeholder="输入ID"></el-input>
+                        <el-input v-if="formData.linkType === 'collections'" v-model="formData.linkContent" placeholder="输入藏品名称"></el-input>
+                        <el-input v-else v-model="formData.linkContent" placeholder="输入ID"></el-input>
                     </el-form-item>
                     <el-form-item class="form-submit">
                         <el-button @click="onSave" :loading="saving" type="primary"> 保存 </el-button>
@@ -132,14 +133,15 @@ export default {
                 { label: '首页', value: 'HOME' },
                 { label: '发现页', value: 'DISCOVER' },
                 { label: '铸造者', value: 'MINTER' },
-                { label: '市场', value: 'MARKET' },
+                { label: '二手市场', value: 'MARKET' },
                 { label: 'PC官方活动', value: 'PC_ACT' },
                 { label: 'PC首页大图', value: 'PC_TITLE' }
             ],
             linkTypeOptions: [
                 { label: '藏品/盲盒', value: 'collection' },
                 { label: '铸造者', value: 'user' },
-                { label: '活动', value: 'activity' }
+                { label: '活动', value: 'activity' },
+                { label: '多个藏品', value: 'collections' }
             ]
         };
     },

+ 3 - 2
src/main/vue/src/views/BannerList.vue

@@ -111,7 +111,7 @@ export default {
                 { label: '首页', value: 'HOME' },
                 { label: '发现页', value: 'DISCOVER' },
                 { label: '铸造者', value: 'MINTER' },
-                { label: '市场', value: 'MARKET' },
+                { label: '二手市场', value: 'MARKET' },
                 { label: 'PC官方活动', value: 'PC_ACT' },
                 { label: 'PC首页大图', value: 'PC_TITLE' }
             ],
@@ -119,7 +119,8 @@ export default {
             linkTypeOptions: [
                 { label: '藏品/盲盒', value: 'collection' },
                 { label: '铸造者', value: 'user' },
-                { label: '活动', value: 'activity' }
+                { label: '活动', value: 'activity' },
+                { label: '多个藏品', value: 'collections' }
             ]
         };
     },

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

@@ -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());