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

Commit 3e8e99b1 authored by anjiabin's avatar anjiabin

调试至信链NFt购买接口

parent b93c122c
package com.liquidnet.common.third.zxlnft.dto;
import com.liquidnet.common.third.zxlnft.dto.nft.Nft032SeriesResp;
import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data;
......@@ -16,42 +17,47 @@ import java.io.Serializable;
*/
@Data
public class Nft032SeriesRespDto implements Serializable {
/**
* 系列ID
*/
private String seriesId;
/**
* 系列名字
*/
private String name;
/**
* 创建者地址
*/
private String creatorAddr;
/**
* 总数
*/
private String totalCount;
/**
* 系列下的nftId后缀,是否从0开始,true就是从0开始,默认为false,从1开始
*/
private String seriesBeginFromZero;
/**
* 当前个数(当前已发行此系列的个数)
*/
private String crtCount;
/**
* 封面图
*/
private String coverUrl;
/**
* 描述
*/
private String desc;
/**
* 创建时间戳
*/
private String createTimeStamp;
private Nft032SeriesResp.SeriesInfo seriesInfo;
@Data
public class SeriesInfo{
/**
* 系列ID
*/
private String seriesId;
/**
* 系列名字
*/
private String name;
/**
* 创建者地址
*/
private String creatorAddr;
/**
* 总数
*/
private String totalCount;
/**
* 系列下的nftId后缀,是否从0开始,true就是从0开始,默认为false,从1开始
*/
private String seriesBeginFromZero;
/**
* 当前个数(当前已发行此系列的个数)
*/
private String crtCount;
/**
* 封面图
*/
private String coverUrl;
/**
* 描述
*/
private String desc;
/**
* 创建时间戳
*/
private String createTimeStamp;
}
private static final Nft032SeriesRespDto obj = new Nft032SeriesRespDto();
public static Nft032SeriesRespDto getNew() {
......
......@@ -16,42 +16,47 @@ import java.io.Serializable;
*/
@Data
public class Nft032SeriesResp implements Serializable {
/**
* 系列ID
*/
private String seriesId;
/**
* 系列名字
*/
private String name;
/**
* 创建者地址
*/
private String creatorAddr;
/**
* 总数
*/
private String totalCount;
/**
* 系列下的nftId后缀,是否从0开始,true就是从0开始,默认为false,从1开始
*/
private String seriesBeginFromZero;
/**
* 当前个数(当前已发行此系列的个数)
*/
private String crtCount;
/**
* 封面图
*/
private String coverUrl;
/**
* 描述
*/
private String desc;
/**
* 创建时间戳
*/
private String createTimeStamp;
private SeriesInfo seriesInfo;
@Data
public class SeriesInfo{
/**
* 系列ID
*/
private String seriesId;
/**
* 系列名字
*/
private String name;
/**
* 创建者地址
*/
private String creatorAddr;
/**
* 总数
*/
private String totalCount;
/**
* 系列下的nftId后缀,是否从0开始,true就是从0开始,默认为false,从1开始
*/
private String seriesBeginFromZero;
/**
* 当前个数(当前已发行此系列的个数)
*/
private String crtCount;
/**
* 封面图
*/
private String coverUrl;
/**
* 描述
*/
private String desc;
/**
* 创建时间戳
*/
private String createTimeStamp;
}
private static final Nft032SeriesResp obj = new Nft032SeriesResp();
public static Nft032SeriesResp getNew() {
......
......@@ -49,7 +49,7 @@ public class Nft043BuyReq implements Serializable {
*/
private String signature;
/**
* 要购买的nftId
* 平台方的私钥签名
*/
private String platformSignature;
private static final Nft043BuyReq obj = new Nft043BuyReq();
......
......@@ -891,6 +891,24 @@ public class ZxlnftSdkUtil {
Nft043BuyReq req = Nft043BuyReq.getNew();
BeanUtil.copy(reqDto,req);
//设置平台公钥
req.setPlatformPubKey(zxlnftConfig.getNftPlatformPubKey());
/**
* 接收人的私钥签名,签名对象是(platformPubKey_receiverPubKey_pointReceiverAddr_applyScore_接口名_nftId_offerCount_operateId)
* 接口名:buy_nft
*/
String signMetaData = req.getPlatformPubKey()
.concat("_").concat(req.getReceiverPubKey())
.concat("_").concat(req.getPointReceiverAddr())
.concat("_").concat(req.getApplyScore().toString())
.concat("_").concat("buy_nft")
.concat("_").concat(req.getNftId())
.concat("_").concat(req.getOfferCount().toString())
.concat("_").concat(req.getOperateId());
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),signMetaData);
req.setPlatformSignature(signature);
Nft043BuyRespDto respDto = Nft043BuyRespDto.getNew();
try{
Nft043BuyResp resp = zxlnftSdkService.nft043Buy(req);
......@@ -908,6 +926,9 @@ public class ZxlnftSdkUtil {
Nft044BuyResultReq req = Nft044BuyResultReq.getNew();
BeanUtil.copy(reqDto,req);
//设置平台公钥
req.setPlatformPubKey(zxlnftConfig.getNftPlatformPubKey());
Nft044BuyResultRespDto respDto = Nft044BuyResultRespDto.getNew();
try{
Nft044BuyResultResp resp = zxlnftSdkService.nft044BuyResult(req);
......@@ -925,6 +946,9 @@ public class ZxlnftSdkUtil {
Nft045BuyPayResultReq req = Nft045BuyPayResultReq.getNew();
BeanUtil.copy(reqDto,req);
//设置平台公钥
req.setPlatformPubKey(zxlnftConfig.getNftPlatformPubKey());
Nft045BuyPayResultRespDto respDto = Nft045BuyPayResultRespDto.getNew();
try{
Nft045BuyPayResultResp resp = zxlnftSdkService.nft045BuyPayResult(req);
......
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