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

Commit ce7d5f6d authored by anjiabin's avatar anjiabin

实现zxtnft购买功能

parent 6eccf385
package com.liquidnet.common.third.zxlnft.dto;
import com.liquidnet.common.third.zxlnft.dto.nft.Nft016QueryRsData;
import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
......@@ -15,21 +17,8 @@ import java.util.List;
* @date 2022/2/18 15:32
*/
@Data
public class Nft016IdentityBindQueryRespDto {
private List<queryRsData> list;
@Data
public static class queryRsData{
/**
* 地址
*/
private String address;
/**
* 1:绑定中 2:已绑定 3:绑定失败 4:未发起过绑定(未查询到)
*/
private String status;
}
public class Nft016IdentityBindQueryRespDto implements Serializable,Cloneable {
private List<Nft016QueryRsData> list;
private static final Nft016IdentityBindQueryRespDto obj = new Nft016IdentityBindQueryRespDto();
public static Nft016IdentityBindQueryRespDto getNew() {
......
......@@ -3,6 +3,7 @@ package com.liquidnet.common.third.zxlnft.dto.nft;
import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
......@@ -15,21 +16,8 @@ import java.util.List;
* @date 2022/2/18 15:32
*/
@Data
public class Nft016IdentityBindQueryResp{
private List<queryRsData> list;
@Data
public static class queryRsData{
/**
* 地址
*/
private String address;
/**
* 1:绑定中 2:已绑定 3:绑定失败 4:未发起过绑定(未查询到)
*/
private String status;
}
public class Nft016IdentityBindQueryResp implements Serializable,Cloneable {
private List<Nft016QueryRsData> list;
private static final Nft016IdentityBindQueryResp obj = new Nft016IdentityBindQueryResp();
public static Nft016IdentityBindQueryResp getNew() {
......
package com.liquidnet.common.third.zxlnft.dto.nft;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: Nft016QueryRsData
* @Package com.liquidnet.common.third.zxlnft.dto.nft
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/11 23:28
*/
@Data
public class Nft016QueryRsData {
/**
* 地址
*/
private String address;
/**
* 1:绑定中 2:已绑定 3:绑定失败 4:未发起过绑定(未查询到)
*/
private String status;
}
......@@ -195,7 +195,7 @@ public class GalaxyRequestLogAspect {
@AfterReturning(value = "requestServer()",returning = "rtv")
public void AfterReturning(JoinPoint joinPoint, Object rtv){
log.info("before return+++++++++++++++++++++++++++");
log.info("responseBody:"+JSON.toJSONString(rtv,SerializerFeature.WriteMapNullValue));
log.info("responseBody:"+ JSON.toJSONString(rtv, SerializerFeature.WriteMapNullValue));
log.info("end return++++++++++++++++++++++++++++++++");
}
......
......@@ -4,6 +4,9 @@ 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;
......@@ -21,6 +24,7 @@ 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>
......@@ -61,14 +65,14 @@ public class GalaxyUserServiceImpl implements IGalaxyUserService {
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(),"生成助记词失败!");
// }
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
......@@ -131,16 +135,19 @@ public class GalaxyUserServiceImpl implements IGalaxyUserService {
nft016ReqDto.setAddressList(nft014Resp.getData().getAddress());
nft016Resp = zxlnftSdkUtil.nft016IdentityBindQuery(nft016ReqDto);
}else{
log.info("返回结果:{}",nft014Resp.toJson());
log.info("nft014Resp 返回结果:{}",nft014Resp.toJson());
return ResponseDto.failure(nft014Resp.getCode(),nft014Resp.getMessage());
}
if(StringUtil.isNotNull(nft016Resp)&&nft016Resp.isSuccess()){
log.info("返回结果:{}",nft016Resp.toJson());
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(nft016Resp.getData().getList().get(0).getAddress());
respDto.setBlockChainAddress(address);
}else{
return ResponseDto.failure(nft016Resp.getMessage());
}
......
......@@ -233,9 +233,14 @@ public class TestZxlnftSdkUtil {
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),reqDto.getUserIdentification());
//周焕
reqDto.setUserPubKey(zhouhuanPubKey1);
reqDto.setUserIdentification("0354415fabf861ecde70db198836bf82af025820ea50f66c05589e21b6d9700f");
signature = zxlnftBiz.createSign(zhouhuanPriKey1,reqDto.getUserIdentification());
// reqDto.setUserPubKey(zhouhuanPubKey1);
// reqDto.setUserIdentification("0354415fabf861ecde70db198836bf82af025820ea50f66c05589e21b6d9700f");
// signature = zxlnftBiz.createSign(zhouhuanPriKey1,reqDto.getUserIdentification());
reqDto.setUserPubKey(zxlnftConfig.getNftPlatformPubKey());
reqDto.setUserIdentification("68c8e0af922c450e35316977548971a1e5c335b1f5a4e21133257f0749b5c0a2");
signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),reqDto.getUserIdentification());
reqDto.setUserSignData(signature);
ZxlnftResponseDto<Nft014IdentityBindSubmitByTrustedRespDto> resp = zxlnftSdkUtil.nft014IdentityBindSubmitByTrusted(reqDto);
......
......@@ -5,10 +5,7 @@ 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.dto.wallet.*;
import com.liquidnet.common.third.zxlnft.exception.ZxlNftException;
import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil;
import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
......@@ -89,14 +86,14 @@ public class TestZxlnftService {
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(),"生成助记词失败!");
// }
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
......
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