记得上下班打卡 | git大法好,push需谨慎

Commit 3d125cee authored by anjiabin's avatar anjiabin

初始化galaxy项目

parent 687232f9
...@@ -10,38 +10,11 @@ package com.liquidnet.service.galaxy.constant; ...@@ -10,38 +10,11 @@ package com.liquidnet.service.galaxy.constant;
* @date 2022/3/8 11:25 * @date 2022/3/8 11:25
*/ */
public enum GalaxyErrorCodeEnum { public enum GalaxyErrorCodeEnum {
TRADE_PAY_WAY_ERROR("PAY0010001","错误的支付方式"), TRADE_PAY_WAY_ERROR("PAY0010001","错误的支付方式");
TRADE_WEIXIN_ERROR("PAY0010002","微信异常"),
TRADE_ORDER_ERROR("PAY0010003","错误的支付方式"),
TRADE_ORDER_STATUS_NOT_SUCCESS ("PAY0010004","交易不成功"),
TRADE_ALIPAY_ERROR ("PAY0010005","支付宝异常"),
TRADE_PARAM_ERROR("PAY0010006","支付参数异常"),
TRADE_ERROR_NOT_EXISTS("PAY0010007","订单不存在!"),
TRADE_ERROR_HAS_PAID("PAY0010008","订单已经支付成功!"),
TRADE_ALIPAY_SIGN_ERROR("PAY0010009","支付宝签名异常!"),
TRADE_ALIPAY_QUERY_ERROR("PAY0010010","支付宝订单查询失败!"),
TRADE_UNIONPAY_QUERY_ERROR("PAY0040002","银联订单查询失败,因缓存消失,查询不到订单导致!"),
TRADE_WEPAY_SIGN_ERROR("PAY0020001","微信签名异常!"),
TRADE_DOUYINPAY_SIGN_ERROR("PAY0030001","抖音签名异常!"),
TRADE_DOUYINPAY_QUERY_ERROR("PAY0030002","抖音查询支付订单异常!"),
TRADE_UNIONPAY_SIGN_ERROR("PAY0040001","银联签名异常!"),
TRADE_WEPAY_QUERY_ERROR("PAY0020002","微信订单查询失败!");
private String code; private String code;
private String message; private String message;
DragonErrorCodeEnum(String code, String message) { GalaxyErrorCodeEnum(String code, String message) {
this.code = code; this.code = code;
this.message = message; this.message = message;
} }
......
...@@ -21,6 +21,11 @@ ...@@ -21,6 +21,11 @@
<artifactId>liquidnet-common-third-zxlnft</artifactId> <artifactId>liquidnet-common-third-zxlnft</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-galaxy-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.liquidnet.service.galaxy.router.strategy; package com.liquidnet.service.galaxy.router.strategy;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyPayChannelHandler; import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterHandler;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -20,11 +20,11 @@ import java.util.Map; ...@@ -20,11 +20,11 @@ import java.util.Map;
public class GalaxyRouterStrategyListener implements ApplicationListener<ContextRefreshedEvent> { public class GalaxyRouterStrategyListener implements ApplicationListener<ContextRefreshedEvent> {
@Override @Override
public void onApplicationEvent(ContextRefreshedEvent event) { public void onApplicationEvent(ContextRefreshedEvent event) {
Map<String, Object> beans = event.getApplicationContext().getBeansWithAnnotation(StrategyPayChannelHandler.class); Map<String, Object> beans = event.getApplicationContext().getBeansWithAnnotation(StrategyGalaxyRouterHandler.class);
GalaxyRouterStrategyContext strategyContext = event.getApplicationContext().getBean(PayChannelStrategyContext.class); GalaxyRouterStrategyContext strategyContext = event.getApplicationContext().getBean(GalaxyRouterStrategyContext.class);
beans.forEach((name, bean) -> { beans.forEach((name, bean) -> {
StrategyPayChannelHandler typeHandler = bean.getClass().getAnnotation(StrategyPayChannelHandler.class); StrategyGalaxyRouterHandler typeHandler = bean.getClass().getAnnotation(StrategyGalaxyRouterHandler.class);
strategyContext.putStrategy(typeHandler.value().getCode(), (IPayChannelStrategy) bean); strategyContext.putStrategy(typeHandler.value().getCode(), (IGalaxyRouterStrategy) bean);
}); });
} }
} }
package com.liquidnet.service.galaxy.router.strategy.annotation; package com.liquidnet.service.galaxy.router.strategy.annotation;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
...@@ -15,6 +17,6 @@ import java.lang.annotation.*; ...@@ -15,6 +17,6 @@ import java.lang.annotation.*;
@Inherited @Inherited
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public interface StrategyGalaxyRouterHandler { public @interface StrategyGalaxyRouterHandler {
GalaxyC.PayChannelEnum value(); GalaxyConstant.RouterEnum value();
} }
package com.liquidnet.service.galaxy.router.strategy.impl; package com.liquidnet.service.galaxy.router.strategy.impl;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.dragon.channel.strategy.annotation.StrategyPayChannelHandler; import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterHandler;
import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 * @version V1.0
...@@ -22,7 +16,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -22,7 +16,7 @@ import javax.servlet.http.HttpServletRequest;
*/ */
@Slf4j @Slf4j
@Component @Component
@StrategyPayChannelHandler(DragonConstant.PayChannelEnum.APPLEPAY) @StrategyGalaxyRouterHandler(GalaxyConstant.RouterEnum.ETH)
public class GalaxyRouterStrategyEthImpl extends AbstractGalaxyRouterStrategyImpl { public class GalaxyRouterStrategyEthImpl extends AbstractGalaxyRouterStrategyImpl {
// @Override // @Override
......
package com.liquidnet.service.galaxy.router.strategy.impl; package com.liquidnet.service.galaxy.router.strategy.impl;
import com.alibaba.fastjson.JSON; import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.alipay.api.AlipayApiException; import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterHandler;
import com.alipay.api.internal.util.AlipaySignature;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.dragon.biz.DragonServiceCommonBiz;
import com.liquidnet.service.dragon.channel.alipay.biz.AlipayBiz;
import com.liquidnet.service.dragon.channel.alipay.constant.AlipayConstant;
import com.liquidnet.service.dragon.channel.alipay.strategy.AlipayStrategyContext;
import com.liquidnet.service.dragon.channel.strategy.annotation.StrategyPayChannelHandler;
import com.liquidnet.service.dragon.channel.strategy.biz.DragonPayBiz;
import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.dragon.constant.DragonErrorCodeEnum;
import com.liquidnet.service.dragon.dto.DragonOrdersDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto;
import com.liquidnet.service.dragon.service.impl.DragonOrderRefundsServiceImpl;
import com.liquidnet.service.dragon.utils.DataUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 * @version V1.0
...@@ -42,7 +16,7 @@ import java.util.Map; ...@@ -42,7 +16,7 @@ import java.util.Map;
*/ */
@Slf4j @Slf4j
@Component @Component
@StrategyPayChannelHandler(DragonConstant.PayChannelEnum.ALIPAY) @StrategyGalaxyRouterHandler(GalaxyConstant.RouterEnum.ZXINCHAIN)
public class GalaxyRouterStrategyZxlImpl extends AbstractGalaxyRouterStrategyImpl { public class GalaxyRouterStrategyZxlImpl extends AbstractGalaxyRouterStrategyImpl {
// @Autowired // @Autowired
// private AlipayStrategyContext alipayStrategyContext; // private AlipayStrategyContext alipayStrategyContext;
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-service-zxlnft</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-zxlnft-impl</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-third-zxlnft</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.liquidnet.service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.core.env.Environment;
import java.net.InetAddress;
import java.util.Arrays;
@Slf4j
@EnableFeignClients
@SpringBootApplication(scanBasePackages = {"com.liquidnet"})
public class ServiceZxlnftApplication implements CommandLineRunner {
@Autowired
private Environment environment;
public static void main(String[] args) {
SpringApplication.run(ServiceZxlnftApplication.class, args);
}
@Override
public void run(String... strings) {
try {
log.info("\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" +
"Local: \t\thttp://127.0.0.1:{}\n\t" +
"External: \thttp://{}:{}{}/doc.html\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------",
environment.getProperty("spring.application.name"),
environment.getProperty("server.port"),
InetAddress.getLocalHost().getHostAddress(),
environment.getProperty("server.port"),
environment.getProperty("server.servlet.context-path"),
Arrays.toString(environment.getActiveProfiles()));
} catch (Exception e) {
e.printStackTrace();
}
}
}
# begin-dev-这里是配置信息基本值
liquidnet:
cloudConfig:
profile: dev
security:
username: user
password: user123
eureka:
host: 127.0.0.1:7001
# end-dev-这里是配置信息基本值
spring:
profiles:
include: service-zxlnft
# begin-dev-这里是配置信息基本值
liquidnet:
cloudConfig:
profile: prod
security:
username: user
password: user123
eureka:
host: 172.17.207.189:7001
# end-dev-这里是配置信息基本值
spring:
profiles:
include: service-zxlnft
\ No newline at end of file
#eurekaServer配置
eureka:
client:
register-with-eureka: false
fetch-registry: true
serviceUrl:
defaultZone: http://${liquidnet.security.username}:${liquidnet.security.password}@${liquidnet.eureka.host}/eureka-server/eureka
#configServer配置
spring:
cloud:
config:
# uri: http://39.105.38.151:7002/support-config
# uri: http://39.106.122.201:7002/support-config
# uri: http://127.0.0.1:7002/support-config
profile: ${liquidnet.cloudConfig.profile}
name: ${spring.application.name} #默认为spring.application.name
discovery:
enabled: true
service-id: liquidnet-support-config
# begin-dev-这里是配置信息基本值
liquidnet:
cloudConfig:
profile: test
security:
username: user
password: user123
eureka:
host: 172.17.207.177:7001
#instance:
# prefer-ip-address: true
#host: eureka-test-0.eureka-test-svc.zhengzai-test:7001/eureka-server/eureka,eureka-test-1.eureka-test-svc.zhengzai-test:7001/eureka-server/eureka,eureka-test-2.eureka-test-svc.zhengzai-test:7001/eureka-server/eureka
#host: 192.168.193.41:7001
# end-dev-这里是配置信息基本值
spring:
profiles:
include: service-zxlnft
40001=登录信息有误
40002=账号已在另一台设备登录
40003=登录已过期
# ------------------------ 4开头错误码作系统保留
package com.liquidnet.service.zxlnft;
import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz;
import com.liquidnet.common.third.zxlnft.config.ZxlnftConfig;
import com.liquidnet.common.third.zxlnft.dto.Nft022UploadSecretReqDto;
import com.liquidnet.common.third.zxlnft.dto.Nft022UploadSecretRespDto;
import com.liquidnet.common.third.zxlnft.dto.ZxlnftResponseDto;
import com.liquidnet.common.third.zxlnft.dto.wallet.*;
import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil;
import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.nio.charset.StandardCharsets;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: TestZxlnftSdkUtil
* @Package com.liquidnet.common.third.zxlnft.test
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/2/18 13:49
*/
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class TestZxlWalletSdkUtil {
private static String platFormPubKey1 = "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE+h73KDgGzZznkP02tXTc0DU3mfXp\nvr7KWAlB63p8J2SU9FtusK5ApcbjoqgPunIkpChvRHQuVKyQpZtBDza3lQ==\n-----END PUBLIC KEY-----\n";
private static String zhouhuanPubKey1 = "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAERAYCoqlcb1/C+b085HO4RWbIFx/n\nw6zkU3tvIYhBi1Xjj7GMdE/dR6D2fCQGWHqdYwQUb6/kS67Yjx47prxREg==\n-----END PUBLIC KEY-----\n";
private static String zhouhuanPriKey1 = "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjSDapAU4gujWk9mM\nCE1tOokocdKrHMkfvZ0vfaWM+MOgCgYIKoEcz1UBgi2hRANCAAREBgKiqVxvX8L5\nvTzkc7hFZsgXH+fDrORTe28hiEGLVeOPsYx0T91HoPZ8JAZYep1jBBRvr+RLrtiP\nHjumvFES\n-----END PRIVATE KEY-----\n";
private static String zhouhuanPubKey2 = "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAELZtnP30dbtdFrvherJxfpPEQP+q3\nRyrtECAuEwZg3o8/RLJva0O6unNLHGavkwd77l5UgvX4cPNoX/OV6n/3xQ==\n-----END PUBLIC KEY-----\n";
private static String zhouhuanPriKey2 = "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgNBYWsObyiuXLIZZZ\nPa0P/aNSrlf3//TLkdhZsDroRNugCgYIKoEcz1UBgi2hRANCAAQtm2c/fR1u10Wu\n+F6snF+k8RA/6rdHKu0QIC4TBmDejz9Esm9rQ7q6c0scZq+TB3vuXlSC9fhw82hf\n85Xqf/fF\n-----END PRIVATE KEY-----\n";
private static String zhouhuanAddress1 = "zxf8dcce2b5374610631735ad4d606372ff199d89e";
private static String zhouhuanAddress2 = "zx26ff9db9cf1e981e3028b7e133d54b28eb859f97";
@Autowired
private ZxlWalletSdkUtil zxlWalletSdkUtil;
@Autowired
private ZxlnftConfig zxlnftConfig;
@Autowired
private ZxlnftSdkUtil zxlnftSdkUtil;
@Autowired
private ZxlnftBiz zxlnftBiz;
/**
* 1、生成助记词
*/
@Test
public void createMnemonic(){
CreateMnemonicReq req = CreateMnemonicReq.getNew();
zxlWalletSdkUtil.createMnemonic(req);
}
/**
* 2、API签名
*/
@Test
public void generateApiSign(){
GenerateApiSignReq req = GenerateApiSignReq.getNew();
req.setAppId("");
req.setAppKey("");
zxlWalletSdkUtil.generateApiSign(req);
}
/**
* 3、文件上传至COS
*/
@Test
public void uploadToCos(){
// String filePath = "/Users/anjiabin/Downloads/zxl_image_test_002.jpeg";
// String filePath = "/Users/anjiabin/Downloads/zxl_image_series_test_001.jpeg";
String filePath = "/Users/anjiabin/Downloads/zxl_image_test_001.jpg";
String seriesName = "NOW_ZXL_NFT_PIC001_skuId001_test";
// String fileName = "/"+ seriesName + "/" + DateUtil.getNowTime()+"/"+ IDGenerator.getZxlNftImageCosCode() +".jpg";
String fileName = "/" + DateUtil.getNowTime()+"/"+ IDGenerator.getZxlNftImageCosCode() +".jpg";
//调用生成素材上传临时密钥接口
Nft022UploadSecretReqDto nft022ReqDto = Nft022UploadSecretReqDto.getNew();
nft022ReqDto.setSeriesName(seriesName);
nft022ReqDto.setTimestamp(DateUtil.getNowSeconds().toString());
nft022ReqDto.setUserPubKey(zxlnftConfig.getNftPlatformPubKey());
//系列为空
String userData = nft022ReqDto.getTimestamp();
//系列不为空
if(StringUtil.isNotEmpty(nft022ReqDto.getSeriesName())){
userData = nft022ReqDto.getTimestamp() + "_" + nft022ReqDto.getSeriesName();
}
nft022ReqDto.setUserSignedData(zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),userData));
ZxlnftResponseDto<Nft022UploadSecretRespDto> nft022RespDto = zxlnftSdkUtil.nft022UploadSecret(nft022ReqDto);
if(nft022RespDto.isSuccess()){
UploadToCosReq req = UploadToCosReq.getNew();
req.setCosPath(nft022RespDto.getData().getUploadAddress().concat(fileName));
req.setTempSecretId(nft022RespDto.getData().getTempSecretId());
req.setTempSecretKey(nft022RespDto.getData().getTempSecretKey());
req.setSessionToken(nft022RespDto.getData().getSessionToken());
req.setFilePath(filePath);
UploadToCosResp resp = zxlWalletSdkUtil.uploadToCos(req);
System.out.println("返回结果:"+resp.toString());
}
}
/**
* 4、文件上传至COS(form-data文件提交)
*/
@Test
public void uploadFileToCos(){
UploadFileToCosReq req = UploadFileToCosReq.getNew();
// req.setCosPath("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/zxl_image_test_001");
// req.setTempSecretId("AKIDhVGgR7gKaVE5qUIpSPD9k6pcmUj7fobmEspHDlCjC27Te6Dmputh-fI87qvL2EDT");
// req.setTempSecretKey("xuNqn+FfVjm0Ug0je9k1Mn5MQHKlWKs18uU03KIMAH0=");
// req.setSessionToken("fwJfhxx5ILXFYNItgiQid1bBiTrofX5af128eb2fa96eef4d9841c98756853142d0X-nPNtZgA0AEIwJ-MAJigzB3IZOgDjLorykjfoxAHusyQ_HeAhvHSlORtPol_iqqJVolGP78H5byiZKhKxATIZiJzrTCQysR02tR1vJPkJp03VH70sSzTJ3WcyTPpBs_NCuXkYvLZaDbRKmE8Xln4uqDJDSthNNaQKBJBYJNnxmVpCRCIeIyqOvQrSKXRGkvkjQ79Enlq7iUeKSqXrpKEBliAq9hgMrXPRHapqihseRl-WerjB4BgQ261mmOuZD6oHg37EPy_JrHAJxHh9dJlFlqz3CxUL-We36RcQeDpLvL1KuzZUBBmjSb0SYMvnun7SOEDdDMF0-1ApATsyQ-bTgDiCHAoo5Xqf9CcFKop-rUeQEDKSV17raeRRcN6ZcBQ-BJ5s4R4bqRm3y1nUwePNKD1Hi2__-nPUKuI5o535wkQcqMeDhQ40Fg3jCcPPRJ-9_Egp3yTEraTkfihKDAXTZnhiQdxaDInlP1JFJKZwY5b0hinlW6yaxnaUzYyXqTVY2tEufNOu5Sn4fGOTZmyqJJ0oDsCJiby-92vKqIS9fHIzemEXfuCULNdonmEThspBA7tUAUr-fY1KCjTMolhG0XvsJ-hNVzwNbpLMLd87TwajlyqJisnn5-sR-wuj9Hx9Inoe5kTRX-0F0NeP9vcfpYZns5No5jrBM74HMgOOSplXZ3yuML42LxTtw9SWcsxqFQJpohTyijpbrwdkKlwc0qGyUIPy7WQ7Jltb7iE");
// req.setName("/Users/anjiabin/Downloads/zxl_image_test_001.jpg");
// req.setFile("/Users/anjiabin/Downloads/zxl_image_test_001.jpg");
zxlWalletSdkUtil.uploadFileToCos(req);
}
/**
* 5、派生生成子公私钥对
*/
@Test
public void deriveKeyPair(){
DeriveKeyPairReq req = DeriveKeyPairReq.getNew();
// req.setPriKey(zxlnftConfig.getNftPlatformPriKey());
//stuff name goat health siren dumb gorilla antique board tenant buffalo present
req.setMnemonic("stuff name goat health siren dumb gorilla antique board tenant buffalo present");
req.setIndex(1l);
// req.setMnemonic("region");
// req.setIndex(0l);
//
// req.setMnemonic("use");
// req.setIndex(2l);
//3045022072ba19d02f43ae883764ffa43d111ab62fd0bcd6ace31bc91356e7ce38756cbb022100deb5f7666f4768f297ccdf386a867d2a0d71227548f2595a62130e5016fb1d54
zxlWalletSdkUtil.deriveKeyPair(req);
}
/**
* 6、SDK签名
*/
@Test
public void signByPriKey(){
SignByPriKeyReq req = SignByPriKeyReq.getNew();
// req.setPriKey(zxlnftConfig.getNftPlatformPriKey());
req.setPriKey(zxlnftConfig.getNftPlatformPriKey());
req.setData("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
//3045022072ba19d02f43ae883764ffa43d111ab62fd0bcd6ace31bc91356e7ce38756cbb022100deb5f7666f4768f297ccdf386a867d2a0d71227548f2595a62130e5016fb1d54
zxlWalletSdkUtil.signByPriKey(req);
}
/**
* 7、私钥生成对应公钥
*/
@Test
public void priKey2PubKey(){
PriKey2PubKeyReq req = PriKey2PubKeyReq.getNew();
req.setPri(zhouhuanPriKey1);
zxlWalletSdkUtil.priKey2PubKey(req);
}
/**
* 8、公钥生成对应地址
*/
@Test
public void pubKey2Address(){
PubKey2AddressReq req = PubKey2AddressReq.getNew();
req.setPubKey(zxlnftConfig.getNftPlatformPubKey());
// req.setPubKey(zhouhuanPubKey1);
zxlWalletSdkUtil.pubKey2Address(req);
}
/**
* 9、私钥生成对应地址
*/
@Test
public void priKey2Address(){
PriKey2AddressReq req = PriKey2AddressReq.getNew();
req.setPriKey(zhouhuanPriKey1);
zxlWalletSdkUtil.priKey2Address(req);
}
/**
* 10、SDK验签
*/
@Test
public void verifyByPubKey(){
VerifyByPubKeyReq req = VerifyByPubKeyReq.getNew();
req.setPubKey(zxlnftConfig.getNftPlatformPubKey());
req.setData("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
req.setSignedData("3045022100f062e29953951317c6577ba5d7641d3f19c38930dbb8a93e7b9be699f3f208450220723b87ec6c1f4efd3f70b39b586b74bf52576c6ca8a8bb3d9ddd21255651dff8");
//3045022072ba19d02f43ae883764ffa43d111ab62fd0bcd6ace31bc91356e7ce38756cbb022100deb5f7666f4768f297ccdf386a867d2a0d71227548f2595a62130e5016fb1d54
zxlWalletSdkUtil.verifyByPubKey(req);
}
/**
* 11、SDK-SM3哈希 这个是44位,暂时不用
*/
@Test
public void sM3Hash(){
// String cosUrl = "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg";
// SM3HashReq req = SM3HashReq.getNew();
// req.setData(cosUrl.getBytes(StandardCharsets.UTF_8));
// zxlWalletSdkUtil.sM3Hash(req);
}
/**
* 12、SDK-SM3哈希EnCode 这个是64位
*/
@Test
public void sM3HashEncode(){
String cosUrl = "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg";
// String cosUrl = "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241628485194860245.jpg";
// String cosUrl = "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef//2022-02-24/ZXLNFTIMAGE202202241704292368452405.jpg";
SM3HashEncodeReq req = SM3HashEncodeReq.getNew();
req.setData(cosUrl.getBytes(StandardCharsets.UTF_8));
zxlWalletSdkUtil.sM3HashEncode(req);
}
}
package com.liquidnet.service.zxlnft;
import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: TestZxlnftBiz
* @Package com.liquidnet.service.zxlnft.test
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/2/21 11:44
*/
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class TestZxlnftBiz {
@Autowired
private ZxlnftBiz zxlnftBiz;
@Test
public void buildHeader(){
MultiValueMap<String, String> commonHeader = new LinkedMultiValueMap();
zxlnftBiz.buildHeader(commonHeader);
System.out.println(commonHeader.toString());
}
@Test
public void buildPlatFormHeader(){
MultiValueMap<String, String> commonHeader = new LinkedMultiValueMap();
zxlnftBiz.buildPlatFormHeader(commonHeader);
System.out.println(commonHeader.toString());
}
}
package com.liquidnet.service.zxlnft;
import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz;
import com.liquidnet.common.third.zxlnft.config.ZxlnftConfig;
import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum;
import com.liquidnet.common.third.zxlnft.dto.*;
import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil;
import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.File;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: TestZxlnftSdkUtil
* @Package com.liquidnet.common.third.zxlnft.test
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/2/18 13:49
*/
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class TestZxlnftSdkUtil {
@Autowired
private ZxlWalletSdkUtil zxlWalletSdkUtil;
@Autowired
private ZxlnftSdkUtil zxlnftSdkUtil;
@Autowired
private ZxlnftConfig zxlnftConfig;
@Autowired
private ZxlnftBiz zxlnftBiz;
// private static String zhouhuanPubKey = "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAERAYCoqlcb1/C+b085HO4RWbIFx/n\nw6zkU3tvIYhBi1Xjj7GMdE/dR6D2fCQGWHqdYwQUb6/kS67Yjx47prxREg==\n-----END PUBLIC KEY-----\n";
// private static String zhouhuanPriKey = "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjSDapAU4gujWk9mM\nCE1tOokocdKrHMkfvZ0vfaWM+MOgCgYIKoEcz1UBgi2hRANCAAREBgKiqVxvX8L5\nvTzkc7hFZsgXH+fDrORTe28hiEGLVeOPsYx0T91HoPZ8JAZYep1jBBRvr+RLrtiP\nHjumvFES\n-----END PRIVATE KEY-----\n";
private static String zhouhuanPubKey1 = "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAERAYCoqlcb1/C+b085HO4RWbIFx/n\nw6zkU3tvIYhBi1Xjj7GMdE/dR6D2fCQGWHqdYwQUb6/kS67Yjx47prxREg==\n-----END PUBLIC KEY-----\n";
private static String zhouhuanPriKey1 = "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjSDapAU4gujWk9mM\nCE1tOokocdKrHMkfvZ0vfaWM+MOgCgYIKoEcz1UBgi2hRANCAAREBgKiqVxvX8L5\nvTzkc7hFZsgXH+fDrORTe28hiEGLVeOPsYx0T91HoPZ8JAZYep1jBBRvr+RLrtiP\nHjumvFES\n-----END PRIVATE KEY-----\n";
private static String zhouhuanPubKey2 = "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAELZtnP30dbtdFrvherJxfpPEQP+q3\nRyrtECAuEwZg3o8/RLJva0O6unNLHGavkwd77l5UgvX4cPNoX/OV6n/3xQ==\n-----END PUBLIC KEY-----\n";
private static String zhouhuanPriKey2 = "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgNBYWsObyiuXLIZZZ\nPa0P/aNSrlf3//TLkdhZsDroRNugCgYIKoEcz1UBgi2hRANCAAQtm2c/fR1u10Wu\n+F6snF+k8RA/6rdHKu0QIC4TBmDejz9Esm9rQ7q6c0scZq+TB3vuXlSC9fhw82hf\n85Xqf/fF\n-----END PRIVATE KEY-----\n";
private static String zhouhuanAddress1 = "zxf8dcce2b5374610631735ad4d606372ff199d89e";
private static String zhouhuanAddress2 = "zx26ff9db9cf1e981e3028b7e133d54b28eb859f97";
private static String ID_CARD_1 = "142323198302062216";
private static String ID_CARD_2 = "150422199805206019";
@Test
public void nft001RegisterVerifyCode(){
Nft001RegisterVerifyCodeReqDto reqDto = Nft001RegisterVerifyCodeReqDto.getNew();
reqDto.setMobile("13811314082");
ZxlnftResponseDto<Nft001RegisterVerifyCodeRespDto> resp = zxlnftSdkUtil.nft001RegisterVerifyCode(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft002RegisterPerson(){
Nft002RegisterPersonReqDto reqDto = Nft002RegisterPersonReqDto.getNew();
reqDto.setPersonName("安家宾");
// reqDto.setEmail("");
reqDto.setMobile("13811314082");
reqDto.setVerifyCode("669340");
reqDto.setIdCard(ID_CARD_1);
reqDto.setCardType(Integer.valueOf(ZxlnftEnum.CardTypeEnum.ID_CARD.getCode()));
ZxlnftResponseDto<Nft002RegisterPersonRespDto> resp = zxlnftSdkUtil.nft002RegisterPerson(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft003RegisterPersonPlatform(){
Nft003RegisterPersonPlatformReqDto reqDto = Nft003RegisterPersonPlatformReqDto.getNew();
// userIdentification 68c8e0af922c450e35316977548971a1e5c335b1f5a4e21133257f0749b5c0a2
// 68c8e0af922c450e35316977548971a1e5c335b1f5a4e21133257f0749b5c0a2
reqDto.setPersonName("安家宾");
// reqDto.setEmail("");
reqDto.setMobile("13811314082");
reqDto.setIdCard(ID_CARD_1);
// reqDto.setPersonName("周焕");
//// reqDto.setEmail("");
// reqDto.setMobile("18548596019");
// reqDto.setIdCard("150422199805206019");
reqDto.setCardType(Integer.valueOf(ZxlnftEnum.CardTypeEnum.ID_CARD.getCode()));
ZxlnftResponseDto<Nft003RegisterPersonPlatformRespDto> resp = zxlnftSdkUtil.nft003RegisterPersonPlatform(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft004BusinessLicenseUpload(){
Nft004BusinessLicenseUploadReqDto reqDto = Nft004BusinessLicenseUploadReqDto.getNew();
reqDto.setFile(new File("/Users/anjiabin/Downloads/zxl_image_test_001.jpg"));
reqDto.setMobile("13811314082");
reqDto.setVerifyCode("123456");
ZxlnftResponseDto<Nft004BusinessLicenseUploadRespDto> resp = zxlnftSdkUtil.nft004BusinessLicenseUpload(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft005BusinessLicenseUploadPlatform(){
Nft005BusinessLicenseUploadPlatformReqDto reqDto = Nft005BusinessLicenseUploadPlatformReqDto.getNew();
reqDto.setFile(new File("/Users/anjiabin/Downloads/zxl_image_test_001.jpg"));
ZxlnftResponseDto<Nft005BusinessLicenseUploadPlatformRespDto> resp = zxlnftSdkUtil.nft005BusinessLicenseUploadPlatform(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft006OfficialLetterUpload(){
Nft006OfficialLetterUploadReqDto reqDto = Nft006OfficialLetterUploadReqDto.getNew();
reqDto.setFile(new File("/Users/anjiabin/Downloads/zxl_image_test_001.jpg"));
reqDto.setMobile("13811314082");
reqDto.setVerifyCode("123456");
ZxlnftResponseDto<Nft006OfficialLetterUploadRespDto> resp = zxlnftSdkUtil.nft006OfficialLetterUpload(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft007OfficialLetterUploadPlatform(){
Nft007OfficialLetterUploadPlatformReqDto reqDto = Nft007OfficialLetterUploadPlatformReqDto.getNew();
reqDto.setFile(new File("/Users/anjiabin/Downloads/zxl_image_test_001.jpg"));
ZxlnftResponseDto<Nft007OfficialLetterUploadPlatformRespDto> resp = zxlnftSdkUtil.nft007OfficialLetterUploadPlatform(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft008QueryImageModeration(){
Nft008QueryImageModerationReqDto reqDto = Nft008QueryImageModerationReqDto.getNew();
reqDto.setImageUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
// reqDto.setIntrval(0);
// reqDto.setMaxFrames(1);
ZxlnftResponseDto<Nft008QueryImageModerationRespDto> resp = zxlnftSdkUtil.nft008QueryImageModeration(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft009RegisterCompany(){
Nft009RegisterCompanyReqDto reqDto = Nft009RegisterCompanyReqDto.getNew();
reqDto.setEpName("企业名称");
// reqDto.setEmail();
reqDto.setVerifyCode("325588");
// reqDto.setCreditCode("91110101330367841P");
reqDto.setCreditCode("91110101330367841P");
reqDto.setBusiLicenseId(12222);
// reqDto.setOfficialLetterId();
reqDto.setRepresentativeName("沈总");
reqDto.setContact("安家宾");
reqDto.setMobile("13811314082");
reqDto.setIdcard(ID_CARD_1);
reqDto.setCardType(Integer.parseInt(ZxlnftEnum.CardTypeEnum.ID_CARD.getCode()));
// reqDto.setPlatformName();c
// reqDto.setPlatformUrl();
// reqDto.setBusinessType();
ZxlnftResponseDto<Nft009RegisterCompanyRespDto> resp = zxlnftSdkUtil.nft009RegisterCompany(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft010RegisterCompanyPlatform(){
Nft010RegisterCompanyPlatformReqDto reqDto = Nft010RegisterCompanyPlatformReqDto.getNew();
reqDto.setEpName("北京正在映画互联网科技有限公司");
// reqDto.setEmail();
reqDto.setCreditCode("91110101330367841P");
reqDto.setBusiLicenseId(12222);
// reqDto.setOfficialLetterId();
reqDto.setRepresentativeName("沈总");
reqDto.setContact("安家宾");
reqDto.setMobile("13811314082");
reqDto.setIdcard(ID_CARD_1);
reqDto.setCardType(Integer.parseInt(ZxlnftEnum.CardTypeEnum.ID_CARD.getCode()));
// reqDto.setPlatformName();c
// reqDto.setPlatformUrl();
// reqDto.setBusinessType();
ZxlnftResponseDto<Nft010RegisterCompanyPlatformRespDto> resp = zxlnftSdkUtil.nft010RegisterCompanyPlatform(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft011UserQueryVerifyCode(){
Nft011UserQueryVerifyCodeReqDto reqDto = Nft011UserQueryVerifyCodeReqDto.getNew();
//查询用户信息 发送手机验证码
reqDto.setType(Integer.valueOf(ZxlnftEnum.RegisterTypeEnum.COMPANY.getCode()));
reqDto.setCardNo(ID_CARD_1);
reqDto.setScene(Integer.valueOf(ZxlnftEnum.UseSceneEnum.QUERY.getCode()));
//nft平台绑定地址 发送邮箱验证码
// reqDto.setType(Integer.valueOf(ZxlnftEnum.RegisterTypeEnum.PERSON.getCode()));
// reqDto.setCardNo(ID_CARD_1);
// reqDto.setScene(Integer.valueOf(ZxlnftEnum.UseSceneEnum.BINDING.getCode()));
ZxlnftResponseDto<Nft011UserQueryVerifyCodeRespDto> resp = zxlnftSdkUtil.nft011UserQueryVerifyCode(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft012UserQuery(){
Nft012UserQueryReqDto reqDto = Nft012UserQueryReqDto.getNew();
reqDto.setType(Integer.valueOf(ZxlnftEnum.RegisterTypeEnum.COMPANY.getCode()));
reqDto.setCardNo(ID_CARD_1);
reqDto.setVerifyCode("045029");
ZxlnftResponseDto<Nft012UserQueryRespDto> resp = zxlnftSdkUtil.nft012UserQuery(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft013IdentityBindSubmit(){
Nft013IdentityBindSubmitReqDto reqDto = Nft013IdentityBindSubmitReqDto.getNew();
reqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
reqDto.setUserIdentification("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef");
reqDto.setSignData(zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),reqDto.getUserIdentification()));
reqDto.setFaceResultId("122");
ZxlnftResponseDto<Nft013IdentityBindSubmitRespDto> resp = zxlnftSdkUtil.nft013IdentityBindSubmit(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft014IdentityBindSubmitByTrusted(){
Nft014IdentityBindSubmitByTrustedReqDto reqDto = Nft014IdentityBindSubmitByTrustedReqDto.getNew();
//安家宾
reqDto.setUserPubKey(zxlnftConfig.getNftPlatformPubKey());
reqDto.setUserIdentification("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef");
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),reqDto.getUserIdentification());
//周焕
reqDto.setUserPubKey(zhouhuanPubKey1);
reqDto.setUserIdentification("0354415fabf861ecde70db198836bf82af025820ea50f66c05589e21b6d9700f");
signature = zxlnftBiz.createSign(zhouhuanPriKey1,reqDto.getUserIdentification());
reqDto.setUserSignData(signature);
ZxlnftResponseDto<Nft014IdentityBindSubmitByTrustedRespDto> resp = zxlnftSdkUtil.nft014IdentityBindSubmitByTrusted(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft015IdentityBindPlatformSelf(){
Nft015IdentityBindPlatformSelfReqDto reqDto = Nft015IdentityBindPlatformSelfReqDto.getNew();
reqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
reqDto.setUserIdentification("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef");
reqDto.setVerifyCode("061628");
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),reqDto.getUserIdentification());
reqDto.setSignData(signature);
ZxlnftResponseDto<Nft015IdentityBindPlatformSelfRespDto> resp = zxlnftSdkUtil.nft015IdentityBindPlatformSelf(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft016IdentityBindQuery(){
Nft016IdentityBindQueryReqDto reqDto = Nft016IdentityBindQueryReqDto.getNew();
// reqDto.setAddressList("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
reqDto.setAddressList("ZXfa63b4ff148dbebb6ed9c185a5f7f8b8fdcf90ad");
ZxlnftResponseDto<Nft016IdentityBindQueryRespDto> resp = zxlnftSdkUtil.nft016IdentityBindQuery(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft017IdentityVerifyIdentity(){
Nft017IdentityVerifyIdentityReqDto reqDto = Nft017IdentityVerifyIdentityReqDto.getNew();
reqDto.setAddress("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
reqDto.setAddress("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
reqDto.setFaceResultId("111");
ZxlnftResponseDto<Nft017IdentityVerifyIdentityRespDto> resp = zxlnftSdkUtil.nft017IdentityVerifyIdentity(reqDto);
System.out.println(resp.toJson());
}
/**
* 18 请求人脸核身h5url api/v1/nft/face/url
* 19 通过用户地址请求人脸核身h5url api/v1/nft/face/url_by_address
* 20 人身核对结果查询接口 api/v1/nft/face/query
*/
@Test
public void nft021UploadUrl(){
Nft021UploadUrlReqDto reqDto = Nft021UploadUrlReqDto.getNew();
reqDto.setSeriesName("NOW_ZXL_NFT_PIC001_test_skuId001");
reqDto.setPlatformIdentification(zxlnftConfig.getPlatformIdentification());
reqDto.setUserIdentification(zxlnftConfig.getPlatformIdentification()); //暂时素材上传人和平台管理员是同一个人
ZxlnftResponseDto<Nft021UploadUrlRespDto> resp = zxlnftSdkUtil.nft021UploadUrl(reqDto);
System.out.println(resp.toJson());
// {
// "code": "0",
// "data": {
// "materialAddress": "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/NOW_ZXL_NFT_PIC001_test_skuId001/"
// },
// "success": true
// }
}
@Test
public void nft022UploadSecret(){
Nft022UploadSecretReqDto reqDto = Nft022UploadSecretReqDto.getNew();
reqDto.setSeriesName("NOW_ZXL_NFT_PIC001_test_skuId001");
reqDto.setTimestamp(DateUtil.getNowSeconds().toString());
reqDto.setUserPubKey(zxlnftConfig.getNftPlatformPubKey());
//系列为空
String userData = reqDto.getTimestamp();
//系列不为空
if(StringUtil.isNotEmpty(reqDto.getSeriesName())){
userData = reqDto.getTimestamp() + "_" + reqDto.getSeriesName();
}
reqDto.setUserSignedData(zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),userData));
ZxlnftResponseDto<Nft022UploadSecretRespDto> resp = zxlnftSdkUtil.nft022UploadSecret(reqDto);
System.out.println(resp.toJson());
//为什了发行人和平台是同一个人时,uploadAddres会少一级目录 少了个人目录,是自动省略了吗?
// {
// "code": "0",
// "data": {
// "tempSecretId": "AKIDhhEkTGgB37L_rc-Wy6sfqvz70a1AspdRh11oawassCa6Rg2SZ-V7Z-x66cGtRpOO",
// "tempSecretKey": "2KZKWE/BfzgbHoCYTTihLJW2QyVm4Bz48gsD1uPLvJg=",
// "sessionToken": "kgtsbjIKkVgYlIEGTZRJ1NJ3UhadM7Ea1eff3b33758e079d44b6fe4fd1f60e47ug5Dj85tZJxxa9efvA0xBWj6fZWagnsEzf25ZSGsEJrjjEY8ydKuIQrUuIjW9ifGHC1BYQ9kChXrSyXxHKO9O2RD4qDa-g3ljhBAbChtFyMCLxZKCG9OKpmB3yyRnF9mb-D5CHTDhO7ubUap_tIldEyqkWxmvfrvHgF0ndnhRt_I444-YQxnroHEnEk4gcBkRdDTeI_9JhVhQy3LZoBflfW1h0ZOHk2O1U7JrnsS7t5hOdjfXIul142mimp2YsDifJc8j2U5uAlml37iNqZ1OFsvxVcbPSI8dWCOiZvRk3ndN9EDEXDZjgrr-1nC3j1ZdXXE5ii1DCWbfmvhWFBbJit6PGqO7M-95Zuw-6VkzX5vwNaYMqtcU_a7u3brFu1DihZHxcjt3O6avzjaU_su6t_98G0DzL_CjvR_fLFKCpI3f3OhGC8jFm6D10cGYadwW7uQ10waXgMs11xjsgiC-By2K4G5xNa36t11wuXxISzJg5-v_eLCXQue8YXwZJNN2e49CdK2trGEwtB8z0Ok6HnlXK68fSCk0PDcmo1MhP18kCDC3Cm_LgbOQGExpuTDPc_HKlUZn9xBVJWqqiySE05aFSs8nr6WLlce5lzFbhIY_yJLMprZNNg8azBK_bgiyEJWavf3Kt8KRAo0YEMs8R0Cuma5YLsCzzCN6vBkW_hWfqZceT_BAcrP3p_-4IPtj7LtbfbhrhnfcUtfC2BoJiBIQXFPita4QrKwpkKVW5SyDw6O2zh0Iam7DjdXlKFrdH8nJef3oRYEqLsS_MOMU29kNRIxLfcrsXw_jTQ1Bjs",
// "uploadAddress": "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/NOW_ZXL_NFT_PIC001_test_skuId001/"
// },
// "success": true
// }
}
@Test
public void nft023PointApply(){
Nft023PointApplyReqDto reqDto = Nft023PointApplyReqDto.getNew();
//安家宾
// reqDto.setApplyerAddr("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
//周焕1
// reqDto.setApplyerAddr("ZXf8dcce2b5374610631735ad4d606372ff199d89e");
//周焕2
reqDto.setApplyerAddr("ZX26ff9db9cf1e981e3028b7e133d54b28eb859f97");
reqDto.setCount(200l);
reqDto.setOperateId(IDGenerator.get32UUID());
ZxlnftResponseDto<Nft023PointApplyRespDto> resp = zxlnftSdkUtil.nft023PointApply(reqDto);
System.out.println(resp.toJson());
}
/**
* 查询失败
*/
@Test
public void nft024PointApplyResult(){
Nft024PointApplyResultReqDto reqDto = Nft024PointApplyResultReqDto.getNew();
reqDto.setTaskId("337fe5cc-d509-418f-867f-378ca351e4ba_apply-point_1");
reqDto.setTaskId("01e01f1c-93c8-4bb0-b0f5-1ff064c210dc_apply-point_1");
reqDto.setTaskId("d1de1627-fcc6-46a2-8540-e4bd17ac1a02_apply-point_1");
reqDto.setTaskId("a09a628e-13c5-4183-a528-3bf9b3123fb7_apply-point_1");
ZxlnftResponseDto<Nft024PointApplyResultRespDto> resp = zxlnftSdkUtil.nft024PointApplyResult(reqDto);
System.out.println(resp.toJson());
}
/**
* 25 平台积分转移 api/v1/nft/point/transfer
* 26 平台积分转移状态查询 api/v1/nft/point/transfer/result
* 27 积分销毁 api/v1/nft/point/destroy
* 28 查询积分销毁结果 api/v1/nft/point/destory/resul
*/
@Test
public void nft029PointQuery(){
Nft029PointQueryReqDto reqDto = Nft029PointQueryReqDto.getNew();
reqDto.setAddr(zxlnftConfig.getNftPlatformAddress());
//周焕1
// reqDto.setAddr(zhouhuanAddress1);
//周焕2
// reqDto.setAddr(zhouhuanAddress2);
ZxlnftResponseDto<Nft029PointQueryRespDto> resp = zxlnftSdkUtil.nft029PointQuery(reqDto);
System.out.println(resp.toJson());
}
//30 NFT 系列声明 api/v1/nft/series/claim
//31 查询NFT系列声明结果 api/v1/nft/series/claim/result
//32 查询系列信息 api/v1/nft/series
//33 查询该账户资产归属的系列列表 api/v1/nft/series/list
@Test
public void nft030SeriesClaim(){
// Nft030SeriesClaimReqDto reqDto = Nft030SeriesClaimReqDto.getNew();
// reqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
// reqDto.setSeriesName("北京草莓音乐节2022主题模型-系列002");
// reqDto.setTotalCount(10l);
// reqDto.setOperateId(IDGenerator.get32UUID());
// reqDto.setCoverUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
// reqDto.setDesc("系列描述信息不超过500字符");
// reqDto.setMaxPublishCount(0);
// reqDto.setSeriesBeginFromZero(false);
//无限制系列
Nft030SeriesClaimReqDto reqDto = Nft030SeriesClaimReqDto.getNew();
reqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
reqDto.setSeriesName("北京草莓音乐节2022主题模型-系列000");
reqDto.setTotalCount(0l);
reqDto.setOperateId(IDGenerator.get32UUID());
reqDto.setCoverUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
reqDto.setDesc("系列描述信息不超过500字符");
reqDto.setMaxPublishCount(0);
reqDto.setSeriesBeginFromZero(false);
ZxlnftResponseDto<Nft030SeriesClaimRespDto> resp = zxlnftSdkUtil.nft030SeriesClaim(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft031SeriesClaimResult(){
Nft031SeriesClaimResultReqDto reqDto = Nft031SeriesClaimResultReqDto.getNew();
//第零个系列 无限制系列
reqDto.setTaskId("e1788c18-f72b-4dc3-8394-1c5f90d8aea6_nft-series-claim_1");
reqDto.setTaskId("dc284b01-6110-463a-ac60-8d505f3182d6_nft-series-claim_1");
reqDto.setTaskId("49d1cccc-e62c-40bc-923c-bfac31325351_nft-series-claim_1");
reqDto.setTaskId("959842b9-42cf-447a-9fa4-5798ea37bf67_nft-series-claim_1");
// reqDto.setTaskId("b42dbe4c-da91-4644-9f20-7dbfb8f8d41d_nft-series-claim_1");
//第一个系列 北京草莓音乐节2022主题模型-系列001
// reqDto.setTaskId("dc92bbd6-eb95-4452-99f8-0726001367be_nft-series-claim_1");
//第二个系列 北京草莓音乐节2022主题模型-系列002
// reqDto.setTaskId("0d951a6b-0697-4ede-83f2-e31485f380ce_nft-series-claim_1");
ZxlnftResponseDto<Nft031SeriesClaimResultRespDto> resp = zxlnftSdkUtil.nft031SeriesClaimResult(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft032Series(){
Nft032SeriesReqDto reqDto = Nft032SeriesReqDto.getNew();
//第零个系列 无限制系列查询
reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_8a827e181b695fb8d9b081d3855d2895ced1d003ee186622a005cec37ea77e59");
//第一个系列
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6");
//第二个系列
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_31ff9f7d4c33c98518e095fec6cecdab8d337751602cf6e651eb7d131cff5b61");
ZxlnftResponseDto<Nft032SeriesRespDto> resp = zxlnftSdkUtil.nft032Series(reqDto);
System.out.println(resp.toJson());
// {
// "code": "0",
// "data": {
// "seriesInfo": {
// "seriesId": "4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_8a827e181b695fb8d9b081d3855d2895ced1d003ee186622a005cec37ea77e59",
// "name": "北京草莓音乐节2022主题模型-系列000",
// "creatorAddr": "zxa66c8a684727d0f9aaa434044362aa8a18b61bb4",
// "totalCount": "0",
// "crtCount": "14",
// "coverUrl": "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg",
// "desc": "系列描述信息不超过500字符",
// "createTimeStamp": "1646237545"
// }
// },
// "success": true
// }
}
@Test
public void nft033SeriesList(){
Nft033SeriesListReqDto reqDto = Nft033SeriesListReqDto.getNew();
reqDto.setAddr("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
ZxlnftResponseDto<Nft033SeriesListRespDto> resp = zxlnftSdkUtil.nft033SeriesList(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft034Publish(){
// Nft034PublishReqDto reqDto = Nft034PublishReqDto.getNew();
// reqDto.setAuthor("正在现场创作者001");
// reqDto.setName("北京2022草莓音乐节2022");
// reqDto.setUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
// reqDto.setDisplayUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
// reqDto.setDesc("NFT描述信息");
// reqDto.setFlag("文创");
// reqDto.setPublishCount(1l);
//// reqDto.setSeriesId("");
// reqDto.setSeriesBeginIndex(1);
// reqDto.setSellStatus(Integer.parseInt(ZxlnftEnum.SellStatusEnum.CAN_SELL.getCode()));
// reqDto.setSellCount(1000l);
// reqDto.setOperateId(IDGenerator.get32UUID());
// reqDto.setMetaData("");
/**
* 发行无限制系列
*/
Nft034PublishReqDto reqDto = Nft034PublishReqDto.getNew();
reqDto.setAuthor("正在现场创作者001");
reqDto.setName("上海草莓音乐节2022");
reqDto.setUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
reqDto.setDisplayUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
reqDto.setDesc("NFT描述信息");
reqDto.setFlag("文创");
reqDto.setPublishCount(6l);
//无限制零系列
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_8a827e181b695fb8d9b081d3855d2895ced1d003ee186622a005cec37ea77e59");
// //系列001
reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6");
// //系列002
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_31ff9f7d4c33c98518e095fec6cecdab8d337751602cf6e651eb7d131cff5b61");
reqDto.setSeriesBeginIndex(6);
reqDto.setSellStatus(Integer.parseInt(ZxlnftEnum.SellStatusEnum.CAN_SELL.getCode()));
reqDto.setSellCount(1000l);
reqDto.setOperateId(IDGenerator.get32UUID());
reqDto.setMetaData("");
ZxlnftResponseDto<Nft034PublishRespDto> resp = zxlnftSdkUtil.nft034Publish(reqDto);
System.out.println(resp.toJson());
}
/**
* NFT发行
*/
@Test
public void nft035PublishResult(){
Nft035PublishResultReqDto reqDto = Nft035PublishResultReqDto.getNew();
// reqDto.setTaskId("5d23ed47-dcb2-4672-99eb-060c04727a20_nft-publish_3");
// reqDto.setTaskId("15ba80bb-a5f9-41db-b708-20bf4df34c14_nft-publish_3");
// reqDto.setTaskId("1b8b94c0-e9d1-4885-97a5-ae1b82302e17_nft-publish_3");
//无限制系列发行 1
reqDto.setTaskId("5a53f3ea-64a5-45a2-828b-196887990696_nft-publish_3");
//无限制系列发行 2
reqDto.setTaskId("f87f687f-0b3c-46fa-b23b-d1bbf6c2594f_nft-publish_3");
//北京草莓无限制系列发行 4
reqDto.setTaskId("ee26ee9c-7005-48ca-bbc0-3e367c641dce_nft-publish_3");
//上海草莓无限制系列发行 4 发行失败 已经存在
reqDto.setTaskId("76087122-b417-49ce-bed6-54a106375293_nft-publish_3");
//上海草莓无限制系列发行 5
reqDto.setTaskId("4d208028-36af-463b-b8ce-d1ca784df7b7_nft-publish_3");
//上海草莓无限制系列发行 6 共5个
reqDto.setTaskId("7bb78a44-aebe-460e-9624-7914cfc6854b_nft-publish_3");
//上海草莓无限制系列发行 11 共5个
reqDto.setTaskId("eee6ca98-e497-43bd-969d-cdc599d0f2bd_nft-publish_3");
//系列001 发行ID1 共5个
reqDto.setTaskId("45ebcf2a-5d71-44fc-a7f3-f88f3c92cfe6_nft-publish_3");
//系列001 发行ID6 共6个
reqDto.setTaskId("2f1eae08-6b52-42ff-ac69-78cca7bf6913_nft-publish_3");
reqDto.setTaskId("4efaab86-deb3-436f-9aca-de59033ec79c_nft-publish_3");
ZxlnftResponseDto<Nft035PublishResultRespDto> resp = zxlnftSdkUtil.nft035PublishResult(reqDto);
System.out.println(resp.toJson());
}
/**
* NFT发行
*/
@Test
public void nft036Info(){
Nft036InfoReqDto reqDto = Nft036InfoReqDto.getNew();
reqDto.setNftId("7f73aca56caaf57a20f0afff59318528f0f09ffbf028fe882161d3ce599d2854_1");
ZxlnftResponseDto<Nft036InfoRespDto> resp = zxlnftSdkUtil.nft036Info(reqDto);
System.out.println(resp.toJson());
}
/**
* 37 查询账户NFT列表
*/
@Test
public void nft037AddressList(){
Nft037AddressListReqDto reqDto = Nft037AddressListReqDto.getNew();
reqDto.setAddr(zxlnftConfig.getNftPlatformAddress());
// reqDto.setAddr(zhouhuanAddress2);
//系列001
reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6");
// reqDto.setOffset(0l);
reqDto.setLimit(1000l);
ZxlnftResponseDto<Nft037AddressListRespDto> resp = zxlnftSdkUtil.nft037AddressList(reqDto);
System.out.println(resp.toJson());
}
/**
* 查询无系列NFT列表
*/
@Test
public void nft038AddressWithoutSeriesList(){
Nft038AddressWithoutSeriesListReqDto reqDto = Nft038AddressWithoutSeriesListReqDto.getNew();
reqDto.setAddr(zxlnftConfig.getNftPlatformAddress());
// reqDto.setAddr(zhouhuanAddress1);
// reqDto.setOffset(0l);
reqDto.setLimit(1000l);
ZxlnftResponseDto<Nft038AddressWithoutSeriesListRespDto> resp = zxlnftSdkUtil.nft038AddressWithoutSeriesList(reqDto);
System.out.println(resp.toJson());
}
/**
* 查询NFT交易信息列表
*/
@Test
public void nft039TradeList(){
Nft039TradeListReqDto reqDto = Nft039TradeListReqDto.getNew();
reqDto.setNftId("08c152e5fa467d28b7add8e408fb3ecd1ed2ff209364adc1e394bde53929df8f_1");
// reqDto.setOffset(0l);
reqDto.setLimit(1000l);
ZxlnftResponseDto<Nft039TradeListRespDto> resp = zxlnftSdkUtil.nft039TradeList(reqDto);
System.out.println(resp.toJson());
}
/**
* 查询转入NFT交易信息列表
*/
@Test
public void nft040TradeInList(){
Nft040TradeInListReqDto reqDto = Nft040TradeInListReqDto.getNew();
// reqDto.setAddr(zxlnftConfig.getNftPlatformAddress());
reqDto.setAddr(zhouhuanAddress2);
// reqDto.setOffset(0l);
reqDto.setLimit(1000l);
ZxlnftResponseDto<Nft040TradeInListRespDto> resp = zxlnftSdkUtil.nft040TradeInList(reqDto);
System.out.println(resp.toJson());
}
/**
* 查询转出NFT交易信息列表
*/
@Test
public void nft041TradeOutList(){
Nft041TradeOutListReqDto reqDto = Nft041TradeOutListReqDto.getNew();
reqDto.setAddr(zxlnftConfig.getNftPlatformAddress());
// reqDto.setAddr(zhouhuanAddress2);
// reqDto.setOffset(0l);
reqDto.setLimit(1000l);
ZxlnftResponseDto<Nft041TradeOutListRespDto> resp = zxlnftSdkUtil.nft041TradeOutList(reqDto);
System.out.println(resp.toJson());
}
/**
* 通过地址查询全部NFT交易信息列表
*/
@Test
public void nft042TradeAllList(){
Nft042TradeAllListReqDto reqDto = Nft042TradeAllListReqDto.getNew();
// reqDto.setAddr(zxlnftConfig.getNftPlatformAddress());
// reqDto.setAddr(zhouhuanAddress1);
reqDto.setAddr(zhouhuanAddress2);
// reqDto.setOffset(0l);
reqDto.setLimit(1000l);
ZxlnftResponseDto<Nft042TradeAllListRespDto> resp = zxlnftSdkUtil.nft042TradeAllList(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft043Buy(){
Nft043BuyReqDto reqDto = Nft043BuyReqDto.getNew();
// reqDto.setNftId("7f73aca56caaf57a20f0afff59318528f0f09ffbf028fe882161d3ce599d2854_1");
reqDto.setNftId("08c152e5fa467d28b7add8e408fb3ecd1ed2ff209364adc1e394bde53929df8f_1");
reqDto.setApplyScore(1000);
reqDto.setReceiverPubKey(zhouhuanPubKey1);
reqDto.setPointReceiverAddr(zhouhuanAddress1);
reqDto.setOfferCount(1000l);
reqDto.setOperateId(IDGenerator.get32UUID());
/**
* 接收人的私钥签名,签名对象是(platformPubKey_receiverPubKey_pointReceiverAddr_applyScore_接口名_nftId_offerCount_operateId)
* 接口名:buy_nft
*/
String signMetaData = zxlnftConfig.getNftPlatformPubKey()
.concat("_").concat(reqDto.getReceiverPubKey())
.concat("_").concat(reqDto.getPointReceiverAddr())
.concat("_").concat(reqDto.getApplyScore().toString())
.concat("_").concat("buy_nft")
.concat("_").concat(reqDto.getNftId())
.concat("_").concat(reqDto.getOfferCount().toString())
.concat("_").concat(reqDto.getOperateId());
String signature = zxlnftBiz.createSign(zhouhuanPriKey1,signMetaData);
reqDto.setSignature(signature);
ZxlnftResponseDto<Nft043BuyRespDto> resp = zxlnftSdkUtil.nft043Buy(reqDto);
System.out.println(resp.toJson());
}
/**
* NFT发行
*/
@Test
public void nft044BuyResult(){
Nft044BuyResultReqDto reqDto = Nft044BuyResultReqDto.getNew();
reqDto.setTaskId("035137e8-f1ac-4784-a2e4-2a830878bb47_buy-nft_2");
ZxlnftResponseDto<Nft044BuyResultRespDto> resp = zxlnftSdkUtil.nft044BuyResult(reqDto);
System.out.println(resp.toJson());
}
/**
* NFT发行
*/
@Test
public void nft045BuyPayResult(){
Nft045BuyPayResultReqDto reqDto = Nft045BuyPayResultReqDto.getNew();
reqDto.setTaskId("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
ZxlnftResponseDto<Nft045BuyPayResultRespDto> resp = zxlnftSdkUtil.nft045BuyPayResult(reqDto);
System.out.println(resp.toJson());
}
/**
* 46 NFT转移
*/
@Test
public void nft046Transfer(){
Nft046TransferReqDto reqDto = Nft046TransferReqDto.getNew();
reqDto.setPubKey("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setReceiverAddr("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setNftId("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setOperateId("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setSignature("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
ZxlnftResponseDto<Nft046TransferRespDto> resp = zxlnftSdkUtil.nft046Transfer(reqDto);
System.out.println(resp.toJson());
}
/**
* 47 NFT同名转移
*/
@Test
public void nft047SelfTransfer(){
Nft047SelfTransferReqDto reqDto = Nft047SelfTransferReqDto.getNew();
reqDto.setPubKey("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setReceiverAddr("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setNftId("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setOperateId("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setSignature("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
ZxlnftResponseDto<Nft047SelfTransferRespDto> resp = zxlnftSdkUtil.nft047SelfTransfer(reqDto);
System.out.println(resp.toJson());
}
/**
* 48 NFT批量转移
*/
@Test
public void nft048BatchTransfer(){
Nft048BatchTransferReqDto reqDto = Nft048BatchTransferReqDto.getNew();
reqDto.setPubKey("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setReceiverAddr("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setNftIds("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setOperateId("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setSignature("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
ZxlnftResponseDto<Nft048BatchTransferRespDto> resp = zxlnftSdkUtil.nft048BatchTransfer(reqDto);
System.out.println(resp.toJson());
}
/**
* 49 NFT转移状态查询
*/
@Test
public void nft049TransferResult(){
Nft049TransferResultReqDto reqDto = Nft049TransferResultReqDto.getNew();
reqDto.setOperatorPubKey("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setTaskId("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
ZxlnftResponseDto<Nft049TransferResultRespDto> resp = zxlnftSdkUtil.nft049TransferResult(reqDto);
System.out.println(resp.toJson());
}
/**
* 50 NFT销售状态变更
*/
@Test
public void nft050StatusUpdate(){
Nft050StatusUpdateReqDto reqDto = Nft050StatusUpdateReqDto.getNew();
ZxlnftResponseDto<Nft050StatusUpdateRespDto> resp = zxlnftSdkUtil.nft050StatusUpdate(reqDto);
System.out.println(resp.toJson());
}
/**
* 51 NFT销售状态变更查询
*/
@Test
public void nft051StatusUpdateResult(){
Nft051StatusUpdateResultReqDto reqDto = Nft051StatusUpdateResultReqDto.getNew();
ZxlnftResponseDto<Nft051StatusUpdateResultRespDto> resp = zxlnftSdkUtil.nft051StatusUpdateResult(reqDto);
System.out.println(resp.toJson());
}
/**
* 52 NFT售价变更
*/
@Test
public void nft052PriceUpdate(){
Nft052PriceUpdateReqDto reqDto = Nft052PriceUpdateReqDto.getNew();
ZxlnftResponseDto<Nft052PriceUpdateRespDto> resp = zxlnftSdkUtil.nft052PriceUpdate(reqDto);
System.out.println(resp.toJson());
}
/**
* 53 NFT售价变更状态查询
*/
@Test
public void nft053PriceUpdateResult(){
Nft053PriceUpdateResultReqDto reqDto = Nft053PriceUpdateResultReqDto.getNew();
reqDto.setPlatformPubKey("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
reqDto.setTaskId("8b7f328e-5a63-42f2-ad73-177d5157c4de_buy-nft-pay_1");
ZxlnftResponseDto<Nft053PriceUpdateResultRespDto> resp = zxlnftSdkUtil.nft053PriceUpdateResult(reqDto);
System.out.println(resp.toJson());
}
/**
* 54 检查地址是否属于同一个用户主体接口
*/
@Test
public void nft054QueryUserAddressBelongToUser(){
Nft054QueryUserAddressBelongToUserReqDto reqDto = Nft054QueryUserAddressBelongToUserReqDto.getNew();
reqDto.setAddress1(zhouhuanAddress1);
reqDto.setAddress2(zhouhuanAddress2);
ZxlnftResponseDto<Nft054QueryUserAddressBelongToUserRespDto> resp = zxlnftSdkUtil.nft054QueryUserAddressBelongToUser(reqDto);
System.out.println(resp.toJson());
// 返回结果
// {"retCode":58,"retMsg":"NFT-验签错误","data":null}
}
}
package com.liquidnet.service.zxlnft;
import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz;
import com.liquidnet.common.third.zxlnft.config.ZxlnftConfig;
import com.liquidnet.common.third.zxlnft.constant.ZxlErrorEnum;
import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum;
import com.liquidnet.common.third.zxlnft.dto.*;
import com.liquidnet.common.third.zxlnft.dto.wallet.DeriveKeyPairReq;
import com.liquidnet.common.third.zxlnft.dto.wallet.DeriveKeyPairResp;
import com.liquidnet.common.third.zxlnft.dto.wallet.UploadToCosReq;
import com.liquidnet.common.third.zxlnft.dto.wallet.UploadToCosResp;
import com.liquidnet.common.third.zxlnft.exception.ZxlNftException;
import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil;
import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
import com.liquidnet.commons.lang.util.BASE64Util;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.UnsupportedEncodingException;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: TestZxlnftService
* @Package com.liquidnet.service.zxlnft
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/3 16:55
*/
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class TestZxlnftService {
@Autowired
private ZxlnftSdkUtil zxlnftSdkUtil;
@Autowired
private ZxlWalletSdkUtil zxlWalletSdkUtil;
@Autowired
private ZxlnftBiz zxlnftBiz;
@Autowired
private ZxlnftConfig zxlnftConfig;
/**
* 1、NFT平台在至信链的注册、审核
*/
@Test
public void platformRegister(){
// 1.1.2调用下发查询用户信息验证码接口
// 1.1.3调用查询用户信息接口
// 1.1.4调用下发用户信息查询验证码接口
// 1.1.5调用NFT平台自身地址绑定接口
// 1.1.6调用绑定状态批量查询接口
}
/**
* 2、自然人用户通过NFT平台注册绑定
*/
@Test
public void personRegisterBind(){
String userId = "310508344264376327445470";
String userName = "安家宾";
String mobile = "13811314082";
String idCardType = ZxlnftEnum.CardTypeEnum.ID_CARD.getCode();
String idCard = "142323198302062216";
// String userName = "周焕";
// String mobile = "18548596019";
// String idCardType = ZxlnftEnum.CardTypeEnum.ID_CARD.getCode();
// String idCard = "150422199805206019";
String mnemonic = "stuff name goat health siren dumb gorilla antique board tenant buffalo present"; //安家宾
// String mnemonic = "economy cost balance weapon flight also nut biology very sun slight about"; //周焕
Long index = 1L;
String userIdentification = null;
String address = null;
String userPubKey = null;
String userPriKey = null;
// try{
// //生成助记词
// CreateMnemonicReq req = CreateMnemonicReq.getNew();
// CreateMnemonicResp createMnemonicResp = zxlWalletSdkUtil.createMnemonic(req);
// mnemonic = createMnemonicResp.getMnemonic();
// }catch(Exception e){
// throw new ZxlNftException(ZxlErrorEnum.FAILURE.getCode(),"生成助记词失败!");
// }
/**
* todo 把助记词进行redis存储 key=userID mnemonic/index/userIdentification/address
*/
if(StringUtil.isNotEmpty(mnemonic)){
//生成公私钥
DeriveKeyPairReq deriveKeyPairReq = DeriveKeyPairReq.getNew();
deriveKeyPairReq.setMnemonic(mnemonic);
// deriveKeyPairReq.setMnemonic(createMnemonicResp.getMnemonic());
deriveKeyPairReq.setIndex(index);
try{
DeriveKeyPairResp deriveKeyPairResp = zxlWalletSdkUtil.deriveKeyPair(deriveKeyPairReq);
if(!deriveKeyPairResp.getErr().equals("")) throw new Exception("生成公私钥失败!");
userPubKey = BASE64Util.encoded(deriveKeyPairResp.getPubKey());
userPriKey = BASE64Util.encoded(deriveKeyPairResp.getPriKey());
}catch(Exception e){
throw new ZxlNftException(ZxlErrorEnum.FAILURE.getCode(),e.getMessage());
}
}
//1.2.1调用自然人注册实名(使用NFT平台签名)接口
Nft003RegisterPersonPlatformReqDto nft003ReqDto = Nft003RegisterPersonPlatformReqDto.getNew();
nft003ReqDto.setPersonName(userName);
// reqDto.setEmail("");
nft003ReqDto.setMobile(mobile);
nft003ReqDto.setIdCard(idCard);
nft003ReqDto.setCardType(Integer.valueOf(idCardType));
ZxlnftResponseDto<Nft003RegisterPersonPlatformRespDto> nft003Resp = zxlnftSdkUtil.nft003RegisterPersonPlatform(nft003ReqDto);
if(nft003Resp.isSuccess()){
userIdentification = nft003Resp.getData().getUserIdentification();
}
//
if(StringUtil.isNotEmpty(userPubKey)&&StringUtil.isNotEmpty(userPriKey)&&StringUtil.isNotEmpty(userIdentification)){
//1.2.2调用授信平台NFT地址绑定接口
Nft014IdentityBindSubmitByTrustedReqDto nft004ReqDto = Nft014IdentityBindSubmitByTrustedReqDto.getNew();
try {
nft004ReqDto.setUserPubKey(BASE64Util.decode(userPubKey));
nft004ReqDto.setUserIdentification(nft003Resp.getData().getUserIdentification());
String signature = zxlnftBiz.createSign(BASE64Util.decode(userPriKey),nft004ReqDto.getUserIdentification());
nft004ReqDto.setUserSignData(signature);
} catch (UnsupportedEncodingException e) {
log.error("公私钥解密错误!");
}
ZxlnftResponseDto<Nft014IdentityBindSubmitByTrustedRespDto> nft004Resp = zxlnftSdkUtil.nft014IdentityBindSubmitByTrusted(nft004ReqDto);
if(nft004Resp.isSuccess()){
//1.2.3调用绑定状态批量查询
Nft016IdentityBindQueryReqDto nft016ReqDto = Nft016IdentityBindQueryReqDto.getNew();
nft016ReqDto.setAddressList(nft004Resp.getData().getAddress());
ZxlnftResponseDto<Nft016IdentityBindQueryRespDto> nft016Resp = zxlnftSdkUtil.nft016IdentityBindQuery(nft016ReqDto);
if(nft016Resp.isSuccess()){
log.info("返回结果:{}",nft016Resp.toJson());
}
}else{
log.info("返回结果:{}",nft004Resp.toJson());
}
}
}
/**
* 3、素材上传操作
*/
@Test
public void nftUpload(){
String imageUrl = "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg";
String seriesName = "NOW_ZXL_NFT_PIC_skuId001"; //系列名字 skuId
// String filePath = "/Users/anjiabin/Downloads/zxl_image_test_002.jpeg";
// String filePath = "/Users/anjiabin/Downloads/zxl_image_series_test_001.jpeg";
String filePath = "/Users/anjiabin/Downloads/zxl_image_test_001.jpg";
String fileName = DateUtil.getNowTime(DateUtil.DATE_SMALL_STR)+"/"+ IDGenerator.getZxlNftImageCosCode() +".jpg";
//完整全路径 https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/NOW_ZXL_NFT_PIC001_test_skuId001/2022-03-04/ZXLNFTIMAGE202203041707466694345291.jpg
String fullFilePath = null; //需要保存,返回给调用者
String seriesId = null;
// 1.4.1调用图片内容检测接口
Nft008QueryImageModerationReqDto nft008ReqDto = Nft008QueryImageModerationReqDto.getNew();
nft008ReqDto.setImageUrl(imageUrl);
ZxlnftResponseDto<Nft008QueryImageModerationRespDto> nft008RespDto = zxlnftSdkUtil.nft008QueryImageModeration(nft008ReqDto);
if(!nft008RespDto.getData().getSuggestion().equals(ZxlnftEnum.SuggestionEnum.PASS.getCode())){
throw new ZxlNftException(ZxlErrorEnum.IMAGE_CHECK_ERROR.getCode(),ZxlErrorEnum.IMAGE_CHECK_ERROR.getMsg());
}
// 1.4.2调用生成素材上传临时密钥接口
Nft022UploadSecretReqDto nft022ReqDto = Nft022UploadSecretReqDto.getNew();
nft022ReqDto.setSeriesName(seriesName);
nft022ReqDto.setTimestamp(DateUtil.getNowSeconds().toString());
nft022ReqDto.setUserPubKey(zxlnftConfig.getNftPlatformPubKey());
//系列为空
String userData = nft022ReqDto.getTimestamp();
//系列不为空
if(StringUtil.isNotEmpty(nft022ReqDto.getSeriesName())){
userData = nft022ReqDto.getTimestamp() + "_" + nft022ReqDto.getSeriesName();
}
nft022ReqDto.setUserSignedData(zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),userData));
ZxlnftResponseDto<Nft022UploadSecretRespDto> nft022RespDto = zxlnftSdkUtil.nft022UploadSecret(nft022ReqDto);
if(!nft022RespDto.isSuccess()){
throw new ZxlNftException(ZxlErrorEnum.UPLOAD_TEMP_SECRET.getCode(),ZxlErrorEnum.UPLOAD_TEMP_SECRET.getMsg());
}
// 1.4.3调用sdk接口-上传cos接口
if(nft022RespDto.isSuccess()){
fullFilePath = nft022RespDto.getData().getUploadAddress().concat(fileName);
UploadToCosReq req = UploadToCosReq.getNew();
req.setCosPath(fullFilePath);
req.setTempSecretId(nft022RespDto.getData().getTempSecretId());
req.setTempSecretKey(nft022RespDto.getData().getTempSecretKey());
req.setSessionToken(nft022RespDto.getData().getSessionToken());
req.setFilePath(filePath);
UploadToCosResp uploadToCosResp = zxlWalletSdkUtil.uploadToCos(req);
}
log.info("完整的素材访问fullFilePath url:{}",fullFilePath);
// 1.4.4调用查询素材地址接口 -- 非必需
// Nft021UploadUrlReqDto nft021ReqDto = Nft021UploadUrlReqDto.getNew();
// nft021ReqDto.setSeriesName(seriesName);
// nft021ReqDto.setPlatformIdentification(zxlnftConfig.getPlatformIdentification());
// //如果上传人就是平台管理员,以下需要注释掉,因为会导致返回的地址多了一级目录
//// nft021ReqDto.setUserIdentification(zxlnftConfig.getPlatformIdentification());
// ZxlnftResponseDto<Nft021UploadUrlRespDto> resp = zxlnftSdkUtil.nft021UploadUrl(nft021ReqDto);
/**
* 进行系列声明
*/
Nft030SeriesClaimReqDto reqDto = Nft030SeriesClaimReqDto.getNew();
reqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
reqDto.setSeriesName(seriesName);
//无限制系列 设置为0
reqDto.setTotalCount(0l);
reqDto.setOperateId(IDGenerator.get32UUID());
//系列封面
reqDto.setCoverUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
reqDto.setDesc("系列描述信息不超过500字符");
reqDto.setMaxPublishCount(0);
reqDto.setSeriesBeginFromZero(false);
ZxlnftResponseDto<Nft030SeriesClaimRespDto> nft30RespDto = zxlnftSdkUtil.nft030SeriesClaim(reqDto);
//{"taskId":"49d1cccc-e62c-40bc-923c-bfac31325351_nft-series-claim_1"}
if(nft30RespDto.isSuccess()){
//系列声明结果查询
Nft031SeriesClaimResultReqDto nft031ReqDto = Nft031SeriesClaimResultReqDto.getNew();
//第零个系列 无限制系列
nft031ReqDto.setTaskId(nft30RespDto.getData().getTaskId());
ZxlnftResponseDto<Nft031SeriesClaimResultRespDto> nft031RespDto = zxlnftSdkUtil.nft031SeriesClaimResult(nft031ReqDto);
if(nft031RespDto.isSuccess()){
log.info("系列声明结果查询 :{}",nft031RespDto.toJson());
if(nft031RespDto.getData().getTaskStatus().equals(ZxlnftEnum.TaskStatusEnum.TASK_SECCESS.getCode())){
seriesId = nft031RespDto.getData().getSeriesId();
}
// {
// "code": "0",
// "data": {
// "taskStatus": 7,
// "taskMsg": "{\"TraceId\":\"046ed85b-b690-4137-92ce-838d93f693e5\",\"ErrMsg\":\"\",\"Cost\":\"400ms\"}",
// "seriesId": "4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_d55d3746e1a2720345e620c5fbf68515b1d8db284abbda84f202b79260b55a6d",
// "txHash": "f0f3bb9a49f20c0c90b7e58d71f9eeb283e163543a05e4d8d32d0b929835651f",
// "chainTimestamp": 1646386972
// },
// "success": true
// }
}
log.info("系列声明结果查询 seriesId :{}",seriesId);
}
}
@Test
public void SeriesClaimResultQuery(){
String taskId = "49d1cccc-e62c-40bc-923c-bfac31325351_nft-series-claim_1";
Nft031SeriesClaimResultReqDto reqDto = Nft031SeriesClaimResultReqDto.getNew();
//第零个系列 无限制系列
reqDto.setTaskId(taskId);
ZxlnftResponseDto<Nft031SeriesClaimResultRespDto> resp = zxlnftSdkUtil.nft031SeriesClaimResult(reqDto);
System.out.println(resp.toJson());
}
/**
* 4、发行NFT
*/
@Test
public void nftPublish(){
String author = "正在现场创作者001";
String name = "上海草莓音乐节2022";
String url = "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg";
String displayUrl = "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg";
String desc = "NFT描述信息";
String flag = "文创";
//发行个数
Long publishCount = 1L;
//开始索引
Integer seriesBeginIndex = 1;
Long sellCount = 1000L; //积分
//无限制系列
String seriesId = "4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_8a827e181b695fb8d9b081d3855d2895ced1d003ee186622a005cec37ea77e59";
//系列001
//String seriesId = "4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6";
//系列002
//String seriesId = "4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_31ff9f7d4c33c98518e095fec6cecdab8d337751602cf6e651eb7d131cff5b61";
//3.1.2调用NFT发行接口
/**
* 发行无限制系列
*/
Nft034PublishReqDto reqDto = Nft034PublishReqDto.getNew();
reqDto.setAuthor(author);
reqDto.setName(name);
reqDto.setUrl(url);
reqDto.setDisplayUrl(displayUrl);
reqDto.setDesc(desc);
reqDto.setFlag(flag);
reqDto.setPublishCount(publishCount);
//无限制零系列
reqDto.setSeriesId(seriesId);
reqDto.setSeriesBeginIndex(seriesBeginIndex);
reqDto.setSellStatus(Integer.parseInt(ZxlnftEnum.SellStatusEnum.CAN_SELL.getCode()));
reqDto.setSellCount(sellCount);
reqDto.setOperateId(IDGenerator.get32UUID());
reqDto.setMetaData("");
ZxlnftResponseDto<Nft034PublishRespDto> nft034RespDto = zxlnftSdkUtil.nft034Publish(reqDto);
// 3.1.3调用NFT查询接口
// 3.1.4查询 NFT发行结果
}
/**
* 5、购买NFT
*/
@Test
public void nftBuy(){
// 3.2.1调用积分申请接口
// 3.2.2调用购买NFT接口
// 3.2.3调用NFT查询接口
// 3.2.4查询NFT购买支付结果
}
/**
* 6、查询NFT相关信息
*/
@Test
public void nftQuery(){
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-bus-service</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-zxlnft</artifactId>
<packaging>pom</packaging>
<modules>
<module>liquidnet-service-zxlnft-impl</module>
</modules>
<dependencies>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-swagger</artifactId>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-web</artifactId>
</dependency>
</dependencies>
</project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment