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

Commit 038dd0e9 authored by anjiabin's avatar anjiabin

实现zxtnft购买功能

parent 77d2ae8d
......@@ -12,14 +12,14 @@ package com.liquidnet.service.galaxy.constant;
public class GalaxyConstant {
public static final String SERIES_STORE_NAME="NOW_ZXL_NFT_PIC";// 系列存储目录名称
public enum RouterEnum{
public enum RouterTypeEnum{
ZXINCHAIN("zxinchain","至信链"),
ETH ("eth","以太坊"),
ANTCHAIN ("antchain","蚂蚁链"),
XUPER("xuper","百度超级链");
private String code;
private String message;
RouterEnum(String code, String message) {
RouterTypeEnum(String code, String message) {
this.code = code;
this.message = message;
}
......@@ -68,7 +68,7 @@ public class GalaxyConstant {
public static void main(String[] args) {
Integer aaa = 1;
if(aaa.toString().equals(RouterEnum.ZXINCHAIN.getCode())){
if(aaa.toString().equals(RouterTypeEnum.ZXINCHAIN.getCode())){
System.out.println("支付成功");
}
}
......
......@@ -17,7 +17,7 @@ import java.io.Serializable;
*/
@ApiModel(value = "GalaxyArtSeriesClaimReqDto", description = "NFT系列声明")
@Data
public class GalaxyArtSeriesClaimReqDto implements Serializable,Cloneable {
public class GalaxyArtSeriesClaimReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
/**
* skuId
*/
......
package com.liquidnet.service.galaxy.dto;
import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data;
import java.io.Serializable;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyBaseReqDto
* @Package com.liquidnet.service.galaxy.dto
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 12:21
*/
@Data
public class GalaxyBaseReqDto implements Serializable,Cloneable{
private String routeType;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyBaseReqDto obj = new GalaxyBaseReqDto();
public static GalaxyBaseReqDto getNew() {
try {
return (GalaxyBaseReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyBaseReqDto();
}
}
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
......@@ -20,7 +21,7 @@ import java.io.Serializable;
*/
@ApiModel(value = "GalaxyNftBuyReqDto", description = "NFT购买")
@Data
public class GalaxyNftBuyReqDto implements Serializable,Cloneable {
public class GalaxyNftBuyReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
/**
* 以下为发行参数***********************************
*/
......@@ -31,36 +32,52 @@ public class GalaxyNftBuyReqDto implements Serializable,Cloneable {
/**
* skuId
*/
@ApiModelProperty(position = 1, required = true, value = "系列唯一id标识,不超过20个字符")
@Size(min = 2, max = 20, message = "skuId限制2-20位且不能包含特殊字符")
private String skuId;
/**
* 作者名,中文+英文(数字或符号为非法输入) 不超过30个字符
*/
@ApiModelProperty(position = 1, required = true, value = "作者名,中文+英文(数字或符号为非法输入) 不超过20个字符")
@Size(max = 20, message = "中文+英文(数字或符号为非法输入) 不超过20个字符")
private String author;
/**
* nft名字(sku名称),中英文数字均可,不超过256个字符
*/
@ApiModelProperty(position = 1, required = true, value = "nft名字(sku名称),中英文数字均可,不超过100个字符")
@Size(max = 100, message = "nft名字不能超过100个字符")
private String name;
/**
* nftUrl,不超过1024个字符
*/
@ApiModelProperty(position = 1, required = true, value = "nftUrl,不超过500个字符")
@Size(max = 500, message = "nftUrl,不超过500个字符")
private String url;
/**
* 预览图url,不超过1024个字符。(至信链浏览器展示预览图尺寸为290*290,请上传比例为1:1的图片)
*/
@ApiModelProperty(position = 1, required = true, value = "预览图url,不超过500个字符")
@Size(max = 500, message = "预览图url,不超过500个字符")
private String displayUrl;
/**
* nft简介,500个字符以内
*/
@ApiModelProperty(position = 1, required = true, value = "nft简介,300个字符以内")
@Size(max = 300, message = "nft简介,300个字符以内")
private String desc;
/**
* 标签,【文创】,游戏,动漫,30个字符以内
* 非必填
*/
@ApiModelProperty(position = 1, required = false, value = "标签,文创,游戏,动漫,30个字符以内")
@Size(max = 20, message = "标签,文创,游戏,动漫,20个字符以内")
private String flag;
/**
* 发行量,如果没有系列,就只能为1,如果有系列从1开始,比如如有100个,系列id范围则为[1-100],单次发行个数不超过1000,
* 同系列下同介质个数总共不能超过3000
*/
private String publishCount;
/**
* 可售状态下有意义,表示售卖多少积分
*/
@ApiModelProperty(position = 1, required = true, value = "sku价格,金额必须是数字格式,例:211.23 后续不可修改")
@Digits(integer = 10,fraction = 2,message = "金额必须是数字格式")
private String sellCount;
@Override
......
package com.liquidnet.service.galaxy.dto;
import com.liquidnet.commons.lang.util.JsonUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
......@@ -9,5 +15,25 @@ package com.liquidnet.service.galaxy.dto;
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/14 18:13
*/
public class GalaxyNftBuyRespDto {
@ApiModel(value = "GalaxyNftBuyRespDto", description = "NFT购买")
@Data
public class GalaxyNftBuyRespDto implements Serializable,Cloneable {
private String userId;
private String nftId;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyNftBuyRespDto obj = new GalaxyNftBuyRespDto();
public static GalaxyNftBuyRespDto getNew() {
try {
return (GalaxyNftBuyRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftBuyRespDto();
}
}
}
......@@ -18,7 +18,7 @@ import java.io.Serializable;
*/
@ApiModel(value = "GalaxyNftUploadReqDto", description = "NFT素材上传")
@Data
public class GalaxyNftUploadReqDto implements Serializable,Cloneable {
public class GalaxyNftUploadReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
@ApiModelProperty(position = 1, required = true, value = "上传原始图片url")
private String imageUrl;
......
......@@ -21,7 +21,7 @@ import java.io.Serializable;
*/
@ApiModel(value = "GalaxyUserRegisterReqDto", description = "用户实名注册")
@Data
public class GalaxyUserRegisterReqDto implements Serializable,Cloneable {
public class GalaxyUserRegisterReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
@ApiModelProperty(position = 1, required = true, value = "用户ID[30]")
@NotBlank(message = "用户ID不能为空!")
@Size(min = 1, max = 30, message = "用户ID限制2-30位且不能包含特殊字符")
......
package com.liquidnet.service.galaxy.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftBuyReqDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftBuyRespDto;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
......@@ -11,4 +15,5 @@ package com.liquidnet.service.galaxy.service;
* @date 2022/3/8 11:45
*/
public interface IGalaxyPublishService {
ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto);
}
package com.liquidnet.service.galaxy.router.eth.biz;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: EthArtworkBiz
* @Package com.liquidnet.service.galaxy.router.eth.biz
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 13:07
*/
public class EthArtworkBiz {
}
package com.liquidnet.service.galaxy.router.eth.biz;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: EthPublishBiz
* @Package com.liquidnet.service.galaxy.router.eth.biz
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 13:07
*/
public class EthPublishBiz {
}
package com.liquidnet.service.galaxy.router.eth.biz;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: EthUserBiz
* @Package com.liquidnet.service.galaxy.router.eth.biz
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 13:08
*/
public class EthUserBiz {
}
package com.liquidnet.service.galaxy.router.strategy;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.*;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
......@@ -10,9 +13,11 @@ package com.liquidnet.service.galaxy.router.strategy;
* @date 2022/3/8 10:27
*/
public interface IGalaxyRouterStrategy {
// ResponseDto<DragonPayBaseRespDto> dragonPay(DragonPayBaseReqDto dragonPayBaseReqDto);
//
// String dragonNotify(HttpServletRequest request, String payType, String deviceFrom);
//
// DragonPayOrderQueryRespDto checkOrderStatus(String code);
ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto);
ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto);
ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto);
ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto);
}
......@@ -18,5 +18,5 @@ import java.lang.annotation.*;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface StrategyGalaxyRouterHandler {
GalaxyConstant.RouterEnum value();
GalaxyConstant.RouterTypeEnum value();
}
package com.liquidnet.service.galaxy.router.strategy.impl;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.*;
import com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategy;
import lombok.extern.slf4j.Slf4j;
......@@ -14,60 +16,9 @@ import lombok.extern.slf4j.Slf4j;
*/
@Slf4j
public abstract class AbstractGalaxyRouterStrategyImpl implements IGalaxyRouterStrategy {
// @Autowired
// private DragonPayBiz dragonPayBiz;
// @Autowired
// private DataUtils dataUtils;
//
// @Autowired
// private DragonServiceCommonBiz dragonServiceCommonBiz;
//
// @Override
// public abstract ResponseDto<DragonPayBaseRespDto> dragonPay(DragonPayBaseReqDto dragonPayBaseReqDto);
//
// @Override
// public abstract String dragonNotify(HttpServletRequest request, String payType, String deviceFrom);
//
// @Override
// public abstract DragonPayOrderQueryRespDto checkOrderStatus(String code);
//
// /**
// * 支付成功方法
// * @param dragonOrdersDto
// * @param bankTrxNo
// * @param timeEnd
// * @param bankReturnMsg
// */
// @Transactional(rollbackFor = Exception.class)
// protected boolean completeSuccessOrder(DragonOrdersDto dragonOrdersDto, String bankTrxNo, LocalDateTime timeEnd, String bankReturnMsg) {
// log.info("订单支付成功!");
// dragonOrdersDto.setPaymentAt(timeEnd);
// dragonOrdersDto.setPaymentId(bankTrxNo);// 设置银行流水号
// dragonOrdersDto.setStatus(Integer.parseInt(DragonConstant.PayStatusEnum.STATUS_PAID.getCode()));
// //更新缓存
// dataUtils.updateOrderStatus(dragonOrdersDto.getCode(),dragonOrdersDto);
// //修改订单状态
// dragonServiceCommonBiz.updateOrderStatus(dragonOrdersDto.getCode(),dragonOrdersDto.getStatus(),bankTrxNo);
// //通知商户
// return dragonPayBiz.sendNotify(dragonPayBiz.buildPayNotifyReqBo(dragonOrdersDto));
// }
//
// /**
// * 支付失败方法
// * @param dragonOrdersDto
// * @param bankReturnMsg
// */
// protected boolean completeFailOrder(DragonOrdersDto dragonOrdersDto, String bankReturnMsg) {
// log.info("订单支付失败!");
//// dragonOrdersDto.setPaymentAt(timeEnd);
//// dragonOrdersDto.setPaymentId(bankTrxNo);// 设置银行流水号
// dragonOrdersDto.setStatus(Integer.parseInt(DragonConstant.PayStatusEnum.STATUS_PAY_FAIL.getCode()));
// //更新缓存
// dataUtils.updateOrderStatus(dragonOrdersDto.getCode(),dragonOrdersDto);
// //修改订单状态
// dragonServiceCommonBiz.updateOrderStatus(dragonOrdersDto.getCode(),dragonOrdersDto.getStatus(),null);
// //通知商户
// return dragonPayBiz.sendNotify(dragonPayBiz.buildPayNotifyReqBo(dragonOrdersDto));
// }
public abstract ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto);
public abstract ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto);
public abstract ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto);
}
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.galaxy.dto.*;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
......@@ -16,21 +18,26 @@ import org.springframework.stereotype.Component;
*/
@Slf4j
@Component
@StrategyGalaxyRouterHandler(GalaxyConstant.RouterEnum.ETH)
@StrategyGalaxyRouterHandler(GalaxyConstant.RouterTypeEnum.ETH)
public class GalaxyRouterStrategyEthImpl extends AbstractGalaxyRouterStrategyImpl {
// @Override
// public ResponseDto<DragonPayBaseRespDto> dragonPay(DragonPayBaseReqDto dragonPayBaseReqDto) {
// return null;
// }
//
// @Override
// public String dragonNotify(HttpServletRequest request,String payType,String deviceFrom) {
// return null;
// }
//
// @Override
// public DragonPayOrderQueryRespDto checkOrderStatus(String code) {
// return null;
// }
@Override
public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) {
return null;
}
}
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.galaxy.dto.*;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterHandler;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinArtworkBiz;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinPublishBiz;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinUserBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
......@@ -16,127 +22,34 @@ import org.springframework.stereotype.Component;
*/
@Slf4j
@Component
@StrategyGalaxyRouterHandler(GalaxyConstant.RouterEnum.ZXINCHAIN)
@StrategyGalaxyRouterHandler(GalaxyConstant.RouterTypeEnum.ZXINCHAIN)
public class GalaxyRouterStrategyZxlImpl extends AbstractGalaxyRouterStrategyImpl {
// @Autowired
// private AlipayStrategyContext alipayStrategyContext;
//
// @Autowired
// private DataUtils dataUtils;
//
// @Autowired
// private AlipayBiz alipayBiz;
//
// @Autowired
// private DragonPayBiz dragonPayBiz;
//
// @Autowired
// private DragonServiceCommonBiz dragonServiceCommonBiz;
//
// @Autowired
// private DragonOrderRefundsServiceImpl dragonOrderRefundsService;
//
// @Value("${liquidnet.dragon.alipay.appId}")
// private String appId;
// @Value("${liquidnet.dragon.alipay.merchantPubKey}")
// private String merchantPubKey;
// @Value("${liquidnet.dragon.alipay.merchantPrivateKey}")
// private String merchantPrivateKey;
// @Value("${liquidnet.dragon.alipay.signtType}")
// private String signtType;
// @Value("${liquidnet.dragon.alipay.charset}")
// private String charset;
//
// @Override
// public ResponseDto<DragonPayBaseRespDto> dragonPay(DragonPayBaseReqDto dragonPayBaseReqDto) {
// return alipayStrategyContext.getStrategy(dragonPayBaseReqDto.getDeviceFrom()).dragonPay(dragonPayBaseReqDto);
// }
//
// @Override
// public String dragonNotify(HttpServletRequest request,String payType,String deviceFrom) {
// log.info("alipay-->notify-->begin payType:{} deviceFrom:{}",payType,deviceFrom);
// Map<String, String[]> requestParams = request.getParameterMap();
// Map<String, String> notifyMap = new HashMap<String, String>();
// notifyMap = alipayBiz.parseNotifyMsg(requestParams);
// log.info("dragonNotify-->alipay json : {}", JSON.toJSONString(notifyMap));
// log.info("接收到{}支付结果{}", payType, notifyMap);
//
//
// String returnStr = "fail";
// String code = notifyMap.get("out_trade_no");
//
// //持久化通知记录
// dragonServiceCommonBiz.createDragonOrderLogs(code,dragonPayBiz.getPaymentType(payType,deviceFrom),JSON.toJSONString(notifyMap));
//
// //退款
// if(notifyMap.containsKey("refund_fee") || notifyMap.containsKey("gmt_refund") || notifyMap.containsKey("out_biz_no")) {
// returnStr = dragonOrderRefundsService.aliPayRefundCallBack(JSON.toJSONString(notifyMap));
// return returnStr;
// }
//
// // 根据银行订单号获取支付信息
// DragonOrdersDto dragonOrdersDto = dataUtils.getPayOrderByCode(code);
// if (dragonOrdersDto == null) {
// throw new LiquidnetServiceException(DragonErrorCodeEnum.TRADE_ERROR_NOT_EXISTS.getCode(),DragonErrorCodeEnum.TRADE_ERROR_NOT_EXISTS.getMessage());
// }
//
// if (DragonConstant.PayStatusEnum.STATUS_PAID.getCode().equals(dragonOrdersDto.getStatus())) {
// throw new LiquidnetServiceException(DragonErrorCodeEnum.TRADE_ERROR_HAS_PAID.getCode(),DragonErrorCodeEnum.TRADE_ERROR_HAS_PAID.getMessage());
// }
//
// try {
// if (AlipaySignature.rsaCheckV1(notifyMap, merchantPubKey, "UTF-8", "RSA2")){
// String tradeStatus = notifyMap.get("trade_status");
// boolean notifyResult = false;
//
// if (AlipayConstant.AlipayTradeStateEnum.TRADE_SUCCESS.name().equals(tradeStatus)
// ||AlipayConstant.AlipayTradeStateEnum.TRADE_FINISHED.name().equals(tradeStatus)) {
//
// String gmtPaymentStr = notifyMap.get("gmt_payment");// 付款时间
// LocalDateTime timeEnd = null;
// if (!StringUtil.isEmpty(gmtPaymentStr)) {
// timeEnd = DateUtil.Formatter.yyyyMMddHHmmss.parse(gmtPaymentStr);
// }
// notifyResult = this.completeSuccessOrder(dragonOrdersDto, notifyMap.get("trade_no"), timeEnd, notifyMap.toString());
// } else {
// notifyResult = this.completeFailOrder(dragonOrdersDto, notifyMap.toString());
// }
// if(notifyResult){
// returnStr = "success";
// }
// } else {// 验证失败
// log.error("alipay notify fail code:{} msg:{} ",DragonErrorCodeEnum.TRADE_ALIPAY_SIGN_ERROR.getCode(),DragonErrorCodeEnum.TRADE_ALIPAY_SIGN_ERROR.getMessage());
// return returnStr;
// }
// } catch (AlipayApiException e) {
// log.error("alipay notify fail 验签失败:e:{}" , e);
// log.error("alipay notify fail 验签失败:code:{} msg:{}" ,DragonErrorCodeEnum.TRADE_ALIPAY_SIGN_ERROR.getCode(),DragonErrorCodeEnum.TRADE_ALIPAY_SIGN_ERROR.getMessage());
// }
//
// log.info("返回支付通道{}信息{}", payType, returnStr);
// log.info("alipay-->notify-->end payType:{} deviceFrom:{}",payType,deviceFrom);
// return returnStr;
// }
//
// @Override
// public DragonPayOrderQueryRespDto checkOrderStatus(String code) {
// DragonOrdersDto ordersDto = dataUtils.getPayOrderByCode(code);
// Map<String, Object> resultMap = alipayBiz.tradeQuery(code);
// DragonPayOrderQueryRespDto respDto = dragonPayBiz.buildPayOrderQueryRespDto(ordersDto);
// if ("10000".equals(resultMap.get("code"))) {
// // 当返回状态为“TRADE_FINISHED”交易成功结束和“TRADE_SUCCESS”支付成功时更新交易状态
// if (AlipayConstant.AlipayTradeStateEnum.TRADE_SUCCESS.getCode().equals(resultMap.get("tradeStatus"))
// || AlipayConstant.AlipayTradeStateEnum.TRADE_FINISHED.getCode().equals(resultMap.get("tradeStatus"))) {
// respDto.setStatus(Integer.valueOf(DragonConstant.PayStatusEnum.STATUS_PAID.getCode()));
// }else{
// respDto.setStatus(Integer.valueOf(DragonConstant.PayStatusEnum.STATUS_PAY_FAIL.getCode()));
// }
//// throw new LiquidnetServiceException(DragonErrorCodeEnum.TRADE_ALIPAY_QUERY_ERROR.getCode(),DragonErrorCodeEnum.TRADE_ALIPAY_QUERY_ERROR.getMessage());
// }else if("40004".equals(resultMap.get("code"))&&"ACQ.TRADE_NOT_EXIST".equalsIgnoreCase(resultMap.get("subCode").toString())){
// respDto.setStatus(Integer.valueOf(DragonConstant.PayStatusEnum.STATUS_UNPAID.getCode()));
// }else{
// throw new LiquidnetServiceException(DragonErrorCodeEnum.TRADE_ALIPAY_QUERY_ERROR.getCode(),DragonErrorCodeEnum.TRADE_ALIPAY_QUERY_ERROR.getMessage());
// }
// return respDto;
// }
@Autowired
private ZxinUserBiz zxinUserBiz;
@Autowired
private ZxinArtworkBiz zxinArtworkBiz;
@Autowired
private ZxinPublishBiz zxinPublishBiz;
@Override
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return zxinUserBiz.userRegister(reqDto);
}
@Override
public ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto) {
return zxinArtworkBiz.nftUpload(reqDto);
}
@Override
public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) {
return zxinArtworkBiz.seriesClaim(reqDto);
}
@Override
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) {
return zxinPublishBiz.nftBuy(reqDto);
}
}
package com.liquidnet.service.galaxy.router.zxin.biz;
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.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.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.GalaxyArtSeriesClaimReqDto;
import com.liquidnet.service.galaxy.dto.GalaxyArtSeriesClaimRespDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftUploadReqDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftUploadRespDto;
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 java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: ZxinArtworkBiz
* @Package com.liquidnet.service.galaxy.router.zxin.biz
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 13:04
*/
@Slf4j
@Component
public class ZxinArtworkBiz {
@Autowired
private ZxlnftSdkUtil zxlnftSdkUtil;
@Autowired
private ZxlWalletSdkUtil zxlWalletSdkUtil;
@Autowired
private ZxlnftBiz zxlnftBiz;
@Autowired
private ZxlnftConfig zxlnftConfig;
@Value("${liquidnet.galaxy.temp-file-path:/Users/anjiabin/mdsky_gitlab/galaxy/tempFilePath}")
private String tempFilePath;
public ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto) {
String imageUrl = reqDto.getImageUrl();
String seriesName = "NOW_ZXL_NFT_PIC_skuId002"; //系列名字 skuId
String filePath = "/Users/anjiabin/Downloads/myFileTemp/zxl_image_test_001.jpg";
String fileName = IDGenerator.getZxlNftImageCosCode() +".jpg";
//通过图片url地址上传
File cosFile = this.inputStreamToFile(reqDto.getImageUrl(),fileName);
filePath = cosFile.getAbsolutePath();
log.info("cosFile.getPath() :{}",cosFile.getPath());
log.info("cosFile.getAbsoluteFile() :{}",cosFile.getAbsoluteFile());
//完整全路径 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);
GalaxyNftUploadRespDto galaxyNftUploadRespDto = GalaxyNftUploadRespDto.getNew();
galaxyNftUploadRespDto.setMaterialAccessUrl(fullFilePath);
return ResponseDto.success(galaxyNftUploadRespDto);
// 1.4.4调用查询素材地址接口 -- 非必需
// Nft021UploadUrlReqDto nft021ReqDto = Nft021UploadUrlReqDto.getNew();
// nft021ReqDto.setSeriesName(seriesName);
// nft021ReqDto.setPlatformIdentification(zxlnftConfig.getPlatformIdentification());
// //如果上传人就是平台管理员,以下需要注释掉,因为会导致返回的地址多了一级目录
//// nft021ReqDto.setUserIdentification(zxlnftConfig.getPlatformIdentification());
// ZxlnftResponseDto<Nft021UploadUrlRespDto> resp = zxlnftSdkUtil.nft021UploadUrl(nft021ReqDto);
}
public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) {
/**
* 进行系列声明
*/
// Nft030SeriesClaimReqDto nft030ReqDto = Nft030SeriesClaimReqDto.getNew();
// nft030ReqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
// nft030ReqDto.setSeriesName(seriesName);
// //无限制系列 设置为0
// nft030ReqDto.setTotalCount(0l);
// nft030ReqDto.setOperateId(IDGenerator.get32UUID());
// //系列封面
// nft030ReqDto.setCoverUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
// nft030ReqDto.setDesc("系列描述信息不超过500字符");
// nft030ReqDto.setMaxPublishCount(0);
// nft030ReqDto.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());
//
// int count = 0;
// while(StringUtil.isEmpty(seriesId)){
// //休眠1秒钟,等待执行结果
// try {
// Thread.sleep(1000l);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
//
// count++;
// log.info("=======执行第{}次查询,taskId:{}",count,nft031ReqDto.getTaskId());
// ZxlnftResponseDto<Nft031SeriesClaimResultRespDto> nft031RespDtoTemp = zxlnftSdkUtil.nft031SeriesClaimResult(nft031ReqDto);
// if(nft031RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())){
// seriesId = nft031RespDtoTemp.getData().getSeriesId();
// break;
// }else if(nft031RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){
// log.info("任务执行失败!taskId:{}",nft031ReqDto.getTaskId());
// break;
// }
//
// if(count==6){
// log.info("=======查询共6次,跳出循环!taskId:{}",nft031ReqDto.getTaskId());
// break;
// }
// }
//
// log.info("系列声明结果查询 seriesId :{}",seriesId);
// }
return null;
}
/**
* 大美 通过URL上传
*
* @param url
* @param name
* @return
*/
public File inputStreamToFile(String url, String name) {
try {
HttpURLConnection httpUrl = (HttpURLConnection) new URL(url).openConnection();
httpUrl.connect();
InputStream ins = httpUrl.getInputStream();
// File file = new File(System.getProperty("java.io.tmpdir") + File.separator + name);
File file = new File(tempFilePath + File.separator + name);
if (file.exists()) {
return file;
}
OutputStream os = new FileOutputStream(file);
int bytesRead;
int len = 8192;
byte[] buffer = new byte[len];
while ((bytesRead = ins.read(buffer, 0, len)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.close();
ins.close();
return file;
} catch (Exception e) {
log.error("inputStreamToFileUrlError", e);
return null;
}
}
}
package com.liquidnet.service.galaxy.router.zxin.biz;
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.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftBuyReqDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftBuyRespDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: ZxinPublishBiz
* @Package com.liquidnet.service.galaxy.router.zxin.biz
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 13:05
*/
@Slf4j
@Component
public class ZxinPublishBiz {
@Autowired
private ZxlnftSdkUtil zxlnftSdkUtil;
@Autowired
private ZxlWalletSdkUtil zxlWalletSdkUtil;
@Autowired
private ZxlnftBiz zxlnftBiz;
@Autowired
private ZxlnftConfig zxlnftConfig;
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) {
String author = reqDto.getAuthor();
String name = reqDto.getName();
String url = reqDto.getUrl();
String displayUrl = reqDto.getDisplayUrl();
String desc = reqDto.getDesc();
String flag = reqDto.getFlag();
//发行个数
Long publishCount = 1L;
//开始索引
Integer seriesBeginIndex = 0;
Long sellCount = Long.valueOf(new BigDecimal(reqDto.getSellCount()).longValue()); //积分
/**
* 根据sku获取系列Id
*/
String seriesId = reqDto.getSkuId();
//查询系列信息
Nft032SeriesReqDto nft032ReqDto = Nft032SeriesReqDto.getNew();
nft032ReqDto.setSeriesId(seriesId);
ZxlnftResponseDto<Nft032SeriesRespDto> resp = zxlnftSdkUtil.nft032Series(nft032ReqDto);
if(!resp.isSuccess()){
//该系列已经发行多少个nft
Long crtCount = resp.getData().getSeriesInfo().getCrtCount();
log.info("系列:{} 已发行 :{}", seriesId, crtCount);
//设置开始索引
seriesBeginIndex = Integer.parseInt(String.valueOf(crtCount.longValue() + 1));
}
//3.1.2调用NFT发行接口
/**
* 发行无限制系列
*/
Nft034PublishReqDto nft034ReqDto = Nft034PublishReqDto.getNew();
nft034ReqDto.setAuthor(author);
nft034ReqDto.setName(name);
nft034ReqDto.setUrl(url);
nft034ReqDto.setDisplayUrl(displayUrl);
nft034ReqDto.setDesc(desc);
nft034ReqDto.setFlag(flag);
nft034ReqDto.setPublishCount(publishCount);
//无限制零系列
nft034ReqDto.setSeriesId(seriesId);
nft034ReqDto.setSeriesBeginIndex(seriesBeginIndex);
nft034ReqDto.setSellStatus(Integer.parseInt(ZxlnftEnum.SellStatusEnum.CAN_SELL.getCode()));
nft034ReqDto.setSellCount(sellCount);
nft034ReqDto.setOperateId(IDGenerator.get32UUID());
nft034ReqDto.setMetaData("");
ZxlnftResponseDto<Nft034PublishRespDto> nft034RespDto = zxlnftSdkUtil.nft034Publish(nft034ReqDto);
if (nft034RespDto.isSuccess()) {
//3.1.4查询 NFT发行结果
Nft035PublishResultReqDto nft035ReqDto = Nft035PublishResultReqDto.getNew();
nft035ReqDto.setTaskId(nft034RespDto.getData().getTaskId());
//休眠1秒钟,等待执行结果
try {
Thread.sleep(1000l);
} catch (InterruptedException e) {
e.printStackTrace();
}
long timeStart = System.currentTimeMillis();
log.info("=======执行第{}次查询,taskId:{}", 1, nft035ReqDto.getTaskId());
ZxlnftResponseDto<Nft035PublishResultRespDto> nft035RespDto = zxlnftSdkUtil.nft035PublishResult(nft035ReqDto);
if (nft035RespDto.isSuccess()) {
if (nft035RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())) {
log.info("任务执行失败!taskId:{} taskMsg:{}", nft035ReqDto.getTaskId(), nft035RespDto.getData().getTaskMsg());
return null;
}
int count = 1;
String nftIdBegin = nft035RespDto.getData().getNftIdBegin();
if (nft035RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.PROCESSING.getCode())) {
log.info(ZxlnftEnum.TaskStatusEnum.PROCESSING.getMessage());
while (StringUtil.isEmpty(nftIdBegin)) {
//休眠1秒钟,等待执行结果
try {
Thread.sleep(1000l);
} catch (InterruptedException e) {
e.printStackTrace();
}
count++;
ZxlnftResponseDto<Nft035PublishResultRespDto> nft035RespDtoTemp = zxlnftSdkUtil.nft035PublishResult(nft035ReqDto);
log.info("=======执行第{}次查询,taskId:{}", count, nft035ReqDto.getTaskId());
if (nft035RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())) {
nftIdBegin = nft035RespDtoTemp.getData().getNftIdBegin();
} else if (nft035RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())) {
log.info("任务执行失败!taskId:{}", nft035ReqDto.getTaskId());
return null;
}
if (count == 6) {
log.info("=======查询共6次,跳出循环!taskId:{}", nft035ReqDto.getTaskId());
break;
}
}
} else if (nft035RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())) {
log.info(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getMessage());
}
log.info("发行NFT后返回给前端nftID:{}", nftIdBegin);
log.info("总共执行了{}次查询 总耗时:{} MS", count, (System.currentTimeMillis() - timeStart));
if (StringUtil.isNotEmpty(nftIdBegin)) {
//3.1.3调用NFT查询接口
Nft036InfoReqDto nft036ReqDto = Nft036InfoReqDto.getNew();
nft036ReqDto.setNftId(nftIdBegin);
ZxlnftResponseDto<Nft036InfoRespDto> nft036RespDto = zxlnftSdkUtil.nft036Info(nft036ReqDto);
log.info("调用NFT查询接口 : {}", nft036RespDto.toJson());
}
}
}
return null;
}
}
package com.liquidnet.service.galaxy.router.zxin.biz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: ZxinTradeBiz
* @Package com.liquidnet.service.galaxy.router.zxin.biz
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 13:08
*/
@Slf4j
@Component
public class ZxinTradeBiz {
}
package com.liquidnet.service.galaxy.router.zxin.biz;
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.dto.*;
import com.liquidnet.common.third.zxlnft.dto.nft.Nft016QueryRsData;
import com.liquidnet.common.third.zxlnft.dto.wallet.CreateMnemonicReq;
import com.liquidnet.common.third.zxlnft.dto.wallet.CreateMnemonicResp;
import com.liquidnet.common.third.zxlnft.dto.wallet.DeriveKeyPairReq;
import com.liquidnet.common.third.zxlnft.dto.wallet.DeriveKeyPairResp;
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.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.dto.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.GalaxyUserRegisterRespDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: ZxinUserBiz
* @Package com.liquidnet.service.galaxy.router.zxin.biz
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 13:05
*/
@Slf4j
@Component
public class ZxinUserBiz {
@Autowired
private ZxlnftSdkUtil zxlnftSdkUtil;
@Autowired
private ZxlWalletSdkUtil zxlWalletSdkUtil;
@Autowired
private ZxlnftBiz zxlnftBiz;
@Autowired
private ZxlnftConfig zxlnftConfig;
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
String userId = reqDto.getUserId();
String userName = reqDto.getUserName();
String mobile = reqDto.getMobile();
String idCardType = reqDto.getIdCardType();
String idCard = reqDto.getIdCard();
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 = 0L;
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();
}else{
return ResponseDto.failure(nft003Resp.getCode(),nft003Resp.getMessage());
}
GalaxyUserRegisterRespDto respDto = GalaxyUserRegisterRespDto.getNew();
if(StringUtil.isNotEmpty(userPubKey)&&StringUtil.isNotEmpty(userPriKey)&&StringUtil.isNotEmpty(userIdentification)){
//1.2.2调用授信平台NFT地址绑定接口
Nft014IdentityBindSubmitByTrustedReqDto nft014ReqDto = Nft014IdentityBindSubmitByTrustedReqDto.getNew();
try {
nft014ReqDto.setUserPubKey(BASE64Util.decode(userPubKey));
nft014ReqDto.setUserIdentification(nft003Resp.getData().getUserIdentification());
String signature = zxlnftBiz.createSign(BASE64Util.decode(userPriKey),nft014ReqDto.getUserIdentification());
nft014ReqDto.setUserSignData(signature);
} catch (UnsupportedEncodingException e) {
log.error("公私钥解密错误!");
}
ZxlnftResponseDto<Nft014IdentityBindSubmitByTrustedRespDto> nft014Resp = zxlnftSdkUtil.nft014IdentityBindSubmitByTrusted(nft014ReqDto);
ZxlnftResponseDto<Nft016IdentityBindQueryRespDto> nft016Resp = null;
if(nft014Resp.isSuccess()){
//1.2.3调用绑定状态批量查询
Nft016IdentityBindQueryReqDto nft016ReqDto = Nft016IdentityBindQueryReqDto.getNew();
nft016ReqDto.setAddressList(nft014Resp.getData().getAddress());
nft016Resp = zxlnftSdkUtil.nft016IdentityBindQuery(nft016ReqDto);
}else{
log.info("nft014Resp 返回结果:{}",nft014Resp.toJson());
return ResponseDto.failure(nft014Resp.getCode(),nft014Resp.getMessage());
}
if(StringUtil.isNotNull(nft016Resp)&&nft016Resp.isSuccess()){
List<Nft016QueryRsData> queryRsDataList = nft016Resp.getData().getList();
Nft016QueryRsData queryRsData = queryRsDataList.get(0);
address = queryRsData.getAddress();
log.info("nft016Resp 返回结果:{}",nft016Resp.toJson());
//构造返回参数
respDto.setUserId(userId);
respDto.setBlockChainType(GalaxyConstant.RouterTypeEnum.ZXINCHAIN.getCode());
respDto.setBlockChainAddress(address);
}else{
return ResponseDto.failure(nft016Resp.getMessage());
}
}
return ResponseDto.success(respDto);
}
}
package com.liquidnet.service.galaxy.service.impl;
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.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.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.GalaxyArtSeriesClaimReqDto;
import com.liquidnet.service.galaxy.dto.GalaxyArtSeriesClaimRespDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftUploadReqDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftUploadRespDto;
import com.liquidnet.service.galaxy.router.strategy.GalaxyRouterStrategyContext;
import com.liquidnet.service.galaxy.service.IGalaxyArtworkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
......@@ -44,178 +24,15 @@ import java.net.URL;
@Service
public class GalaxyArtworkServiceImpl implements IGalaxyArtworkService {
@Autowired
private ZxlnftSdkUtil zxlnftSdkUtil;
@Autowired
private ZxlWalletSdkUtil zxlWalletSdkUtil;
@Autowired
private ZxlnftBiz zxlnftBiz;
@Autowired
private ZxlnftConfig zxlnftConfig;
@Value("${liquidnet.galaxy.temp-file-path:/Users/anjiabin/mdsky_gitlab/galaxy/tempFilePath}")
private String tempFilePath;
private GalaxyRouterStrategyContext galaxyRouterStrategyContext;
@Override
public ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto) {
String imageUrl = reqDto.getImageUrl();
String seriesName = "NOW_ZXL_NFT_PIC_skuId002"; //系列名字 skuId
String filePath = "/Users/anjiabin/Downloads/myFileTemp/zxl_image_test_001.jpg";
String fileName = IDGenerator.getZxlNftImageCosCode() +".jpg";
//通过图片url地址上传
File cosFile = this.inputStreamToFile(reqDto.getImageUrl(),fileName);
filePath = cosFile.getAbsolutePath();
log.info("cosFile.getPath() :{}",cosFile.getPath());
log.info("cosFile.getAbsoluteFile() :{}",cosFile.getAbsoluteFile());
//完整全路径 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);
GalaxyNftUploadRespDto galaxyNftUploadRespDto = GalaxyNftUploadRespDto.getNew();
galaxyNftUploadRespDto.setMaterialAccessUrl(fullFilePath);
return ResponseDto.success(galaxyNftUploadRespDto);
// 1.4.4调用查询素材地址接口 -- 非必需
// Nft021UploadUrlReqDto nft021ReqDto = Nft021UploadUrlReqDto.getNew();
// nft021ReqDto.setSeriesName(seriesName);
// nft021ReqDto.setPlatformIdentification(zxlnftConfig.getPlatformIdentification());
// //如果上传人就是平台管理员,以下需要注释掉,因为会导致返回的地址多了一级目录
//// nft021ReqDto.setUserIdentification(zxlnftConfig.getPlatformIdentification());
// ZxlnftResponseDto<Nft021UploadUrlRespDto> resp = zxlnftSdkUtil.nft021UploadUrl(nft021ReqDto);
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).nftUpload(reqDto);
}
@Override
public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) {
/**
* 进行系列声明
*/
// Nft030SeriesClaimReqDto nft030ReqDto = Nft030SeriesClaimReqDto.getNew();
// nft030ReqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
// nft030ReqDto.setSeriesName(seriesName);
// //无限制系列 设置为0
// nft030ReqDto.setTotalCount(0l);
// nft030ReqDto.setOperateId(IDGenerator.get32UUID());
// //系列封面
// nft030ReqDto.setCoverUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
// nft030ReqDto.setDesc("系列描述信息不超过500字符");
// nft030ReqDto.setMaxPublishCount(0);
// nft030ReqDto.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());
//
// int count = 0;
// while(StringUtil.isEmpty(seriesId)){
// //休眠1秒钟,等待执行结果
// try {
// Thread.sleep(1000l);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
//
// count++;
// log.info("=======执行第{}次查询,taskId:{}",count,nft031ReqDto.getTaskId());
// ZxlnftResponseDto<Nft031SeriesClaimResultRespDto> nft031RespDtoTemp = zxlnftSdkUtil.nft031SeriesClaimResult(nft031ReqDto);
// if(nft031RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())){
// seriesId = nft031RespDtoTemp.getData().getSeriesId();
// break;
// }else if(nft031RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){
// log.info("任务执行失败!taskId:{}",nft031ReqDto.getTaskId());
// break;
// }
//
// if(count==6){
// log.info("=======查询共6次,跳出循环!taskId:{}",nft031ReqDto.getTaskId());
// break;
// }
// }
//
// log.info("系列声明结果查询 seriesId :{}",seriesId);
// }
return null;
}
/**
* 大美 通过URL上传
*
* @param url
* @param name
* @return
*/
public File inputStreamToFile(String url, String name) {
try {
HttpURLConnection httpUrl = (HttpURLConnection) new URL(url).openConnection();
httpUrl.connect();
InputStream ins = httpUrl.getInputStream();
// File file = new File(System.getProperty("java.io.tmpdir") + File.separator + name);
File file = new File(tempFilePath + File.separator + name);
if (file.exists()) {
return file;
}
OutputStream os = new FileOutputStream(file);
int bytesRead;
int len = 8192;
byte[] buffer = new byte[len];
while ((bytesRead = ins.read(buffer, 0, len)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.close();
ins.close();
return file;
} catch (Exception e) {
log.error("inputStreamToFileUrlError", e);
return null;
}
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).seriesClaim(reqDto);
}
}
package com.liquidnet.service.galaxy.service.impl;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftBuyReqDto;
import com.liquidnet.service.galaxy.dto.GalaxyNftBuyRespDto;
import com.liquidnet.service.galaxy.router.strategy.GalaxyRouterStrategyContext;
import com.liquidnet.service.galaxy.service.IGalaxyPublishService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyPublishServiceImpl
* @Package com.liquidnet.service.galaxy.service.impl
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 11:28
*/
@Slf4j
@Service
public class GalaxyPublishServiceImpl implements IGalaxyPublishService {
@Autowired
private GalaxyRouterStrategyContext galaxyRouterStrategyContext;
@Override
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) {
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).nftBuy(reqDto);
}
}
package com.liquidnet.service.galaxy.service.impl;
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.dto.*;
import com.liquidnet.common.third.zxlnft.dto.nft.Nft016QueryRsData;
import com.liquidnet.common.third.zxlnft.dto.wallet.CreateMnemonicReq;
import com.liquidnet.common.third.zxlnft.dto.wallet.CreateMnemonicResp;
import com.liquidnet.common.third.zxlnft.dto.wallet.DeriveKeyPairReq;
import com.liquidnet.common.third.zxlnft.dto.wallet.DeriveKeyPairResp;
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.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.dto.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.router.strategy.GalaxyRouterStrategyContext;
import com.liquidnet.service.galaxy.service.IGalaxyUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
......@@ -39,119 +22,10 @@ import java.util.List;
@Service
public class GalaxyUserServiceImpl implements IGalaxyUserService {
@Autowired
private ZxlnftSdkUtil zxlnftSdkUtil;
@Autowired
private ZxlWalletSdkUtil zxlWalletSdkUtil;
@Autowired
private ZxlnftBiz zxlnftBiz;
private GalaxyRouterStrategyContext galaxyRouterStrategyContext;
@Autowired
private ZxlnftConfig zxlnftConfig;
@Override
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
String userId = reqDto.getUserId();
String userName = reqDto.getUserName();
String mobile = reqDto.getMobile();
String idCardType = reqDto.getIdCardType();
String idCard = reqDto.getIdCard();
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 = 0L;
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();
}else{
return ResponseDto.failure(nft003Resp.getCode(),nft003Resp.getMessage());
}
GalaxyUserRegisterRespDto respDto = GalaxyUserRegisterRespDto.getNew();
if(StringUtil.isNotEmpty(userPubKey)&&StringUtil.isNotEmpty(userPriKey)&&StringUtil.isNotEmpty(userIdentification)){
//1.2.2调用授信平台NFT地址绑定接口
Nft014IdentityBindSubmitByTrustedReqDto nft014ReqDto = Nft014IdentityBindSubmitByTrustedReqDto.getNew();
try {
nft014ReqDto.setUserPubKey(BASE64Util.decode(userPubKey));
nft014ReqDto.setUserIdentification(nft003Resp.getData().getUserIdentification());
String signature = zxlnftBiz.createSign(BASE64Util.decode(userPriKey),nft014ReqDto.getUserIdentification());
nft014ReqDto.setUserSignData(signature);
} catch (UnsupportedEncodingException e) {
log.error("公私钥解密错误!");
}
ZxlnftResponseDto<Nft014IdentityBindSubmitByTrustedRespDto> nft014Resp = zxlnftSdkUtil.nft014IdentityBindSubmitByTrusted(nft014ReqDto);
ZxlnftResponseDto<Nft016IdentityBindQueryRespDto> nft016Resp = null;
if(nft014Resp.isSuccess()){
//1.2.3调用绑定状态批量查询
Nft016IdentityBindQueryReqDto nft016ReqDto = Nft016IdentityBindQueryReqDto.getNew();
nft016ReqDto.setAddressList(nft014Resp.getData().getAddress());
nft016Resp = zxlnftSdkUtil.nft016IdentityBindQuery(nft016ReqDto);
}else{
log.info("nft014Resp 返回结果:{}",nft014Resp.toJson());
return ResponseDto.failure(nft014Resp.getCode(),nft014Resp.getMessage());
}
if(StringUtil.isNotNull(nft016Resp)&&nft016Resp.isSuccess()){
List<Nft016QueryRsData> queryRsDataList = nft016Resp.getData().getList();
Nft016QueryRsData queryRsData = queryRsDataList.get(0);
address = queryRsData.getAddress();
log.info("nft016Resp 返回结果:{}",nft016Resp.toJson());
//构造返回参数
respDto.setUserId(userId);
respDto.setBlockChainType(GalaxyConstant.RouterEnum.ZXINCHAIN.getCode());
respDto.setBlockChainAddress(address);
}else{
return ResponseDto.failure(nft016Resp.getMessage());
}
}
return ResponseDto.success(respDto);
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).userRegister(reqDto);
}
}
......@@ -441,7 +441,8 @@ public class TestZxlnftSdkUtil {
//无限制系列 NOW_ZXL_NFT_PIC_skuId002
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_b9b105d186742e44691c540bbacddd1c3a883a49d899b81c5b1a5cf10b4ad4e6");
//第一个系列
reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6");
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6");
reqDto.setSeriesId("111111");
//第二个系列
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_31ff9f7d4c33c98518e095fec6cecdab8d337751602cf6e651eb7d131cff5b61");
ZxlnftResponseDto<Nft032SeriesRespDto> resp = zxlnftSdkUtil.nft032Series(reqDto);
......
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