|
|
@@ -3,10 +3,8 @@ package com.izouma.nineth.service;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.izouma.nineth.ApplicationTests;
|
|
|
-import com.izouma.nineth.domain.BlindBoxItem;
|
|
|
+import com.izouma.nineth.domain.*;
|
|
|
import com.izouma.nineth.domain.Collection;
|
|
|
-import com.izouma.nineth.domain.DomainOrder;
|
|
|
-import com.izouma.nineth.domain.FileObject;
|
|
|
import com.izouma.nineth.dto.CreateBlindBox;
|
|
|
import com.izouma.nineth.dto.TestExcelDTO;
|
|
|
import com.izouma.nineth.enums.CollectionStatus;
|
|
|
@@ -75,7 +73,7 @@ class CollectionServiceTest extends ApplicationTests {
|
|
|
AtomicInteger num = new AtomicInteger(1);
|
|
|
List<BlindBoxItem> items = new ArrayList<>();
|
|
|
String jsonStr = FileUtils.readFileToString(new File("D:/nft/nixingzhe.json"), "UTF-8");
|
|
|
- String totalString = "王,李,张,刘,陈,杨,赵,黄,周,吴,徐,孙,胡,朱,高,林,何,郭,马,罗";
|
|
|
+ String totalString = "王,李,张,刘,陈,杨,赵,黄,周,吴,徐,孙,胡,朱,高,林,何,郭,马,罗,梁,宋,郑,谢,韩,唐,冯,于,董,萧,程,曹,袁,邓,许,傅,沈,曾,彭,吕,苏,卢,蒋,蔡,贾,丁,魏,薛,叶,阎,余,潘,杜,戴,夏,钟,汪,田,任,姜,范,方,石,姚,谭,廖,邹,熊,金,陆,郝,孔,白,崔,康,毛,邱,秦,江,史,顾,侯,邵,孟,龙,万,段,漕,钱,汤,尹,黎,易,常,武,乔,贺,赖,龚,文";
|
|
|
List<String> strings = new ArrayList<>(Arrays.asList(totalString.split(",")));
|
|
|
strings.forEach(file -> {
|
|
|
try {
|
|
|
@@ -90,9 +88,13 @@ class CollectionServiceTest extends ApplicationTests {
|
|
|
collection.setType(CollectionType.DOMAIN);
|
|
|
collection.setName("RID元宇宙域名 " + file + ".nft");
|
|
|
collection.setStock(1);
|
|
|
+ collection.setCategory("元域名");
|
|
|
collection.setTotal(1);
|
|
|
collection.setPrefixName("RIDCX");
|
|
|
+ collection.setServiceCharge(0);
|
|
|
+ collection.setRoyalties(0);
|
|
|
collection.setSale(0);
|
|
|
+ collection.setHoldDays(30);
|
|
|
collection.setOnShelf(false);
|
|
|
collection.setSalable(false);
|
|
|
// String thumbPath = "https://cdn.raex.vip/thumb_image/mahjongman/" + file.getName()
|
|
|
@@ -121,9 +123,9 @@ class CollectionServiceTest extends ApplicationTests {
|
|
|
domainOrder.setPicName(file);
|
|
|
domainOrder.setDomainName(file + ".nft");
|
|
|
domainOrder.setEndTime(LocalDateTime.now());
|
|
|
- domainOrderRepo.save(domainOrder);
|
|
|
-// collectionRepo.save(collection);
|
|
|
- System.out.println("保存成功" + collection.getId());
|
|
|
+// domainOrderRepo.save(domainOrder);
|
|
|
+ collectionRepo.save(collection);
|
|
|
+ System.out.println("保存成功" + collection.getId());
|
|
|
|
|
|
items.add(BlindBoxItem
|
|
|
.builder()
|
|
|
@@ -145,7 +147,8 @@ class CollectionServiceTest extends ApplicationTests {
|
|
|
// 6863188L, 6863438L, 6863449L, 6863588L, 6863608L, 6863671L, 6863745L, 6863760L, 6863938L, 6863954L, 6864008L, 6864081L);
|
|
|
List<Collection> items = collectionRepo.findAllByPrefixNameAndDelFalse("RIDCX")
|
|
|
.stream()
|
|
|
- .filter(collection -> collection.getCreatedAt().isAfter(LocalDateTime.of(2022, 6, 28, 0, 0)))
|
|
|
+ .filter(collection -> collection.getCreatedAt().isAfter(LocalDateTime.of(2023, 3, 15, 15, 20)))
|
|
|
+ .filter(collection -> collection.getStock() > 0)
|
|
|
.limit(450L)
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
@@ -157,10 +160,10 @@ class CollectionServiceTest extends ApplicationTests {
|
|
|
blindBox.setSalable(false);
|
|
|
// blindBox.setMinterId(5868950L);
|
|
|
blindBox.setNoSoldOut(true);
|
|
|
- blindBox.setMaxCount(1);
|
|
|
- blindBox.setName("百家姓测试盲盒");
|
|
|
+ blindBox.setMaxCount(5);
|
|
|
+ blindBox.setName("百家姓.nft家族荣耀盲盒");
|
|
|
blindBox.setPic(Arrays
|
|
|
- .asList(new FileObject(null, "https://cdn.raex.vip/nft/2022-04-16-19-24-54WTJLmsmR.jpg", null, "image/jpeg")));
|
|
|
+ .asList(new FileObject(null, "https://cdn.raex.vip/nft/2023-03-15-14-04-38wUADeYGb.png", null, "image/jpeg")));
|
|
|
collectionService.createBlindBox(new CreateBlindBox(blindBox, items.stream().map(i -> {
|
|
|
BlindBoxItem item = new BlindBoxItem();
|
|
|
item.setCollectionId(i.getId());
|
|
|
@@ -296,8 +299,10 @@ class CollectionServiceTest extends ApplicationTests {
|
|
|
|
|
|
@Test
|
|
|
public void searchRTesty() {
|
|
|
- List<Map<String, Object>> madin = domainOrderService.search("1");
|
|
|
- System.out.print(madin);
|
|
|
+ String domainName = "RID元宇宙域名 龚.nft".substring(9);
|
|
|
+ DomainOrder domainOrder = domainOrderRepo
|
|
|
+ .findFirstByDomainNameAndOrderStatus(domainName, OrderStatus.FINISH);
|
|
|
+ System.out.println(domainOrder);
|
|
|
}
|
|
|
// @Test
|
|
|
// public void clearOldCollection() {
|