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

Commit 3fb04d37 authored by anjiabin's avatar anjiabin

调试至信链NFt发行接口

parent 583aabbf
......@@ -7,8 +7,10 @@ import org.springframework.http.*;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLDecoder;
import java.util.List;
import java.util.Map;
......@@ -43,6 +45,18 @@ public class HttpUtil {
return request(url, params, headers, HttpMethod.GET);
}
/**
* get请求 通过uri 解决再次编码问题
* @param url
* @param headers
* @return
*/
public static String getByUri(String url, MultiValueMap<String, String> headers) {
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromHttpUrl(url);
URI uri = uriComponentsBuilder.build(true).toUri();
return request(uri,headers, HttpMethod.GET);
}
/**
* post请求
*
......@@ -240,6 +254,31 @@ public class HttpUtil {
return request(url, params, headers, method, MediaType.APPLICATION_FORM_URLENCODED);
}
/**
* http请求 通过uri
* @param url
* @param headers
* @param method
* @return
*/
public static String request(URI url,MultiValueMap<String, String> headers, HttpMethod method) {
if (url == null) {
return null;
}
// header
HttpHeaders httpHeaders = new HttpHeaders();
if (headers != null) {
httpHeaders.addAll(headers);
}
HttpEntity<Object> httpEntity = new HttpEntity(httpHeaders);
// RestTemplate restTemplate = new RestTemplate();
// 提交方式:表单、json
ResponseEntity<String> response = restTemplate.exchange(url, method, httpEntity, String.class);
return response.getBody();
}
/**
* 表单请求Raw
*
......
......@@ -9,15 +9,19 @@ import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URIBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import java.beans.IntrospectionException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
......@@ -132,32 +136,57 @@ public class ZxlnftBiz {
* @return
*/
public <T> String buildGetRequestUrl(String requestUrl,Class<T> tClass,Object obj){
// List<NameValuePair> params = new ArrayList<NameValuePair>();
// if(StringUtil.isNotEmpty(req.getSeriesName())){
// params.add(new BasicNameValuePair("seriesName", req.getSeriesName()));
//拼接请求url
URI build = null;
// String reqUrl = null;
// try {
// UriComponentsBuilder builder = UriComponentsBuilder
// .fromHttpUrl(requestUrl).queryParams(this.buildGetReqParams(obj));
// reqUrl = builder.build(true).toString();
// }
// params.add(new BasicNameValuePair("platformIdentification", req.getPlatformIdentification()));
// if(StringUtil.isNotEmpty(req.getUserIdentification())){
// params.add(new BasicNameValuePair("userIdentification", req.getUserIdentification()));
// catch (Exception e) {
// e.printStackTrace();
// }
// T reqObj = null;
List<NameValuePair> params = BeanUtil.convertBeanToNameValuePairList(obj);
requestUrl = requestUrl.concat("?");
for(NameValuePair nameValuePair:params){
try {
requestUrl = requestUrl.concat("&"+nameValuePair.getName()+"="+ URLEncoder.encode(nameValuePair.getValue().toString(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
// try {
// reqObj = tClass.newInstance();
// } catch (InstantiationException e) {
// e.printStackTrace();
// } catch (IllegalAccessException e) {
// build = new URIBuilder(requestUrl).addParameters(params).build();
// } catch (URISyntaxException e) {
// e.printStackTrace();
// }
List<NameValuePair> params = BeanUtil.convertBeanToNameValuePairList(obj);
//拼接请求url
URI build = null;
// if(build.toString().contains("%20")){
// return build.toString().replaceAll("%20","+");
// }
return requestUrl;
}
public MultiValueMap<String, String> buildGetReqParams(Object obj){
Map<String,Object> map = null;
try {
build = new URIBuilder(requestUrl).addParameters(params).build();
} catch (URISyntaxException e) {
map = BeanUtil.convertBeanToMap(obj,false);
} catch (IntrospectionException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return build.toString();
MultiValueMap<String, String> params = new LinkedMultiValueMap();
// Map集合循环遍历方式三 推荐,尤其是容量大时
for (Map.Entry<String, Object> m : map.entrySet()) {
params.add(m.getKey(),m.getValue().toString());
}
return params;
}
}
......@@ -2,6 +2,15 @@ package com.liquidnet.common.third.zxlnft.service;
import com.liquidnet.common.third.zxlnft.dto.wallet.*;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: WalletSdkService
* @Package com.liquidnet.common.third.zxlnft.service
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/2/17 15:53
*/
public interface WalletSdkService {
/**
* 1.生成助记词
......
......@@ -836,11 +836,9 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
requestUrl = zxlnftBiz.buildGetRequestUrl(requestUrl,Nft024PointApplyResultReq.class,req);
log.info("nft024PointApplyResult--->>> new request url : {} ",requestUrl);
String response = null;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try {
response = HttpUtil.get(requestUrl,null,commonHeader);
response = HttpUtil.getByUri(requestUrl,commonHeader);
} catch(HttpClientErrorException e) {
log.error("nft024PointApplyResult error", e);
}catch (Exception e) {
......
......@@ -325,10 +325,13 @@ public class ZxlnftSdkUtil {
Nft015IdentityBindPlatformSelfReq req = Nft015IdentityBindPlatformSelfReq.getNew();
BeanUtil.copy(reqDto,req);
Nft015IdentityBindPlatformSelfResp resp = zxlnftSdkService.nft015IdentityBindPlatformSelf(req);
Nft015IdentityBindPlatformSelfRespDto respDto = Nft015IdentityBindPlatformSelfRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft015IdentityBindPlatformSelfResp resp = zxlnftSdkService.nft015IdentityBindPlatformSelf(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -340,10 +343,14 @@ public class ZxlnftSdkUtil {
BeanUtil.copy(reqDto,req);
req.setAddressList(zxlnftConfig.getNftPlatformAddress());
Nft016IdentityBindQueryResp resp = zxlnftSdkService.nft016IdentityBindQuery(req);
Nft016IdentityBindQueryRespDto respDto = Nft016IdentityBindQueryRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft016IdentityBindQueryResp resp = zxlnftSdkService.nft016IdentityBindQuery(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -354,10 +361,13 @@ public class ZxlnftSdkUtil {
Nft017IdentityVerifyIdentityReq req = Nft017IdentityVerifyIdentityReq.getNew();
BeanUtil.copy(reqDto,req);
Nft017IdentityVerifyIdentityResp resp = zxlnftSdkService.nft017IdentityVerifyIdentity(req);
Nft017IdentityVerifyIdentityRespDto respDto = Nft017IdentityVerifyIdentityRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft017IdentityVerifyIdentityResp resp = zxlnftSdkService.nft017IdentityVerifyIdentity(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -368,10 +378,13 @@ public class ZxlnftSdkUtil {
Nft018FaceUrlReq req = Nft018FaceUrlReq.getNew();
BeanUtil.copy(reqDto,req);
Nft018FaceUrlResp resp = zxlnftSdkService.nft018FaceUrl(req);
Nft018FaceUrlRespDto respDto = Nft018FaceUrlRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft018FaceUrlResp resp = zxlnftSdkService.nft018FaceUrl(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -382,10 +395,13 @@ public class ZxlnftSdkUtil {
Nft019FaceUrlByAddressReq req = Nft019FaceUrlByAddressReq.getNew();
BeanUtil.copy(reqDto,req);
Nft019FaceUrlByAddressResp resp = zxlnftSdkService.nft019FaceUrlByAddress(req);
Nft019FaceUrlByAddressRespDto respDto = Nft019FaceUrlByAddressRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft019FaceUrlByAddressResp resp = zxlnftSdkService.nft019FaceUrlByAddress(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -396,10 +412,13 @@ public class ZxlnftSdkUtil {
Nft020FaceQueryReq req = Nft020FaceQueryReq.getNew();
BeanUtil.copy(reqDto,req);
Nft020FaceQueryResp resp = zxlnftSdkService.nft020FaceQuery(req);
Nft020FaceQueryRespDto respDto = Nft020FaceQueryRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft020FaceQueryResp resp = zxlnftSdkService.nft020FaceQuery(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -410,10 +429,13 @@ public class ZxlnftSdkUtil {
Nft021UploadUrlReq req = Nft021UploadUrlReq.getNew();
BeanUtil.copy(reqDto,req);
Nft021UploadUrlResp resp = zxlnftSdkService.nft021UploadUrl(req);
Nft021UploadUrlRespDto respDto = Nft021UploadUrlRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft021UploadUrlResp resp = zxlnftSdkService.nft021UploadUrl(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -424,10 +446,13 @@ public class ZxlnftSdkUtil {
Nft022UploadSecretReq req = Nft022UploadSecretReq.getNew();
BeanUtil.copy(reqDto,req);
Nft022UploadSecretResp resp = zxlnftSdkService.nft022UploadSecret(req);
Nft022UploadSecretRespDto respDto = Nft022UploadSecretRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft022UploadSecretResp resp = zxlnftSdkService.nft022UploadSecret(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -450,10 +475,13 @@ public class ZxlnftSdkUtil {
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),signMetaData);
req.setPlatformSignature(signature);
Nft023PointApplyResp resp = zxlnftSdkService.nft023PointApply(req);
Nft023PointApplyRespDto respDto = Nft023PointApplyRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft023PointApplyResp resp = zxlnftSdkService.nft023PointApply(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -467,10 +495,13 @@ public class ZxlnftSdkUtil {
//设置平台公钥
req.setPlatformPubKey(zxlnftConfig.getNftPlatformPubKey());
Nft024PointApplyResultResp resp = zxlnftSdkService.nft024PointApplyResult(req);
Nft024PointApplyResultRespDto respDto = Nft024PointApplyResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft024PointApplyResultResp resp = zxlnftSdkService.nft024PointApplyResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -481,10 +512,13 @@ public class ZxlnftSdkUtil {
Nft025PointTransferReq req = Nft025PointTransferReq.getNew();
BeanUtil.copy(reqDto,req);
Nft025PointTransferResp resp = zxlnftSdkService.nft025PointTransfer(req);
Nft025PointTransferRespDto respDto = Nft025PointTransferRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft025PointTransferResp resp = zxlnftSdkService.nft025PointTransfer(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -495,10 +529,13 @@ public class ZxlnftSdkUtil {
Nft026PointTransferResultReq req = Nft026PointTransferResultReq.getNew();
BeanUtil.copy(reqDto,req);
Nft026PointTransferResultResp resp = zxlnftSdkService.nft026PointTransferResult(req);
Nft026PointTransferResultRespDto respDto = Nft026PointTransferResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft026PointTransferResultResp resp = zxlnftSdkService.nft026PointTransferResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -509,10 +546,13 @@ public class ZxlnftSdkUtil {
Nft027PointDestroyReq req = Nft027PointDestroyReq.getNew();
BeanUtil.copy(reqDto,req);
Nft027PointDestroyResp resp = zxlnftSdkService.nft027PointDestroy(req);
Nft027PointDestroyRespDto respDto = Nft027PointDestroyRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft027PointDestroyResp resp = zxlnftSdkService.nft027PointDestroy(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -523,10 +563,13 @@ public class ZxlnftSdkUtil {
Nft028PointDestoryResultReq req = Nft028PointDestoryResultReq.getNew();
BeanUtil.copy(reqDto,req);
Nft028PointDestoryResultResp resp = zxlnftSdkService.nft028PointDestoryResult(req);
Nft028PointDestoryResultRespDto respDto = Nft028PointDestoryResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft028PointDestoryResultResp resp = zxlnftSdkService.nft028PointDestoryResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -540,10 +583,13 @@ public class ZxlnftSdkUtil {
//平台地址
req.setPlatformAddr(zxlnftConfig.getNftPlatformAddress());
Nft029PointQueryResp resp = zxlnftSdkService.nft029PointQuery(req);
Nft029PointQueryRespDto respDto = Nft029PointQueryRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft029PointQueryResp resp = zxlnftSdkService.nft029PointQuery(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -554,10 +600,13 @@ public class ZxlnftSdkUtil {
Nft030SeriesClaimReq req = Nft030SeriesClaimReq.getNew();
BeanUtil.copy(reqDto,req);
Nft030SeriesClaimResp resp = zxlnftSdkService.nft030SeriesClaim(req);
Nft030SeriesClaimRespDto respDto = Nft030SeriesClaimRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft030SeriesClaimResp resp = zxlnftSdkService.nft030SeriesClaim(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -568,10 +617,13 @@ public class ZxlnftSdkUtil {
Nft031SeriesClaimResultReq req = Nft031SeriesClaimResultReq.getNew();
BeanUtil.copy(reqDto,req);
Nft031SeriesClaimResultResp resp = zxlnftSdkService.nft031SeriesClaimResult(req);
Nft031SeriesClaimResultRespDto respDto = Nft031SeriesClaimResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft031SeriesClaimResultResp resp = zxlnftSdkService.nft031SeriesClaimResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -582,10 +634,13 @@ public class ZxlnftSdkUtil {
Nft032SeriesReq req = Nft032SeriesReq.getNew();
BeanUtil.copy(reqDto,req);
Nft032SeriesResp resp = zxlnftSdkService.nft032Series(req);
Nft032SeriesRespDto respDto = Nft032SeriesRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft032SeriesResp resp = zxlnftSdkService.nft032Series(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -596,10 +651,13 @@ public class ZxlnftSdkUtil {
Nft033SeriesListReq req = Nft033SeriesListReq.getNew();
BeanUtil.copy(reqDto,req);
Nft033SeriesListResp resp = zxlnftSdkService.nft033SeriesList(req);
Nft033SeriesListRespDto respDto = Nft033SeriesListRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft033SeriesListResp resp = zxlnftSdkService.nft033SeriesList(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -635,10 +693,14 @@ public class ZxlnftSdkUtil {
String platformSignature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),signMetaData);
req.setPlatformSignature(platformSignature);
Nft034PublishResp resp = zxlnftSdkService.nft034Publish(req);
Nft034PublishRespDto respDto = Nft034PublishRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft034PublishResp resp = zxlnftSdkService.nft034Publish(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -648,11 +710,16 @@ public class ZxlnftSdkUtil {
*/
Nft035PublishResultReq req = Nft035PublishResultReq.getNew();
BeanUtil.copy(reqDto,req);
Nft035PublishResultResp resp = zxlnftSdkService.nft035PublishResult(req);
//设置平台公钥
req.setPlatformPubKey(zxlnftConfig.getNftPlatformPubKey());
Nft035PublishResultRespDto respDto = Nft035PublishResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft035PublishResultResp resp = zxlnftSdkService.nft035PublishResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -663,10 +730,13 @@ public class ZxlnftSdkUtil {
Nft036InfoReq req = Nft036InfoReq.getNew();
BeanUtil.copy(reqDto,req);
Nft036InfoResp resp = zxlnftSdkService.nft036Info(req);
Nft036InfoRespDto respDto = Nft036InfoRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft036InfoResp resp = zxlnftSdkService.nft036Info(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -677,10 +747,13 @@ public class ZxlnftSdkUtil {
Nft037AddressListReq req = Nft037AddressListReq.getNew();
BeanUtil.copy(reqDto,req);
Nft037AddressListResp resp = zxlnftSdkService.nft037AddressList(req);
Nft037AddressListRespDto respDto = Nft037AddressListRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft037AddressListResp resp = zxlnftSdkService.nft037AddressList(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -691,10 +764,13 @@ public class ZxlnftSdkUtil {
Nft038AddressWithoutSeriesListReq req = Nft038AddressWithoutSeriesListReq.getNew();
BeanUtil.copy(reqDto,req);
Nft038AddressWithoutSeriesListResp resp = zxlnftSdkService.nft038AddressWithoutSeriesList(req);
Nft038AddressWithoutSeriesListRespDto respDto = Nft038AddressWithoutSeriesListRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft038AddressWithoutSeriesListResp resp = zxlnftSdkService.nft038AddressWithoutSeriesList(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -705,10 +781,13 @@ public class ZxlnftSdkUtil {
Nft039TradeListReq req = Nft039TradeListReq.getNew();
BeanUtil.copy(reqDto,req);
Nft039TradeListResp resp = zxlnftSdkService.nft039TradeList(req);
Nft039TradeListRespDto respDto = Nft039TradeListRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft039TradeListResp resp = zxlnftSdkService.nft039TradeList(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -719,10 +798,13 @@ public class ZxlnftSdkUtil {
Nft040TradeInListReq req = Nft040TradeInListReq.getNew();
BeanUtil.copy(reqDto,req);
Nft040TradeInListResp resp = zxlnftSdkService.nft040TradeInList(req);
Nft040TradeInListRespDto respDto = Nft040TradeInListRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft040TradeInListResp resp = zxlnftSdkService.nft040TradeInList(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -733,10 +815,13 @@ public class ZxlnftSdkUtil {
Nft041TradeOutListReq req = Nft041TradeOutListReq.getNew();
BeanUtil.copy(reqDto,req);
Nft041TradeOutListResp resp = zxlnftSdkService.nft041TradeOutList(req);
Nft041TradeOutListRespDto respDto = Nft041TradeOutListRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft041TradeOutListResp resp = zxlnftSdkService.nft041TradeOutList(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -747,10 +832,13 @@ public class ZxlnftSdkUtil {
Nft042TradeAllListReq req = Nft042TradeAllListReq.getNew();
BeanUtil.copy(reqDto,req);
Nft042TradeAllListResp resp = zxlnftSdkService.nft042TradeAllList(req);
Nft042TradeAllListRespDto respDto = Nft042TradeAllListRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft042TradeAllListResp resp = zxlnftSdkService.nft042TradeAllList(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -761,10 +849,13 @@ public class ZxlnftSdkUtil {
Nft043BuyReq req = Nft043BuyReq.getNew();
BeanUtil.copy(reqDto,req);
Nft043BuyResp resp = zxlnftSdkService.nft043Buy(req);
Nft043BuyRespDto respDto = Nft043BuyRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft043BuyResp resp = zxlnftSdkService.nft043Buy(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -775,10 +866,13 @@ public class ZxlnftSdkUtil {
Nft044BuyResultReq req = Nft044BuyResultReq.getNew();
BeanUtil.copy(reqDto,req);
Nft044BuyResultResp resp = zxlnftSdkService.nft044BuyResult(req);
Nft044BuyResultRespDto respDto = Nft044BuyResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft044BuyResultResp resp = zxlnftSdkService.nft044BuyResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -789,10 +883,13 @@ public class ZxlnftSdkUtil {
Nft045BuyPayResultReq req = Nft045BuyPayResultReq.getNew();
BeanUtil.copy(reqDto,req);
Nft045BuyPayResultResp resp = zxlnftSdkService.nft045BuyPayResult(req);
Nft045BuyPayResultRespDto respDto = Nft045BuyPayResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft045BuyPayResultResp resp = zxlnftSdkService.nft045BuyPayResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -803,10 +900,13 @@ public class ZxlnftSdkUtil {
Nft046TransferReq req = Nft046TransferReq.getNew();
BeanUtil.copy(reqDto,req);
Nft046TransferResp resp = zxlnftSdkService.nft046Transfer(req);
Nft046TransferRespDto respDto = Nft046TransferRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft046TransferResp resp = zxlnftSdkService.nft046Transfer(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -817,10 +917,13 @@ public class ZxlnftSdkUtil {
Nft047SelfTransferReq req = Nft047SelfTransferReq.getNew();
BeanUtil.copy(reqDto,req);
Nft047SelfTransferResp resp = zxlnftSdkService.nft047SelfTransfer(req);
Nft047SelfTransferRespDto respDto = Nft047SelfTransferRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft047SelfTransferResp resp = zxlnftSdkService.nft047SelfTransfer(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -831,10 +934,13 @@ public class ZxlnftSdkUtil {
Nft048BatchTransferReq req = Nft048BatchTransferReq.getNew();
BeanUtil.copy(reqDto,req);
Nft048BatchTransferResp resp = zxlnftSdkService.nft048BatchTransfer(req);
Nft048BatchTransferRespDto respDto = Nft048BatchTransferRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft048BatchTransferResp resp = zxlnftSdkService.nft048BatchTransfer(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -845,10 +951,13 @@ public class ZxlnftSdkUtil {
Nft049TransferResultReq req = Nft049TransferResultReq.getNew();
BeanUtil.copy(reqDto,req);
Nft049TransferResultResp resp = zxlnftSdkService.nft049TransferResult(req);
Nft049TransferResultRespDto respDto = Nft049TransferResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft049TransferResultResp resp = zxlnftSdkService.nft049TransferResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -859,10 +968,13 @@ public class ZxlnftSdkUtil {
Nft050StatusUpdateReq req = Nft050StatusUpdateReq.getNew();
BeanUtil.copy(reqDto,req);
Nft050StatusUpdateResp resp = zxlnftSdkService.nft050StatusUpdate(req);
Nft050StatusUpdateRespDto respDto = Nft050StatusUpdateRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft050StatusUpdateResp resp = zxlnftSdkService.nft050StatusUpdate(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -873,10 +985,13 @@ public class ZxlnftSdkUtil {
Nft051StatusUpdateResultReq req = Nft051StatusUpdateResultReq.getNew();
BeanUtil.copy(reqDto,req);
Nft051StatusUpdateResultResp resp = zxlnftSdkService.nft051StatusUpdateResult(req);
Nft051StatusUpdateResultRespDto respDto = Nft051StatusUpdateResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft051StatusUpdateResultResp resp = zxlnftSdkService.nft051StatusUpdateResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -887,10 +1002,13 @@ public class ZxlnftSdkUtil {
Nft052PriceUpdateReq req = Nft052PriceUpdateReq.getNew();
BeanUtil.copy(reqDto,req);
Nft052PriceUpdateResp resp = zxlnftSdkService.nft052PriceUpdate(req);
Nft052PriceUpdateRespDto respDto = Nft052PriceUpdateRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft052PriceUpdateResp resp = zxlnftSdkService.nft052PriceUpdate(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -901,10 +1019,13 @@ public class ZxlnftSdkUtil {
Nft053PriceUpdateResultReq req = Nft053PriceUpdateResultReq.getNew();
BeanUtil.copy(reqDto,req);
Nft053PriceUpdateResultResp resp = zxlnftSdkService.nft053PriceUpdateResult(req);
Nft053PriceUpdateResultRespDto respDto = Nft053PriceUpdateResultRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft053PriceUpdateResultResp resp = zxlnftSdkService.nft053PriceUpdateResult(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
......@@ -915,10 +1036,13 @@ public class ZxlnftSdkUtil {
Nft054QueryUserAddressBelongToUserReq req = Nft054QueryUserAddressBelongToUserReq.getNew();
BeanUtil.copy(reqDto,req);
Nft054QueryUserAddressBelongToUserResp resp = zxlnftSdkService.nft054QueryUserAddressBelongToUser(req);
Nft054QueryUserAddressBelongToUserRespDto respDto = Nft054QueryUserAddressBelongToUserRespDto.getNew();
BeanUtil.copy(resp,respDto);
try{
Nft054QueryUserAddressBelongToUserResp resp = zxlnftSdkService.nft054QueryUserAddressBelongToUser(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto);
}
}
......@@ -307,7 +307,10 @@ public class TestZxlnftSdkUtil {
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 nft034Publish(){
Nft034PublishReqDto reqDto = Nft034PublishReqDto.getNew();
......@@ -328,4 +331,12 @@ public class TestZxlnftSdkUtil {
ZxlnftResponseDto<Nft034PublishRespDto> resp = zxlnftSdkUtil.nft034Publish(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft035PublishResult(){
Nft035PublishResultReqDto reqDto = Nft035PublishResultReqDto.getNew();
reqDto.setTaskId("5d23ed47-dcb2-4672-99eb-060c04727a20_nft-publish_3");
ZxlnftResponseDto<Nft035PublishResultRespDto> resp = zxlnftSdkUtil.nft035PublishResult(reqDto);
System.out.println(resp.toJson());
}
}
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