记得上下班打卡 | 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
b93c122c
Commit
b93c122c
authored
Mar 02, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试至信链NFt发行接口
parent
3fb04d37
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
202 additions
and
42 deletions
+202
-42
ZxlnftBiz.java
...java/com/liquidnet/common/third/zxlnft/biz/ZxlnftBiz.java
+12
-2
Nft014IdentityBindSubmitByTrustedRespDto.java
.../zxlnft/dto/Nft014IdentityBindSubmitByTrustedRespDto.java
+1
-0
Nft030SeriesClaimReqDto.java
...dnet/common/third/zxlnft/dto/Nft030SeriesClaimReqDto.java
+2
-2
Nft031SeriesClaimResultRespDto.java
...mmon/third/zxlnft/dto/Nft031SeriesClaimResultRespDto.java
+1
-0
Nft014IdentityBindSubmitByTrustedResp.java
...zxlnft/dto/nft/Nft014IdentityBindSubmitByTrustedResp.java
+1
-0
Nft030SeriesClaimReq.java
...net/common/third/zxlnft/dto/nft/Nft030SeriesClaimReq.java
+2
-2
Nft031SeriesClaimResultResp.java
...mon/third/zxlnft/dto/nft/Nft031SeriesClaimResultResp.java
+1
-0
ZxlnftSdkServiceImpl.java
...ommon/third/zxlnft/service/impl/ZxlnftSdkServiceImpl.java
+26
-25
ZxlnftSdkUtil.java
...com/liquidnet/common/third/zxlnft/util/ZxlnftSdkUtil.java
+43
-1
TestZxlWalletSdkUtil.java
...va/com/liquidnet/service/zxlnft/TestZxlWalletSdkUtil.java
+9
-2
TestZxlnftSdkUtil.java
.../java/com/liquidnet/service/zxlnft/TestZxlnftSdkUtil.java
+104
-8
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 @
b93c122c
...
...
@@ -80,6 +80,10 @@ public class ZxlnftBiz {
}
public
<
T
>
T
buildNftRespObj
(
String
response
,
Class
<
T
>
tClass
){
return
this
.
buildNftRespObj
(
response
,
tClass
,
true
);
}
public
<
T
>
T
buildNftRespObj
(
String
response
,
Class
<
T
>
tClass
,
boolean
isJson
){
T
resp
=
null
;
try
{
resp
=
tClass
.
newInstance
();
...
...
@@ -90,8 +94,14 @@ public class ZxlnftBiz {
}
JSONObject
json
=
JSONObject
.
parseObject
(
response
);
if
(
json
.
containsKey
(
"retCode"
)
&&
json
.
containsKey
(
"data"
)
&&
json
.
getInteger
(
"retCode"
).
intValue
()
==
0
)
{
JSONObject
data
=
json
.
getJSONObject
(
"data"
);
resp
=
JsonUtils
.
fromJson
(
data
.
toJSONString
(),
tClass
);
if
(
isJson
){
JSONObject
data
=
json
.
getJSONObject
(
"data"
);
resp
=
JsonUtils
.
fromJson
(
data
.
toJSONString
(),
tClass
);
}
else
{
String
rsData
=
json
.
getString
(
"data"
);
resp
=
(
T
)
rsData
;
}
}
else
{
if
(
json
.
containsKey
(
"retCode"
)
&&
json
.
getInteger
(
"retCode"
).
intValue
()
!=
0
)
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/dto/Nft014IdentityBindSubmitByTrustedRespDto.java
View file @
b93c122c
...
...
@@ -16,6 +16,7 @@ import java.io.Serializable;
*/
@Data
public
class
Nft014IdentityBindSubmitByTrustedRespDto
implements
Serializable
{
private
String
address
;
private
static
final
Nft014IdentityBindSubmitByTrustedRespDto
obj
=
new
Nft014IdentityBindSubmitByTrustedRespDto
();
public
static
Nft014IdentityBindSubmitByTrustedRespDto
getNew
()
{
try
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/dto/Nft030SeriesClaimReqDto.java
View file @
b93c122c
...
...
@@ -46,12 +46,12 @@ public class Nft030SeriesClaimReqDto implements Serializable {
/**
* 历史遗留字段,无意义,填任意值都一样,建议填0即可
*/
private
String
maxPublishCount
;
private
Integer
maxPublishCount
;
/**
* 系列下的nftId后缀,是否从0开始,true就是从0开始,默认为false,从1开始
*/
//@Null
private
String
seriesBeginFromZero
;
private
Boolean
seriesBeginFromZero
;
/**
* 系列声明人的私钥签名,签名对象是(platformPubKey_pubKey_接口名_seriesName_totalCount_coverUrl_desc_maxPublishCount
* _seriesBeginFromZero_operateId) 接口名:series_claim
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/dto/Nft031SeriesClaimResultRespDto.java
View file @
b93c122c
...
...
@@ -27,6 +27,7 @@ public class Nft031SeriesClaimResultRespDto implements Serializable {
/**
* 系列ID,后面用于查询系列信息
*/
private
String
seriesId
;
/**
* 交易hash
*/
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/dto/nft/Nft014IdentityBindSubmitByTrustedResp.java
View file @
b93c122c
...
...
@@ -16,6 +16,7 @@ import java.io.Serializable;
*/
@Data
public
class
Nft014IdentityBindSubmitByTrustedResp
implements
Serializable
{
private
String
address
;
private
static
final
Nft014IdentityBindSubmitByTrustedResp
obj
=
new
Nft014IdentityBindSubmitByTrustedResp
();
public
static
Nft014IdentityBindSubmitByTrustedResp
getNew
()
{
try
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/dto/nft/Nft030SeriesClaimReq.java
View file @
b93c122c
...
...
@@ -46,12 +46,12 @@ public class Nft030SeriesClaimReq implements Serializable {
/**
* 历史遗留字段,无意义,填任意值都一样,建议填0即可
*/
private
String
maxPublishCount
;
private
Integer
maxPublishCount
;
/**
* 系列下的nftId后缀,是否从0开始,true就是从0开始,默认为false,从1开始
*/
//@Null
private
String
seriesBeginFromZero
;
private
Boolean
seriesBeginFromZero
;
/**
* 系列声明人的私钥签名,签名对象是(platformPubKey_pubKey_接口名_seriesName_totalCount_coverUrl_desc_maxPublishCount
* _seriesBeginFromZero_operateId) 接口名:series_claim
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/dto/nft/Nft031SeriesClaimResultResp.java
View file @
b93c122c
...
...
@@ -27,6 +27,7 @@ public class Nft031SeriesClaimResultResp implements Serializable {
/**
* 系列ID,后面用于查询系列信息
*/
private
String
seriesId
;
/**
* 交易hash
*/
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/service/impl/ZxlnftSdkServiceImpl.java
View file @
b93c122c
...
...
@@ -413,7 +413,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft012UserQuery error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -495,8 +495,9 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
/**
* 构造返回结果
*/
Nft014IdentityBindSubmitByTrustedResp
resp
=
zxlnftBiz
.
buildNftRespObj
(
response
,
Nft014IdentityBindSubmitByTrustedResp
.
class
);
String
address
=
zxlnftBiz
.
buildNftRespObj
(
response
,
String
.
class
,
false
);
Nft014IdentityBindSubmitByTrustedResp
resp
=
Nft014IdentityBindSubmitByTrustedResp
.
getNew
();
resp
.
setAddress
(
address
);
log
.
info
(
"nft014IdentityBindSubmitByTrusted--->>> return result : {} "
,
resp
.
toString
());
return
resp
;
}
...
...
@@ -685,7 +686,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft020FaceQuery error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -720,7 +721,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft021UploadUrl error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -904,7 +905,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft026PointTransferResult error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -971,7 +972,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft028PointDestoryResult error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1005,7 +1006,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft029PointQuery error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1072,7 +1073,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft031SeriesClaimResult error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1106,7 +1107,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft032Series error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1141,7 +1142,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft033SeriesList error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1227,7 +1228,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft035PublishResult error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1261,7 +1262,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft036Info error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1296,7 +1297,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft037AddressList error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1331,7 +1332,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft038AddressWithoutSeriesList error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1366,7 +1367,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft039TradeList error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1401,7 +1402,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft040TradeInList error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1436,7 +1437,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft041TradeOutList error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1471,7 +1472,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft042TradeAllList error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1538,7 +1539,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft044BuyResult error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1572,7 +1573,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft045BuyPayResult error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1705,7 +1706,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft049TransferResult error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1773,7 +1774,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft051StatusUpdateResult error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1840,7 +1841,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft053PriceUpdateResult error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
@@ -1874,7 +1875,7 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
String
response
=
null
;
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try
{
response
=
HttpUtil
.
get
(
requestUrl
,
nul
l
,
commonHeader
);
response
=
HttpUtil
.
get
ByUri
(
requestUr
l
,
commonHeader
);
}
catch
(
HttpClientErrorException
e
)
{
log
.
error
(
"nft054QueryUserAddressBelongToUser error"
,
e
);
}
catch
(
Exception
e
)
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-zxlnft/src/main/java/com/liquidnet/common/third/zxlnft/util/ZxlnftSdkUtil.java
View file @
b93c122c
...
...
@@ -600,6 +600,44 @@ public class ZxlnftSdkUtil {
Nft030SeriesClaimReq
req
=
Nft030SeriesClaimReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
req
.
setPlatformPubKey
(
zxlnftConfig
.
getNftPlatformPubKey
());
/**
* 系列声明人的私钥签名,签名对象是(platformPubKey_pubKey_接口名_seriesName_totalCount_coverUrl_desc_maxPublishCount
* _seriesBeginFromZero_operateId) 接口名:series_claim
*/
String
signMetaData
=
req
.
getPlatformPubKey
()
.
concat
(
"_"
).
concat
(
req
.
getPubKey
())
.
concat
(
"_"
).
concat
(
"series_claim"
)
.
concat
(
"_"
).
concat
(
req
.
getSeriesName
())
.
concat
(
"_"
).
concat
(
req
.
getTotalCount
().
toString
())
.
concat
(
"_"
).
concat
(
req
.
getCoverUrl
())
.
concat
(
"_"
).
concat
(
req
.
getDesc
())
.
concat
(
"_"
).
concat
(
req
.
getMaxPublishCount
().
toString
())
.
concat
(
"_"
).
concat
(
req
.
getSeriesBeginFromZero
().
toString
())
.
concat
(
"_"
).
concat
(
req
.
getOperateId
());
String
signature
=
zxlnftBiz
.
createSign
(
zxlnftConfig
.
getNftPlatformPriKey
(),
signMetaData
);
req
.
setSignature
(
signature
);
/**
* 平台方的私钥签名,签名对象是(platformPubKey_pubKey_接口名_seriesName_totalCount_coverUrl_desc_maxPublishCount
* _seriesBeginFromZero_operateId) 接口名:series_claim
*/
String
platformSignMetaData
=
req
.
getPlatformPubKey
()
.
concat
(
"_"
).
concat
(
req
.
getPubKey
())
.
concat
(
"_"
).
concat
(
"series_claim"
)
.
concat
(
"_"
).
concat
(
req
.
getSeriesName
())
.
concat
(
"_"
).
concat
(
req
.
getTotalCount
().
toString
())
.
concat
(
"_"
).
concat
(
req
.
getCoverUrl
())
.
concat
(
"_"
).
concat
(
req
.
getDesc
())
.
concat
(
"_"
).
concat
(
req
.
getMaxPublishCount
().
toString
())
.
concat
(
"_"
).
concat
(
req
.
getSeriesBeginFromZero
().
toString
())
.
concat
(
"_"
).
concat
(
req
.
getOperateId
());
String
platformSignature
=
zxlnftBiz
.
createSign
(
zxlnftConfig
.
getNftPlatformPriKey
(),
platformSignMetaData
);
req
.
setPlatformSignature
(
platformSignature
);
Nft030SeriesClaimRespDto
respDto
=
Nft030SeriesClaimRespDto
.
getNew
();
try
{
Nft030SeriesClaimResp
resp
=
zxlnftSdkService
.
nft030SeriesClaim
(
req
);
...
...
@@ -617,6 +655,8 @@ public class ZxlnftSdkUtil {
Nft031SeriesClaimResultReq
req
=
Nft031SeriesClaimResultReq
.
getNew
();
BeanUtil
.
copy
(
reqDto
,
req
);
req
.
setPlatformPubKey
(
zxlnftConfig
.
getNftPlatformPubKey
());
Nft031SeriesClaimResultRespDto
respDto
=
Nft031SeriesClaimResultRespDto
.
getNew
();
try
{
Nft031SeriesClaimResultResp
resp
=
zxlnftSdkService
.
nft031SeriesClaimResult
(
req
);
...
...
@@ -673,7 +713,9 @@ public class ZxlnftSdkUtil {
* _sellStatus_sellCount_metaData_operateId)
* 接口名:publish_nft
*/
String
signMetaData
=
req
.
getPlatformPubKey
().
concat
(
"_"
).
concat
(
"publish_nft"
)
String
signMetaData
=
req
.
getPlatformPubKey
()
.
concat
(
"_"
).
concat
(
req
.
getPubKey
())
.
concat
(
"_"
).
concat
(
"publish_nft"
)
.
concat
(
"_"
).
concat
(
req
.
getAuthor
())
.
concat
(
"_"
).
concat
(
req
.
getName
())
.
concat
(
"_"
).
concat
(
req
.
getUrl
())
...
...
liquidnet-bus-service/liquidnet-service-zxlnft/liquidnet-service-zxlnft-impl/src/test/java/com/liquidnet/service/zxlnft/TestZxlWalletSdkUtil.java
View file @
b93c122c
...
...
@@ -90,8 +90,15 @@ public class TestZxlWalletSdkUtil {
public
void
deriveKeyPair
(){
DeriveKeyPairReq
req
=
DeriveKeyPairReq
.
getNew
();
// req.setPriKey(zxlnftConfig.getNftPlatformPriKey());
req
.
setMnemonic
(
"stuff"
);
req
.
setIndex
(
0
l
);
// req.setMnemonic("stuff");
// req.setIndex(0l);
// req.setMnemonic("region");
// req.setIndex(0l);
req
.
setMnemonic
(
"use"
);
req
.
setIndex
(
2
l
);
//3045022072ba19d02f43ae883764ffa43d111ab62fd0bcd6ace31bc91356e7ce38756cbb022100deb5f7666f4768f297ccdf386a867d2a0d71227548f2595a62130e5016fb1d54
zxlWalletSdkUtil
.
deriveKeyPair
(
req
);
}
...
...
liquidnet-bus-service/liquidnet-service-zxlnft/liquidnet-service-zxlnft-impl/src/test/java/com/liquidnet/service/zxlnft/TestZxlnftSdkUtil.java
View file @
b93c122c
...
...
@@ -42,6 +42,13 @@ public class TestZxlnftSdkUtil {
@Autowired
private
ZxlnftBiz
zxlnftBiz
;
// private static String zhouhuanPubKey = "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAERAYCoqlcb1/C+b085HO4RWbIFx/n\nw6zkU3tvIYhBi1Xjj7GMdE/dR6D2fCQGWHqdYwQUb6/kS67Yjx47prxREg==\n-----END PUBLIC KEY-----\n";
// private static String zhouhuanPriKey = "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjSDapAU4gujWk9mM\nCE1tOokocdKrHMkfvZ0vfaWM+MOgCgYIKoEcz1UBgi2hRANCAAREBgKiqVxvX8L5\nvTzkc7hFZsgXH+fDrORTe28hiEGLVeOPsYx0T91HoPZ8JAZYep1jBBRvr+RLrtiP\nHjumvFES\n-----END PRIVATE KEY-----\n";
private
static
String
zhouhuanPubKey
=
"-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAELZtnP30dbtdFrvherJxfpPEQP+q3\nRyrtECAuEwZg3o8/RLJva0O6unNLHGavkwd77l5UgvX4cPNoX/OV6n/3xQ==\n-----END PUBLIC KEY-----\n"
;
private
static
String
zhouhuanPriKey
=
"-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgNBYWsObyiuXLIZZZ\nPa0P/aNSrlf3//TLkdhZsDroRNugCgYIKoEcz1UBgi2hRANCAAQtm2c/fR1u10Wu\n+F6snF+k8RA/6rdHKu0QIC4TBmDejz9Esm9rQ7q6c0scZq+TB3vuXlSC9fhw82hf\n85Xqf/fF\n-----END PRIVATE KEY-----\n"
;
@Test
public
void
nft001RegisterVerifyCode
(){
Nft001RegisterVerifyCodeReqDto
reqDto
=
Nft001RegisterVerifyCodeReqDto
.
getNew
();
...
...
@@ -66,10 +73,16 @@ public class TestZxlnftSdkUtil {
@Test
public
void
nft003RegisterPersonPlatform
(){
Nft003RegisterPersonPlatformReqDto
reqDto
=
Nft003RegisterPersonPlatformReqDto
.
getNew
();
reqDto
.
setPersonName
(
"安家宾"
);
// reqDto.setPersonName("安家宾");
//// reqDto.setEmail("");
// reqDto.setMobile("15711300982");
// reqDto.setIdCard("142323198302062216");
reqDto
.
setPersonName
(
"周焕"
);
// reqDto.setEmail("");
reqDto
.
setMobile
(
"13811314082"
);
reqDto
.
setIdCard
(
"142323198302062216"
);
reqDto
.
setMobile
(
"18548596019"
);
reqDto
.
setIdCard
(
"150422199805206019"
);
reqDto
.
setCardType
(
Integer
.
valueOf
(
ZxlnftEnum
.
CardTypeEnum
.
ID_CARD
.
getCode
()));
ZxlnftResponseDto
<
Nft003RegisterPersonPlatformRespDto
>
resp
=
zxlnftSdkUtil
.
nft003RegisterPersonPlatform
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
...
...
@@ -205,9 +218,16 @@ public class TestZxlnftSdkUtil {
@Test
public
void
nft014IdentityBindSubmitByTrusted
(){
Nft014IdentityBindSubmitByTrustedReqDto
reqDto
=
Nft014IdentityBindSubmitByTrustedReqDto
.
getNew
();
//安家宾
reqDto
.
setUserPubKey
(
zxlnftConfig
.
getNftPlatformPubKey
());
reqDto
.
setUserIdentification
(
"4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef"
);
String
signature
=
zxlnftBiz
.
createSign
(
zxlnftConfig
.
getNftPlatformPriKey
(),
reqDto
.
getUserIdentification
());
//周焕
reqDto
.
setUserPubKey
(
zhouhuanPubKey
);
reqDto
.
setUserIdentification
(
"0354415fabf861ecde70db198836bf82af025820ea50f66c05589e21b6d9700f"
);
signature
=
zxlnftBiz
.
createSign
(
zhouhuanPriKey
,
reqDto
.
getUserIdentification
());
reqDto
.
setUserSignData
(
signature
);
ZxlnftResponseDto
<
Nft014IdentityBindSubmitByTrustedRespDto
>
resp
=
zxlnftSdkUtil
.
nft014IdentityBindSubmitByTrusted
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
...
...
@@ -277,7 +297,12 @@ public class TestZxlnftSdkUtil {
@Test
public
void
nft023PointApply
(){
Nft023PointApplyReqDto
reqDto
=
Nft023PointApplyReqDto
.
getNew
();
reqDto
.
setApplyerAddr
(
"ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4"
);
//安家宾
// reqDto.setApplyerAddr("ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4");
//周焕1
// reqDto.setApplyerAddr("ZXf8dcce2b5374610631735ad4d606372ff199d89e");
//周焕2
reqDto
.
setApplyerAddr
(
"ZX26ff9db9cf1e981e3028b7e133d54b28eb859f97"
);
reqDto
.
setCount
(
200
l
);
reqDto
.
setOperateId
(
IDGenerator
.
get32UUID
());
ZxlnftResponseDto
<
Nft023PointApplyRespDto
>
resp
=
zxlnftSdkUtil
.
nft023PointApply
(
reqDto
);
...
...
@@ -291,6 +316,9 @@ public class TestZxlnftSdkUtil {
public
void
nft024PointApplyResult
(){
Nft024PointApplyResultReqDto
reqDto
=
Nft024PointApplyResultReqDto
.
getNew
();
reqDto
.
setTaskId
(
"337fe5cc-d509-418f-867f-378ca351e4ba_apply-point_1"
);
reqDto
.
setTaskId
(
"01e01f1c-93c8-4bb0-b0f5-1ff064c210dc_apply-point_1"
);
reqDto
.
setTaskId
(
"d1de1627-fcc6-46a2-8540-e4bd17ac1a02_apply-point_1"
);
reqDto
.
setTaskId
(
"a09a628e-13c5-4183-a528-3bf9b3123fb7_apply-point_1"
);
ZxlnftResponseDto
<
Nft024PointApplyResultRespDto
>
resp
=
zxlnftSdkUtil
.
nft024PointApplyResult
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
...
...
@@ -304,6 +332,10 @@ public class TestZxlnftSdkUtil {
public
void
nft029PointQuery
(){
Nft029PointQueryReqDto
reqDto
=
Nft029PointQueryReqDto
.
getNew
();
reqDto
.
setAddr
(
"ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4"
);
//周焕1
// reqDto.setAddr("ZXf8dcce2b5374610631735ad4d606372ff199d89e");
//周焕2
// reqDto.setAddr("ZX26ff9db9cf1e981e3028b7e133d54b28eb859f97");
ZxlnftResponseDto
<
Nft029PointQueryRespDto
>
resp
=
zxlnftSdkUtil
.
nft029PointQuery
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
...
...
@@ -311,16 +343,64 @@ public class TestZxlnftSdkUtil {
//31 查询NFT系列声明结果 api/v1/nft/series/claim/result
//32 查询系列信息 api/v1/nft/series
//33 查询该账户资产归属的系列列表 api/v1/nft/series/list
@Test
public
void
nft030SeriesClaim
(){
Nft030SeriesClaimReqDto
reqDto
=
Nft030SeriesClaimReqDto
.
getNew
();
reqDto
.
setPubKey
(
zxlnftConfig
.
getNftPlatformPubKey
());
reqDto
.
setSeriesName
(
"北京草莓音乐节2022主题模型-系列002"
);
reqDto
.
setTotalCount
(
10
l
);
reqDto
.
setOperateId
(
IDGenerator
.
get32UUID
());
reqDto
.
setCoverUrl
(
"https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg"
);
reqDto
.
setDesc
(
"系列描述信息不超过500字符"
);
reqDto
.
setMaxPublishCount
(
0
);
reqDto
.
setSeriesBeginFromZero
(
false
);
ZxlnftResponseDto
<
Nft030SeriesClaimRespDto
>
resp
=
zxlnftSdkUtil
.
nft030SeriesClaim
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft031SeriesClaimResult
(){
Nft031SeriesClaimResultReqDto
reqDto
=
Nft031SeriesClaimResultReqDto
.
getNew
();
//第一个系列 北京草莓音乐节2022主题模型-系列001
// reqDto.setTaskId("ac760fac-8992-41e2-93d9-7f3bc2108714_nft-series-claim_1");
reqDto
.
setTaskId
(
"dc92bbd6-eb95-4452-99f8-0726001367be_nft-series-claim_1"
);
//第二个系列 北京草莓音乐节2022主题模型-系列002
// reqDto.setTaskId("05b33c4b-c1e2-49c1-99bb-7ca05397c528_nft-series-claim_1");
reqDto
.
setTaskId
(
"0d951a6b-0697-4ede-83f2-e31485f380ce_nft-series-claim_1"
);
ZxlnftResponseDto
<
Nft031SeriesClaimResultRespDto
>
resp
=
zxlnftSdkUtil
.
nft031SeriesClaimResult
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft032Series
(){
Nft032SeriesReqDto
reqDto
=
Nft032SeriesReqDto
.
getNew
();
reqDto
.
setSeriesId
(
"4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6"
);
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_31ff9f7d4c33c98518e095fec6cecdab8d337751602cf6e651eb7d131cff5b61");
ZxlnftResponseDto
<
Nft032SeriesRespDto
>
resp
=
zxlnftSdkUtil
.
nft032Series
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft033SeriesList
(){
Nft033SeriesListReqDto
reqDto
=
Nft033SeriesListReqDto
.
getNew
();
reqDto
.
setAddr
(
"ZXa66c8a684727d0f9aaa434044362aa8a18b61bb4"
);
ZxlnftResponseDto
<
Nft033SeriesListRespDto
>
resp
=
zxlnftSdkUtil
.
nft033SeriesList
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
@Test
public
void
nft034Publish
(){
Nft034PublishReqDto
reqDto
=
Nft034PublishReqDto
.
getNew
();
reqDto
.
setAuthor
(
"正在现场
作者
"
);
reqDto
.
setName
(
"
正在现场NFT001
"
);
reqDto
.
setAuthor
(
"正在现场
创作者001
"
);
reqDto
.
setName
(
"
北京2022草莓音乐节2022
"
);
reqDto
.
setUrl
(
"https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg"
);
reqDto
.
setDisplayUrl
(
"https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg"
);
reqDto
.
setDesc
(
"NFT描述信息"
);
reqDto
.
setFlag
(
"文创"
);
reqDto
.
setPublishCount
(
1
0
l
);
reqDto
.
setPublishCount
(
1
l
);
// reqDto.setSeriesId("");
reqDto
.
setSeriesBeginIndex
(
1
);
reqDto
.
setSellStatus
(
Integer
.
parseInt
(
ZxlnftEnum
.
SellStatusEnum
.
CAN_SELL
.
getCode
()));
...
...
@@ -332,11 +412,27 @@ public class TestZxlnftSdkUtil {
System
.
out
.
println
(
resp
.
toJson
());
}
/**
* NFT发行
*/
@Test
public
void
nft035PublishResult
(){
Nft035PublishResultReqDto
reqDto
=
Nft035PublishResultReqDto
.
getNew
();
reqDto
.
setTaskId
(
"5d23ed47-dcb2-4672-99eb-060c04727a20_nft-publish_3"
);
// reqDto.setTaskId("5d23ed47-dcb2-4672-99eb-060c04727a20_nft-publish_3");
// reqDto.setTaskId("15ba80bb-a5f9-41db-b708-20bf4df34c14_nft-publish_3");
reqDto
.
setTaskId
(
"1b8b94c0-e9d1-4885-97a5-ae1b82302e17_nft-publish_3"
);
ZxlnftResponseDto
<
Nft035PublishResultRespDto
>
resp
=
zxlnftSdkUtil
.
nft035PublishResult
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
/**
* NFT发行
*/
@Test
public
void
nft036Info
(){
Nft036InfoReqDto
reqDto
=
Nft036InfoReqDto
.
getNew
();
reqDto
.
setNftId
(
"7f73aca56caaf57a20f0afff59318528f0f09ffbf028fe882161d3ce599d2854_1"
);
ZxlnftResponseDto
<
Nft036InfoRespDto
>
resp
=
zxlnftSdkUtil
.
nft036Info
(
reqDto
);
System
.
out
.
println
(
resp
.
toJson
());
}
}
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