记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
ff5de416
Commit
ff5de416
authored
Feb 28, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试至信链NFt发行接口
parent
5010bc75
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
188 additions
and
25 deletions
+188
-25
ZxlnftBiz.java
...java/com/liquidnet/common/third/zxlnft/biz/ZxlnftBiz.java
+3
-2
ZxlnftEnum.java
...om/liquidnet/common/third/zxlnft/constant/ZxlnftEnum.java
+33
-0
Nft003RegisterPersonPlatformReq.java
...third/zxlnft/dto/nft/Nft003RegisterPersonPlatformReq.java
+6
-0
Nft005BusinessLicenseUploadPlatformReq.java
...xlnft/dto/nft/Nft005BusinessLicenseUploadPlatformReq.java
+1
-1
ZxlnftSdkUtil.java
...com/liquidnet/common/third/zxlnft/util/ZxlnftSdkUtil.java
+74
-22
TestZxlnftSdkUtil.java
.../java/com/liquidnet/service/zxlnft/TestZxlnftSdkUtil.java
+71
-0
No files found.
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/biz/ZxlnftBiz.java
View file @
ff5de416
...
...
@@ -88,11 +88,12 @@ public class ZxlnftBiz {
if
(
json
.
containsKey
(
"retCode"
)
&&
json
.
containsKey
(
"data"
)
&&
json
.
getInteger
(
"retCode"
).
intValue
()
==
0
)
{
JSONObject
data
=
json
.
getJSONObject
(
"data"
);
resp
=
JsonUtils
.
fromJson
(
data
.
toJSONString
(),
tClass
);
}
else
{
}
else
{
if
(
json
.
containsKey
(
"retCode"
)
&&
json
.
getInteger
(
"retCode"
).
intValue
()
!=
0
)
{
throw
new
ZxlNftException
(
String
.
valueOf
(
json
.
getInteger
(
"retCode"
)),
json
.
getString
(
"retMsg"
));
}
throw
new
ZxlNftException
(
json
.
getString
(
"retCode"
),
json
.
getString
(
"retMsg"
));
//
throw new ZxlNftException(json.getString("retCode"), json.getString("retMsg"));
}
return
resp
;
}
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/constant/ZxlnftEnum.java
View file @
ff5de416
...
...
@@ -39,4 +39,37 @@ public class ZxlnftEnum {
return
code
;
}
}
public
enum
CardTypeEnum
{
// 1-身份证 2-护照 3-港澳通行证 4-台湾通行证 5-外国人永居身份证 6-港澳台居民居住证 7-其它
ID_CARD
(
"1"
,
"身份证"
),
ID_CARD_PP
(
"2"
,
"护照"
),
ID_CARD_HM
(
"3"
,
"港澳通行证"
),
ID_CARD_TW
(
"4"
,
"台湾通行证"
),
ID_CARD_FOR
(
"5"
,
"外国人永居身份证"
),
ID_CARD_HMTW
(
"6"
,
"港澳台居民居住证"
),
ID_CARD_OTHER
(
"7"
,
"其它"
);
private
String
code
;
private
String
message
;
CardTypeEnum
(
String
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
public
CardTypeEnum
getEnumByCode
(
String
code
){
CardTypeEnum
[]
arry
=
CardTypeEnum
.
values
();
for
(
int
i
=
0
;
i
<
arry
.
length
;
i
++)
{
if
(
arry
[
i
].
getCode
().
equals
(
code
))
{
return
arry
[
i
];
}
}
return
null
;
}
public
String
getCode
()
{
return
code
;
}
}
}
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/dto/nft/Nft003RegisterPersonPlatformReq.java
View file @
ff5de416
...
...
@@ -25,7 +25,13 @@ public class Nft003RegisterPersonPlatformReq implements Serializable {
private
String
mobile
;
private
String
idCard
;
private
Integer
cardType
;
/**
* 平台公钥
*/
private
String
platformPubKey
;
/**
* 平台签名信息:sign(personName_mobile_idCard)
*/
private
String
platformSignData
;
private
static
final
Nft003RegisterPersonPlatformReq
obj
=
new
Nft003RegisterPersonPlatformReq
();
public
static
Nft003RegisterPersonPlatformReq
getNew
()
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/dto/nft/Nft005BusinessLicenseUploadPlatformReq.java
View file @
ff5de416
...
...
@@ -30,7 +30,7 @@ public class Nft005BusinessLicenseUploadPlatformReq implements Serializable {
*/
private
String
platformPubKey
;
/**
* 平台签名信
* 平台签名信
息:sign(platformIdentification)
*/
private
String
platformSignData
;
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/util/ZxlnftSdkUtil.java
View file @
ff5de416
...
...
@@ -4,6 +4,7 @@ import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz;
import
com.liquidnet.common.third.zxlnft.config.ZxlnftConfig
;
import
com.liquidnet.common.third.zxlnft.dto.*
;
import
com.liquidnet.common.third.zxlnft.dto.nft.*
;
import
com.liquidnet.common.third.zxlnft.exception.ZxlNftException
;
import
com.liquidnet.common.third.zxlnft.service.ZxlnftSdkService
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -38,10 +39,13 @@ public class ZxlnftSdkUtil {
Nft001RegisterVerifyCodeReq
req
=
Nft001RegisterVerifyCodeReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
Nft001RegisterVerifyCodeResp
resp
=
zxlnftSdkService
.
nft001RegisterVerifyCode
(
req
);
Nft001RegisterVerifyCodeRespDto
respDto
=
Nft001RegisterVerifyCodeRespDto
.
getNew
();
BeanUtil
.
copy
(
resp
,
respDto
);
try
{
Nft001RegisterVerifyCodeResp
resp
=
zxlnftSdkService
.
nft001RegisterVerifyCode
(
req
);
BeanUtil
.
copy
(
resp
,
respDto
);
}
catch
(
ZxlNftException
e
){
return
ZxlnftResponseDto
.
failure
(
e
.
getCode
()+
","
+
e
.
getMessage
());
}
return
ZxlnftResponseDto
.
success
(
respDto
);
}
...
...
@@ -52,10 +56,13 @@ public class ZxlnftSdkUtil {
Nft002RegisterPersonReq
req
=
Nft002RegisterPersonReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
Nft002RegisterPersonResp
resp
=
zxlnftSdkService
.
nft002RegisterPerson
(
req
);
Nft002RegisterPersonRespDto
respDto
=
Nft002RegisterPersonRespDto
.
getNew
();
BeanUtil
.
copy
(
resp
,
respDto
);
try
{
Nft002RegisterPersonResp
resp
=
zxlnftSdkService
.
nft002RegisterPerson
(
req
);
BeanUtil
.
copy
(
resp
,
respDto
);
}
catch
(
ZxlNftException
e
){
return
ZxlnftResponseDto
.
failure
(
e
.
getCode
()+
","
+
e
.
getMessage
());
}
return
ZxlnftResponseDto
.
success
(
respDto
);
}
...
...
@@ -65,11 +72,23 @@ public class ZxlnftSdkUtil {
*/
Nft003RegisterPersonPlatformReq
req
=
Nft003RegisterPersonPlatformReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
Nft003RegisterPersonPlatformResp
resp
=
zxlnftSdkService
.
nft003RegisterPersonPlatform
(
req
);
req
.
setPlatformPubKey
(
zxlnftConfig
.
getNftPlatformPubKey
());
/**
* 平台签名信息:sign(personName_mobile_idCard)
*/
String
signMetaData
=
req
.
getPersonName
()
.
concat
(
"_"
).
concat
(
req
.
getMobile
())
.
concat
(
"_"
).
concat
(
req
.
getIdCard
());
String
signature
=
zxlnftBiz
.
createSign
(
zxlnftConfig
.
getNftPlatformPriKey
(),
signMetaData
);
req
.
setPlatformSignData
(
signature
);
Nft003RegisterPersonPlatformRespDto
respDto
=
Nft003RegisterPersonPlatformRespDto
.
getNew
();
BeanUtil
.
copy
(
resp
,
respDto
);
try
{
Nft003RegisterPersonPlatformResp
resp
=
zxlnftSdkService
.
nft003RegisterPersonPlatform
(
req
);
BeanUtil
.
copy
(
resp
,
respDto
);
}
catch
(
ZxlNftException
e
){
return
ZxlnftResponseDto
.
failure
(
e
.
getCode
()+
","
+
e
.
getMessage
());
}
return
ZxlnftResponseDto
.
success
(
respDto
);
}
...
...
@@ -80,10 +99,13 @@ public class ZxlnftSdkUtil {
Nft004BusinessLicenseUploadReq
req
=
Nft004BusinessLicenseUploadReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
Nft004BusinessLicenseUploadResp
resp
=
zxlnftSdkService
.
nft004BusinessLicenseUpload
(
req
);
Nft004BusinessLicenseUploadRespDto
respDto
=
Nft004BusinessLicenseUploadRespDto
.
getNew
();
BeanUtil
.
copy
(
resp
,
respDto
);
try
{
Nft004BusinessLicenseUploadResp
resp
=
zxlnftSdkService
.
nft004BusinessLicenseUpload
(
req
);
BeanUtil
.
copy
(
resp
,
respDto
);
}
catch
(
ZxlNftException
e
){
return
ZxlnftResponseDto
.
failure
(
e
.
getCode
()+
","
+
e
.
getMessage
());
}
return
ZxlnftResponseDto
.
success
(
respDto
);
}
...
...
@@ -94,10 +116,22 @@ public class ZxlnftSdkUtil {
Nft005BusinessLicenseUploadPlatformReq
req
=
Nft005BusinessLicenseUploadPlatformReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
Nft005BusinessLicenseUploadPlatformResp
resp
=
zxlnftSdkService
.
nft005BusinessLicenseUploadPlatform
(
req
);
req
.
setPlatformIdentification
(
zxlnftConfig
.
getPlatformIdentification
());
req
.
setPlatformPubKey
(
zxlnftConfig
.
getNftPlatformPubKey
());
/**
* 平台签名信息:sign(platformIdentification)
*/
String
signMetaData
=
req
.
getPlatformIdentification
();
String
signature
=
zxlnftBiz
.
createSign
(
zxlnftConfig
.
getNftPlatformPriKey
(),
signMetaData
);
req
.
setPlatformSignData
(
signature
);
Nft005BusinessLicenseUploadPlatformRespDto
respDto
=
Nft005BusinessLicenseUploadPlatformRespDto
.
getNew
();
BeanUtil
.
copy
(
resp
,
respDto
);
try
{
Nft005BusinessLicenseUploadPlatformResp
resp
=
zxlnftSdkService
.
nft005BusinessLicenseUploadPlatform
(
req
);
BeanUtil
.
copy
(
resp
,
respDto
);
}
catch
(
ZxlNftException
e
){
return
ZxlnftResponseDto
.
failure
(
e
.
getCode
()+
","
+
e
.
getMessage
());
}
return
ZxlnftResponseDto
.
success
(
respDto
);
}
...
...
@@ -108,10 +142,13 @@ public class ZxlnftSdkUtil {
Nft006OfficialLetterUploadReq
req
=
Nft006OfficialLetterUploadReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
Nft006OfficialLetterUploadResp
resp
=
zxlnftSdkService
.
nft006OfficialLetterUpload
(
req
);
Nft006OfficialLetterUploadRespDto
respDto
=
Nft006OfficialLetterUploadRespDto
.
getNew
();
BeanUtil
.
copy
(
resp
,
respDto
);
try
{
Nft006OfficialLetterUploadResp
resp
=
zxlnftSdkService
.
nft006OfficialLetterUpload
(
req
);
BeanUtil
.
copy
(
resp
,
respDto
);
}
catch
(
ZxlNftException
e
){
return
ZxlnftResponseDto
.
failure
(
e
.
getCode
()+
","
+
e
.
getMessage
());
}
return
ZxlnftResponseDto
.
success
(
respDto
);
}
...
...
@@ -122,10 +159,22 @@ public class ZxlnftSdkUtil {
Nft007OfficialLetterUploadPlatformReq
req
=
Nft007OfficialLetterUploadPlatformReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
Nft007OfficialLetterUploadPlatformResp
resp
=
zxlnftSdkService
.
nft007OfficialLetterUploadPlatform
(
req
);
req
.
setPlatformIdentification
(
zxlnftConfig
.
getPlatformIdentification
());
req
.
setPlatformPubKey
(
zxlnftConfig
.
getNftPlatformPubKey
());
/**
* 平台签名信息:sign(platformIdentification)
*/
String
signMetaData
=
req
.
getPlatformIdentification
();
String
signature
=
zxlnftBiz
.
createSign
(
zxlnftConfig
.
getNftPlatformPriKey
(),
signMetaData
);
req
.
setPlatformSignData
(
signature
);
Nft007OfficialLetterUploadPlatformRespDto
respDto
=
Nft007OfficialLetterUploadPlatformRespDto
.
getNew
();
BeanUtil
.
copy
(
resp
,
respDto
);
try
{
Nft007OfficialLetterUploadPlatformResp
resp
=
zxlnftSdkService
.
nft007OfficialLetterUploadPlatform
(
req
);
BeanUtil
.
copy
(
resp
,
respDto
);
}
catch
(
ZxlNftException
e
){
return
ZxlnftResponseDto
.
failure
(
e
.
getCode
()+
","
+
e
.
getMessage
());
}
return
ZxlnftResponseDto
.
success
(
respDto
);
}
...
...
@@ -136,10 +185,13 @@ public class ZxlnftSdkUtil {
Nft008QueryImageModerationReq
req
=
Nft008QueryImageModerationReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
Nft008QueryImageModerationResp
resp
=
zxlnftSdkService
.
nft008QueryImageModeration
(
req
);
Nft008QueryImageModerationRespDto
respDto
=
Nft008QueryImageModerationRespDto
.
getNew
();
BeanUtil
.
copy
(
resp
,
respDto
);
try
{
Nft008QueryImageModerationResp
resp
=
zxlnftSdkService
.
nft008QueryImageModeration
(
req
);
BeanUtil
.
copy
(
resp
,
respDto
);
}
catch
(
ZxlNftException
e
){
return
ZxlnftResponseDto
.
failure
(
e
.
getCode
()+
","
+
e
.
getMessage
());
}
return
ZxlnftResponseDto
.
success
(
respDto
);
}
...
...
liquidnet-bus-service/liquidnet-service-zxlnft/liquidnet-service-zxlnft-impl/src/test/java/com/liquidnet/service/zxlnft/TestZxlnftSdkUtil.java
View file @
ff5de416
...
...
@@ -15,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.io.File
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -40,6 +42,75 @@ public class TestZxlnftSdkUtil {
@Autowired
private
ZxlnftBiz
zxlnftBiz
;
@Test
public
void
nft001RegisterVerifyCode
(){
Nft001RegisterVerifyCodeReqDto
reqDto
=
Nft001RegisterVerifyCodeReqDto
.
getNew
();
reqDto
.
setMobile
(
"13811314082"
);
ZxlnftResponseDto
<
Nft001RegisterVerifyCodeRespDto
>
resp
=
zxlnftSdkUtil
.
nft001RegisterVerifyCode
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft002RegisterPerson
(){
Nft002RegisterPersonReqDto
reqDto
=
Nft002RegisterPersonReqDto
.
getNew
();
reqDto
.
setPersonName
(
"安家宾"
);
// reqDto.setEmail("");
reqDto
.
setMobile
(
"13811314082"
);
reqDto
.
setVerifyCode
(
"669340"
);
reqDto
.
setIdCard
(
"142323198302062216"
);
reqDto
.
setCardType
(
Integer
.
valueOf
(
ZxlnftEnum
.
CardTypeEnum
.
ID_CARD
.
getCode
()));
ZxlnftResponseDto
<
Nft002RegisterPersonRespDto
>
resp
=
zxlnftSdkUtil
.
nft002RegisterPerson
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft003RegisterPersonPlatform
(){
Nft003RegisterPersonPlatformReqDto
reqDto
=
Nft003RegisterPersonPlatformReqDto
.
getNew
();
reqDto
.
setPersonName
(
"安家宾"
);
// reqDto.setEmail("");
reqDto
.
setMobile
(
"13811314082"
);
reqDto
.
setIdCard
(
"142323198302062216"
);
reqDto
.
setCardType
(
Integer
.
valueOf
(
ZxlnftEnum
.
CardTypeEnum
.
ID_CARD
.
getCode
()));
ZxlnftResponseDto
<
Nft003RegisterPersonPlatformRespDto
>
resp
=
zxlnftSdkUtil
.
nft003RegisterPersonPlatform
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft004BusinessLicenseUpload
(){
Nft004BusinessLicenseUploadReqDto
reqDto
=
Nft004BusinessLicenseUploadReqDto
.
getNew
();
reqDto
.
setFile
(
new
File
(
"/Users/anjiabin/Downloads/zxl_image_test_001.jpg"
));
reqDto
.
setMobile
(
"13811314082"
);
reqDto
.
setVerifyCode
(
"123456"
);
ZxlnftResponseDto
<
Nft004BusinessLicenseUploadRespDto
>
resp
=
zxlnftSdkUtil
.
nft004BusinessLicenseUpload
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft005BusinessLicenseUploadPlatform
(){
Nft005BusinessLicenseUploadPlatformReqDto
reqDto
=
Nft005BusinessLicenseUploadPlatformReqDto
.
getNew
();
reqDto
.
setFile
(
new
File
(
"/Users/anjiabin/Downloads/zxl_image_test_001.jpg"
));
ZxlnftResponseDto
<
Nft005BusinessLicenseUploadPlatformRespDto
>
resp
=
zxlnftSdkUtil
.
nft005BusinessLicenseUploadPlatform
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft006OfficialLetterUpload
(){
Nft006OfficialLetterUploadReqDto
reqDto
=
Nft006OfficialLetterUploadReqDto
.
getNew
();
reqDto
.
setFile
(
new
File
(
"/Users/anjiabin/Downloads/zxl_image_test_001.jpg"
));
reqDto
.
setMobile
(
"13811314082"
);
reqDto
.
setVerifyCode
(
"123456"
);
ZxlnftResponseDto
<
Nft006OfficialLetterUploadRespDto
>
resp
=
zxlnftSdkUtil
.
nft006OfficialLetterUpload
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft007OfficialLetterUploadPlatform
(){
Nft007OfficialLetterUploadPlatformReqDto
reqDto
=
Nft007OfficialLetterUploadPlatformReqDto
.
getNew
();
reqDto
.
setFile
(
new
File
(
"/Users/anjiabin/Downloads/zxl_image_test_001.jpg"
));
ZxlnftResponseDto
<
Nft007OfficialLetterUploadPlatformRespDto
>
resp
=
zxlnftSdkUtil
.
nft007OfficialLetterUploadPlatform
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft016IdentityBindQuery
(){
Nft016IdentityBindQueryReqDto
reqDto
=
Nft016IdentityBindQueryReqDto
.
getNew
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment