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

Commit b17d8e33 authored by anjiabin's avatar anjiabin

调试至信链NFt发行接口

parent ff5de416
...@@ -202,10 +202,13 @@ public class ZxlnftSdkUtil { ...@@ -202,10 +202,13 @@ public class ZxlnftSdkUtil {
Nft009RegisterCompanyReq req = Nft009RegisterCompanyReq.getNew(); Nft009RegisterCompanyReq req = Nft009RegisterCompanyReq.getNew();
BeanUtil.copy(reqDto,req); BeanUtil.copy(reqDto,req);
Nft009RegisterCompanyResp resp = zxlnftSdkService.nft009RegisterCompany(req);
Nft009RegisterCompanyRespDto respDto = Nft009RegisterCompanyRespDto.getNew(); Nft009RegisterCompanyRespDto respDto = Nft009RegisterCompanyRespDto.getNew();
BeanUtil.copy(resp,respDto); try{
Nft009RegisterCompanyResp resp = zxlnftSdkService.nft009RegisterCompany(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto); return ZxlnftResponseDto.success(respDto);
} }
...@@ -216,10 +219,26 @@ public class ZxlnftSdkUtil { ...@@ -216,10 +219,26 @@ public class ZxlnftSdkUtil {
Nft010RegisterCompanyPlatformReq req = Nft010RegisterCompanyPlatformReq.getNew(); Nft010RegisterCompanyPlatformReq req = Nft010RegisterCompanyPlatformReq.getNew();
BeanUtil.copy(reqDto,req); BeanUtil.copy(reqDto,req);
Nft010RegisterCompanyPlatformResp resp = zxlnftSdkService.nft010RegisterCompanyPlatform(req); req.setPlatformPubKey(zxlnftConfig.getNftPlatformPubKey());
/**
* 平台签名信息:sign(epName_creditCode_representativeName_contact_mobile_idcard)
*/
String signMetaData = req.getEpName()
.concat("_").concat(req.getCreditCode())
.concat("_").concat(req.getRepresentativeName())
.concat("_").concat(req.getContact())
.concat("_").concat(req.getMobile())
.concat("_").concat(req.getIdcard());
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),signMetaData);
req.setPlatformSignData(signature);
Nft010RegisterCompanyPlatformRespDto respDto = Nft010RegisterCompanyPlatformRespDto.getNew(); Nft010RegisterCompanyPlatformRespDto respDto = Nft010RegisterCompanyPlatformRespDto.getNew();
BeanUtil.copy(resp,respDto); try{
Nft010RegisterCompanyPlatformResp resp = zxlnftSdkService.nft010RegisterCompanyPlatform(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto); return ZxlnftResponseDto.success(respDto);
} }
...@@ -230,10 +249,13 @@ public class ZxlnftSdkUtil { ...@@ -230,10 +249,13 @@ public class ZxlnftSdkUtil {
Nft011UserQueryVerifyCodeReq req = Nft011UserQueryVerifyCodeReq.getNew(); Nft011UserQueryVerifyCodeReq req = Nft011UserQueryVerifyCodeReq.getNew();
BeanUtil.copy(reqDto,req); BeanUtil.copy(reqDto,req);
Nft011UserQueryVerifyCodeResp resp = zxlnftSdkService.nft011UserQueryVerifyCode(req);
Nft011UserQueryVerifyCodeRespDto respDto = Nft011UserQueryVerifyCodeRespDto.getNew(); Nft011UserQueryVerifyCodeRespDto respDto = Nft011UserQueryVerifyCodeRespDto.getNew();
BeanUtil.copy(resp,respDto); try{
Nft011UserQueryVerifyCodeResp resp = zxlnftSdkService.nft011UserQueryVerifyCode(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto); return ZxlnftResponseDto.success(respDto);
} }
...@@ -244,10 +266,13 @@ public class ZxlnftSdkUtil { ...@@ -244,10 +266,13 @@ public class ZxlnftSdkUtil {
Nft012UserQueryReq req = Nft012UserQueryReq.getNew(); Nft012UserQueryReq req = Nft012UserQueryReq.getNew();
BeanUtil.copy(reqDto,req); BeanUtil.copy(reqDto,req);
Nft012UserQueryResp resp = zxlnftSdkService.nft012UserQuery(req);
Nft012UserQueryRespDto respDto = Nft012UserQueryRespDto.getNew(); Nft012UserQueryRespDto respDto = Nft012UserQueryRespDto.getNew();
BeanUtil.copy(resp,respDto); try{
Nft012UserQueryResp resp = zxlnftSdkService.nft012UserQuery(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto); return ZxlnftResponseDto.success(respDto);
} }
...@@ -258,10 +283,13 @@ public class ZxlnftSdkUtil { ...@@ -258,10 +283,13 @@ public class ZxlnftSdkUtil {
Nft013IdentityBindSubmitReq req = Nft013IdentityBindSubmitReq.getNew(); Nft013IdentityBindSubmitReq req = Nft013IdentityBindSubmitReq.getNew();
BeanUtil.copy(reqDto,req); BeanUtil.copy(reqDto,req);
Nft013IdentityBindSubmitResp resp = zxlnftSdkService.nft013IdentityBindSubmit(req);
Nft013IdentityBindSubmitRespDto respDto = Nft013IdentityBindSubmitRespDto.getNew(); Nft013IdentityBindSubmitRespDto respDto = Nft013IdentityBindSubmitRespDto.getNew();
BeanUtil.copy(resp,respDto); try{
Nft013IdentityBindSubmitResp resp = zxlnftSdkService.nft013IdentityBindSubmit(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto); return ZxlnftResponseDto.success(respDto);
} }
...@@ -272,10 +300,21 @@ public class ZxlnftSdkUtil { ...@@ -272,10 +300,21 @@ public class ZxlnftSdkUtil {
Nft014IdentityBindSubmitByTrustedReq req = Nft014IdentityBindSubmitByTrustedReq.getNew(); Nft014IdentityBindSubmitByTrustedReq req = Nft014IdentityBindSubmitByTrustedReq.getNew();
BeanUtil.copy(reqDto,req); BeanUtil.copy(reqDto,req);
Nft014IdentityBindSubmitByTrustedResp resp = zxlnftSdkService.nft014IdentityBindSubmitByTrusted(req); req.setPlatformPubKey(zxlnftConfig.getNftPlatformPubKey());
/**
* 平台签名信息:sign(epName_creditCode_representativeName_contact_mobile_idcard)
*/
String signMetaData = req.getUserSignData();
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),signMetaData);
req.setPlatformSignData(signature);
Nft014IdentityBindSubmitByTrustedRespDto respDto = Nft014IdentityBindSubmitByTrustedRespDto.getNew(); Nft014IdentityBindSubmitByTrustedRespDto respDto = Nft014IdentityBindSubmitByTrustedRespDto.getNew();
BeanUtil.copy(resp,respDto); try{
Nft014IdentityBindSubmitByTrustedResp resp = zxlnftSdkService.nft014IdentityBindSubmitByTrusted(req);
BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}
return ZxlnftResponseDto.success(respDto); return ZxlnftResponseDto.success(respDto);
} }
...@@ -399,6 +438,18 @@ public class ZxlnftSdkUtil { ...@@ -399,6 +438,18 @@ public class ZxlnftSdkUtil {
Nft023PointApplyReq req = Nft023PointApplyReq.getNew(); Nft023PointApplyReq req = Nft023PointApplyReq.getNew();
BeanUtil.copy(reqDto,req); BeanUtil.copy(reqDto,req);
req.setPlatformPubKey(zxlnftConfig.getNftPlatformPubKey());
/**
* 平台签名信息:sign(epName_creditCode_representativeName_contact_mobile_idcard)
*/
String signMetaData = req.getPlatformPubKey()
.concat("_").concat(req.getApplyerAddr())
.concat("_").concat("apply_point")
.concat("_").concat(req.getCount().toString())
.concat("_").concat(req.getOperateId());
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),signMetaData);
req.setPlatformSignature(signature);
Nft023PointApplyResp resp = zxlnftSdkService.nft023PointApply(req); Nft023PointApplyResp resp = zxlnftSdkService.nft023PointApply(req);
Nft023PointApplyRespDto respDto = Nft023PointApplyRespDto.getNew(); Nft023PointApplyRespDto respDto = Nft023PointApplyRespDto.getNew();
...@@ -413,6 +464,9 @@ public class ZxlnftSdkUtil { ...@@ -413,6 +464,9 @@ public class ZxlnftSdkUtil {
Nft024PointApplyResultReq req = Nft024PointApplyResultReq.getNew(); Nft024PointApplyResultReq req = Nft024PointApplyResultReq.getNew();
BeanUtil.copy(reqDto,req); BeanUtil.copy(reqDto,req);
//设置平台公钥
req.setPlatformPubKey(zxlnftConfig.getNftPlatformPubKey());
Nft024PointApplyResultResp resp = zxlnftSdkService.nft024PointApplyResult(req); Nft024PointApplyResultResp resp = zxlnftSdkService.nft024PointApplyResult(req);
Nft024PointApplyResultRespDto respDto = Nft024PointApplyResultRespDto.getNew(); Nft024PointApplyResultRespDto respDto = Nft024PointApplyResultRespDto.getNew();
......
...@@ -111,14 +111,137 @@ public class TestZxlnftSdkUtil { ...@@ -111,14 +111,137 @@ public class TestZxlnftSdkUtil {
System.out.println(resp.toJson()); System.out.println(resp.toJson());
} }
@Test
public void nft008QueryImageModeration(){
Nft008QueryImageModerationReqDto reqDto = Nft008QueryImageModerationReqDto.getNew();
reqDto.setImageUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
// reqDto.setIntrval(0);
// reqDto.setMaxFrames(1);
ZxlnftResponseDto<Nft008QueryImageModerationRespDto> resp = zxlnftSdkUtil.nft008QueryImageModeration(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft009RegisterCompany(){
Nft009RegisterCompanyReqDto reqDto = Nft009RegisterCompanyReqDto.getNew();
reqDto.setEpName("企业名称");
// reqDto.setEmail();
reqDto.setVerifyCode("325588");
// reqDto.setCreditCode("91110101330367841P");
reqDto.setCreditCode("91110101330367841P");
reqDto.setBusiLicenseId(12222);
// reqDto.setOfficialLetterId();
reqDto.setRepresentativeName("沈总");
reqDto.setContact("安家宾");
reqDto.setMobile("13811314082");
reqDto.setIdcard("142323198302062216");
reqDto.setCardType(Integer.parseInt(ZxlnftEnum.CardTypeEnum.ID_CARD.getCode()));
// reqDto.setPlatformName();c
// reqDto.setPlatformUrl();
// reqDto.setBusinessType();
ZxlnftResponseDto<Nft009RegisterCompanyRespDto> resp = zxlnftSdkUtil.nft009RegisterCompany(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft010RegisterCompanyPlatform(){
Nft010RegisterCompanyPlatformReqDto reqDto = Nft010RegisterCompanyPlatformReqDto.getNew();
reqDto.setEpName("北京正在映画互联网科技有限公司");
// reqDto.setEmail();
reqDto.setCreditCode("91110101330367841P");
reqDto.setBusiLicenseId(12222);
// reqDto.setOfficialLetterId();
reqDto.setRepresentativeName("沈总");
reqDto.setContact("安家宾");
reqDto.setMobile("13811314082");
reqDto.setIdcard("142323198302062216");
reqDto.setCardType(Integer.parseInt(ZxlnftEnum.CardTypeEnum.ID_CARD.getCode()));
// reqDto.setPlatformName();c
// reqDto.setPlatformUrl();
// reqDto.setBusinessType();
ZxlnftResponseDto<Nft010RegisterCompanyPlatformRespDto> resp = zxlnftSdkUtil.nft010RegisterCompanyPlatform(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft011UserQueryVerifyCode(){
Nft011UserQueryVerifyCodeReqDto reqDto = Nft011UserQueryVerifyCodeReqDto.getNew();
//查询用户信息 发送手机验证码
// reqDto.setType(1);
// reqDto.setCardNo("142323198302062216");
// reqDto.setScene(1);
//nft平台绑定地址 发送邮箱验证码
reqDto.setType(1);
reqDto.setCardNo("142323198302062216");
reqDto.setScene(2);
ZxlnftResponseDto<Nft011UserQueryVerifyCodeRespDto> resp = zxlnftSdkUtil.nft011UserQueryVerifyCode(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft012UserQuery(){
Nft012UserQueryReqDto reqDto = Nft012UserQueryReqDto.getNew();
reqDto.setType(2);
reqDto.setCardNo("142323198302062216");
reqDto.setVerifyCode("676291");
ZxlnftResponseDto<Nft012UserQueryRespDto> resp = zxlnftSdkUtil.nft012UserQuery(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft013IdentityBindSubmit(){
Nft013IdentityBindSubmitReqDto reqDto = Nft013IdentityBindSubmitReqDto.getNew();
reqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
reqDto.setUserIdentification("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef");
reqDto.setSignData(zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),reqDto.getUserIdentification()));
reqDto.setFaceResultId("122");
ZxlnftResponseDto<Nft013IdentityBindSubmitRespDto> resp = zxlnftSdkUtil.nft013IdentityBindSubmit(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft014IdentityBindSubmitByTrusted(){
Nft014IdentityBindSubmitByTrustedReqDto reqDto = Nft014IdentityBindSubmitByTrustedReqDto.getNew();
reqDto.setUserPubKey(zxlnftConfig.getNftPlatformPubKey());
reqDto.setUserIdentification("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef");
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),reqDto.getUserIdentification());
reqDto.setUserSignData(signature);
ZxlnftResponseDto<Nft014IdentityBindSubmitByTrustedRespDto> resp = zxlnftSdkUtil.nft014IdentityBindSubmitByTrusted(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft015IdentityBindPlatformSelf(){
Nft015IdentityBindPlatformSelfReqDto reqDto = Nft015IdentityBindPlatformSelfReqDto.getNew();
reqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
reqDto.setUserIdentification("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef");
reqDto.setVerifyCode("061628");
String signature = zxlnftBiz.createSign(zxlnftConfig.getNftPlatformPriKey(),reqDto.getUserIdentification());
reqDto.setSignData(signature);
ZxlnftResponseDto<Nft015IdentityBindPlatformSelfRespDto> resp = zxlnftSdkUtil.nft015IdentityBindPlatformSelf(reqDto);
System.out.println(resp.toJson());
}
@Test @Test
public void nft016IdentityBindQuery(){ public void nft016IdentityBindQuery(){
Nft016IdentityBindQueryReqDto reqDto = Nft016IdentityBindQueryReqDto.getNew(); Nft016IdentityBindQueryReqDto reqDto = Nft016IdentityBindQueryReqDto.getNew();
reqDto.setAddressList("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
ZxlnftResponseDto<Nft016IdentityBindQueryRespDto> resp = zxlnftSdkUtil.nft016IdentityBindQuery(reqDto); ZxlnftResponseDto<Nft016IdentityBindQueryRespDto> resp = zxlnftSdkUtil.nft016IdentityBindQuery(reqDto);
System.out.println(resp.toJson()); System.out.println(resp.toJson());
} }
@Test
public void nft017IdentityVerifyIdentity(){
Nft017IdentityVerifyIdentityReqDto reqDto = Nft017IdentityVerifyIdentityReqDto.getNew();
reqDto.setAddress("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
reqDto.setFaceResultId("111");
ZxlnftResponseDto<Nft017IdentityVerifyIdentityRespDto> resp = zxlnftSdkUtil.nft017IdentityVerifyIdentity(reqDto);
System.out.println(resp.toJson());
}
@Test @Test
public void nft021UploadUrl(){ public void nft021UploadUrl(){
Nft021UploadUrlReqDto reqDto = Nft021UploadUrlReqDto.getNew(); Nft021UploadUrlReqDto reqDto = Nft021UploadUrlReqDto.getNew();
...@@ -151,6 +274,24 @@ public class TestZxlnftSdkUtil { ...@@ -151,6 +274,24 @@ public class TestZxlnftSdkUtil {
System.out.println(resp.toJson()); System.out.println(resp.toJson());
} }
@Test
public void nft023PointApply(){
Nft023PointApplyReqDto reqDto = Nft023PointApplyReqDto.getNew();
reqDto.setApplyerAddr("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
reqDto.setCount(100l);
reqDto.setOperateId(IDGenerator.get32UUID());
ZxlnftResponseDto<Nft023PointApplyRespDto> resp = zxlnftSdkUtil.nft023PointApply(reqDto);
System.out.println(resp.toJson());
}
@Test
public void nft024PointApplyResult(){
Nft024PointApplyResultReqDto reqDto = Nft024PointApplyResultReqDto.getNew();
reqDto.setTaskId("337fe5cc-d509-418f-867f-378ca351e4ba_apply-point_1");
ZxlnftResponseDto<Nft024PointApplyResultRespDto> resp = zxlnftSdkUtil.nft024PointApplyResult(reqDto);
System.out.println(resp.toJson());
}
@Test @Test
public void nft034Publish(){ public void nft034Publish(){
Nft034PublishReqDto reqDto = Nft034PublishReqDto.getNew(); Nft034PublishReqDto reqDto = Nft034PublishReqDto.getNew();
......
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