记得上下班打卡 | 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
84e40b30
Commit
84e40b30
authored
Jul 01, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现xuper发行购买功能
parent
eb788dcf
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
75 additions
and
55 deletions
+75
-55
XuperConfig.java
.../com/liquidnet/common/third/xuper/config/XuperConfig.java
+6
-0
XuperSdkUtil.java
...a/com/liquidnet/common/third/xuper/util/XuperSdkUtil.java
+27
-27
liquidnet-service-goblin-dev.yml
...-config/liquidnet-config/liquidnet-service-goblin-dev.yml
+1
-1
XuperTradeCommonBiz.java
.../service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
+13
-15
XuperPublishBiz.java
...dnet/service/galaxy/router/xuper/biz/XuperPublishBiz.java
+2
-2
XuperTradeBiz.java
...uidnet/service/galaxy/router/xuper/biz/XuperTradeBiz.java
+5
-5
TestUrlHash.java
.../com/liquidnet/service/goblin/test/xuper/TestUrlHash.java
+11
-0
TestXuperSdkUtil.java
...liquidnet/service/goblin/test/xuper/TestXuperSdkUtil.java
+10
-5
No files found.
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/config/XuperConfig.java
View file @
84e40b30
...
@@ -32,6 +32,8 @@ public class XuperConfig {
...
@@ -32,6 +32,8 @@ public class XuperConfig {
private
String
nftApiUrl
;
private
String
nftApiUrl
;
@Value
(
"${liquidnet.service.galaxy.xuper.nftPlatformMnemonic}"
)
@Value
(
"${liquidnet.service.galaxy.xuper.nftPlatformMnemonic}"
)
private
String
nftPlatformMnemonic
;
private
String
nftPlatformMnemonic
;
@Value
(
"${liquidnet.service.galaxy.xuper.nftPlatformAddress}"
)
private
String
nftPlatformAddress
;
private
Asset
asset
=
null
;
private
Asset
asset
=
null
;
private
static
Asset
staticAsset
=
null
;
private
static
Asset
staticAsset
=
null
;
...
@@ -96,4 +98,8 @@ public class XuperConfig {
...
@@ -96,4 +98,8 @@ public class XuperConfig {
public
String
getNftPlatformMnemonic
()
{
public
String
getNftPlatformMnemonic
()
{
return
nftPlatformMnemonic
;
return
nftPlatformMnemonic
;
}
}
public
String
getNftPlatformAddress
()
{
return
nftPlatformAddress
;
}
}
}
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/util/XuperSdkUtil.java
View file @
84e40b30
This diff is collapsed.
Click to expand it.
liquidnet-bus-config/liquidnet-config/liquidnet-service-goblin-dev.yml
View file @
84e40b30
...
@@ -10,7 +10,7 @@ liquidnet:
...
@@ -10,7 +10,7 @@ liquidnet:
path
:
/data/logs
path
:
/data/logs
name
:
service-goblin
name
:
service-goblin
max-history
:
7
max-history
:
7
level
:
debug
level
:
info
mysql
:
mysql
:
database-name
:
dev_ln_scene
database-name
:
dev_ln_scene
mongodb
:
mongodb
:
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
View file @
84e40b30
...
@@ -153,12 +153,12 @@ public class XuperTradeCommonBiz {
...
@@ -153,12 +153,12 @@ public class XuperTradeCommonBiz {
while
(
nftBuyPayTaskId
==
null
){
while
(
nftBuyPayTaskId
==
null
){
Thread
.
sleep
(
500
l
);
Thread
.
sleep
(
500
l
);
count
++;
count
++;
log
.
info
(
"=======执行第{}次查询,taskId:{}"
,
count
,
nft044ReqDto
.
getTaskId
());
log
.
info
(
"=======执行
nft购买
第{}次查询,taskId:{}"
,
count
,
nft044ReqDto
.
getTaskId
());
//执行nft购买结果查询
//执行nft购买结果查询
GalaxyNftBuyResultQueryReqDto
nftBuyResultQueryReqDto
=
GalaxyNftBuyResultQueryReqDto
.
getNew
();
GalaxyNftBuyResultQueryReqDto
nftBuyResultQueryReqDto
=
GalaxyNftBuyResultQueryReqDto
.
getNew
();
nftBuyResultQueryReqDto
.
setNftOrderPayId
(
nftOrderBo
.
getNftOrderPayId
());
nftBuyResultQueryReqDto
.
setNftOrderPayId
(
nftOrderBo
.
getNftOrderPayId
());
nftBuyResultQueryReqDto
.
setRouterType
(
routerType
);
nftBuyResultQueryReqDto
.
setRouterType
(
routerType
);
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
buyResultQueryRespDto
=
this
.
nftBuyResultQuery
(
nftBuyResultQueryReqDto
);
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
buyResultQueryRespDto
=
this
.
nftBuyResultQuery
(
nftBuyResultQueryReqDto
,
nftOrderBo
);
if
(
buyResultQueryRespDto
.
isSuccess
()){
if
(
buyResultQueryRespDto
.
isSuccess
()){
if
(
buyResultQueryRespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())){
if
(
buyResultQueryRespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())){
nftBuyPayTaskId
=
buyResultQueryRespDto
.
getData
().
getPayTaskId
();
nftBuyPayTaskId
=
buyResultQueryRespDto
.
getData
().
getPayTaskId
();
...
@@ -169,7 +169,7 @@ public class XuperTradeCommonBiz {
...
@@ -169,7 +169,7 @@ public class XuperTradeCommonBiz {
log
.
info
(
"任务执行失败!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
log
.
info
(
"任务执行失败!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
nftBuyStatus
=
buyResultQueryRespDto
.
getData
().
getTaskStatus
();
nftBuyStatus
=
buyResultQueryRespDto
.
getData
().
getTaskStatus
();
//购买失败
//购买失败
throw
new
GalaxyNftBuyException
(
GalaxyErrorEnum
.
NFT_BUY_FAIL
.
getCode
(),
"nft
044BuyResult_resp
:"
+
GalaxyErrorEnum
.
NFT_BUY_FAIL
.
getMessage
());
throw
new
GalaxyNftBuyException
(
GalaxyErrorEnum
.
NFT_BUY_FAIL
.
getCode
(),
"nft
BuyResultQuery
:"
+
GalaxyErrorEnum
.
NFT_BUY_FAIL
.
getMessage
());
}
else
if
(
buyResultQueryRespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
TaskStatusEnum
.
PROCESSING
.
getCode
())){
}
else
if
(
buyResultQueryRespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
TaskStatusEnum
.
PROCESSING
.
getCode
())){
log
.
info
(
"任务执行中!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
log
.
info
(
"任务执行中!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
nftBuyStatus
=
buyResultQueryRespDto
.
getData
().
getTaskStatus
();
nftBuyStatus
=
buyResultQueryRespDto
.
getData
().
getTaskStatus
();
...
@@ -179,7 +179,7 @@ public class XuperTradeCommonBiz {
...
@@ -179,7 +179,7 @@ public class XuperTradeCommonBiz {
if
(
count
==
20
){
if
(
count
==
20
){
//查询超过20次,则把nftId设置为空,为后续重新入队
//查询超过20次,则把nftId设置为空,为后续重新入队
nftId
=
null
;
nftId
=
null
;
log
.
info
(
"=======查询共
5
次,跳出循环!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
log
.
info
(
"=======查询共
20
次,跳出循环!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
break
;
break
;
}
}
}
}
...
@@ -189,7 +189,7 @@ public class XuperTradeCommonBiz {
...
@@ -189,7 +189,7 @@ public class XuperTradeCommonBiz {
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
//发行失败
//发行失败
throw
new
GalaxyNftBuyException
(
GalaxyErrorEnum
.
NFT_BUY_ERROR
.
getCode
(),
"nft
044BuyResult
_exception:"
+
e
.
getMessage
());
throw
new
GalaxyNftBuyException
(
GalaxyErrorEnum
.
NFT_BUY_ERROR
.
getCode
(),
"nft
BuyResultQuery
_exception:"
+
e
.
getMessage
());
}
}
//更新订单缓存数据状态
//更新订单缓存数据状态
...
@@ -199,10 +199,7 @@ public class XuperTradeCommonBiz {
...
@@ -199,10 +199,7 @@ public class XuperTradeCommonBiz {
nftOrderBo
.
setNftBuyChainTimestamp
(
nftBuyChainTimestampStr
);
nftOrderBo
.
setNftBuyChainTimestamp
(
nftBuyChainTimestampStr
);
}
}
if
(
StringUtil
.
isNotNull
(
nftBuyStatus
)){
if
(
StringUtil
.
isNotNull
(
nftBuyStatus
)){
//转换任务状态
nftOrderBo
.
setNftBuyStatus
(
nftBuyStatus
.
toString
());
String
nftBuyStatusStr
=
GalaxyEnumBiz
.
getTaskStatusEnum
(
routerType
,
nftBuyStatus
.
toString
()).
getCode
();
nftOrderBo
.
setNftBuyStatus
(
nftBuyStatusStr
);
}
}
nftOrderBo
.
setNftBuyTradeHash
(
nftBuyTradeHash
);
nftOrderBo
.
setNftBuyTradeHash
(
nftBuyTradeHash
);
nftOrderBo
.
setNftBuyPayTaskId
(
nftBuyPayTaskId
);
nftOrderBo
.
setNftBuyPayTaskId
(
nftBuyPayTaskId
);
...
@@ -211,7 +208,7 @@ public class XuperTradeCommonBiz {
...
@@ -211,7 +208,7 @@ public class XuperTradeCommonBiz {
dataUtils
.
updateNftOrderBuyInfo
(
routerType
,
nftOrderBo
.
getNftOrderPayId
(),
nftOrderBo
);
dataUtils
.
updateNftOrderBuyInfo
(
routerType
,
nftOrderBo
.
getNftOrderPayId
(),
nftOrderBo
);
}
else
{
}
else
{
//购买失败
//购买失败
throw
new
GalaxyNftBuyException
(
GalaxyErrorEnum
.
NFT_BUY_ERROR
.
getCode
(),
"nft
043Buy_resp
: nftBuyTaskId:"
+
nftBuyTaskId
);
throw
new
GalaxyNftBuyException
(
GalaxyErrorEnum
.
NFT_BUY_ERROR
.
getCode
(),
"nft
BuyResultQuery
: nftBuyTaskId:"
+
nftBuyTaskId
);
}
}
GalaxyNftBuyRespDto
nftBuyRespDto
=
GalaxyNftBuyRespDto
.
getNew
();
GalaxyNftBuyRespDto
nftBuyRespDto
=
GalaxyNftBuyRespDto
.
getNew
();
...
@@ -220,12 +217,12 @@ public class XuperTradeCommonBiz {
...
@@ -220,12 +217,12 @@ public class XuperTradeCommonBiz {
return
nftBuyRespDto
;
return
nftBuyRespDto
;
}
}
public
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
nftBuyResultQuery
(
GalaxyNftBuyResultQueryReqDto
reqDto
)
{
public
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
nftBuyResultQuery
(
GalaxyNftBuyResultQueryReqDto
reqDto
,
GalaxyNftOrderBo
nftOrderBo
)
{
//获取订单信息
//获取订单信息
GalaxyNftOrderBo
nftOrderBo
=
dataUtils
.
getNftOrderBo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
());
//
GalaxyNftOrderBo nftOrderBo = dataUtils.getNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId());
if
(
StringUtil
.
isNull
(
nftOrderBo
)){
//
if(StringUtil.isNull(nftOrderBo)){
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
PUBLISH_ORDER_NOT_EXIST
.
getCode
(),
GalaxyErrorEnum
.
PUBLISH_ORDER_NOT_EXIST
.
getMessage
());
//
return ResponseDto.failure(GalaxyErrorEnum.PUBLISH_ORDER_NOT_EXIST.getCode(), GalaxyErrorEnum.PUBLISH_ORDER_NOT_EXIST.getMessage());
}
//
}
if
(
StringUtil
.
isEmpty
(
nftOrderBo
.
getNftBuyTaskId
())){
if
(
StringUtil
.
isEmpty
(
nftOrderBo
.
getNftBuyTaskId
())){
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getCode
(),
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getMessage
());
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getCode
(),
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getMessage
());
...
@@ -257,6 +254,7 @@ public class XuperTradeCommonBiz {
...
@@ -257,6 +254,7 @@ public class XuperTradeCommonBiz {
resultQueryRespDto
.
setTaskStatus
(
taskStatus
);
resultQueryRespDto
.
setTaskStatus
(
taskStatus
);
resultQueryRespDto
.
setChainTimestamp
(
nowTimeStr
);
resultQueryRespDto
.
setChainTimestamp
(
nowTimeStr
);
resultQueryRespDto
.
setPayTaskId
(
xuper010QuerySdsRespDto
.
getMeta
().
getTxId
());
resultQueryRespDto
.
setPayTaskId
(
xuper010QuerySdsRespDto
.
getMeta
().
getTxId
());
resultQueryRespDto
.
setTxHash
(
xuper010QuerySdsRespDto
.
getMeta
().
getTxId
());
return
ResponseDto
.
success
(
resultQueryRespDto
);
return
ResponseDto
.
success
(
resultQueryRespDto
);
}
else
{
}
else
{
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_PUBLISH_AND_BUY_QUERY_FAIL
.
getCode
(),
GalaxyErrorEnum
.
NFT_PUBLISH_AND_BUY_QUERY_FAIL
.
getMessage
());
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_PUBLISH_AND_BUY_QUERY_FAIL
.
getCode
(),
GalaxyErrorEnum
.
NFT_PUBLISH_AND_BUY_QUERY_FAIL
.
getMessage
());
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperPublishBiz.java
View file @
84e40b30
...
@@ -196,7 +196,7 @@ public class XuperPublishBiz {
...
@@ -196,7 +196,7 @@ public class XuperPublishBiz {
nftOrderBo
.
setNftId
(
nftOrderBo
.
getNftId
());
nftOrderBo
.
setNftId
(
nftOrderBo
.
getNftId
());
nftOrderBo
.
setNftPublishChainTimestamp
(
nftPublishChainTimestampStr
);
nftOrderBo
.
setNftPublishChainTimestamp
(
nftPublishChainTimestampStr
);
nftOrderBo
.
setNftPublishStatus
(
nftPublishStatusStr
);
nftOrderBo
.
setNftPublishStatus
(
nftPublishStatusStr
);
nftOrderBo
.
setNftPublishTradeHash
(
nftOrderBo
.
getSeries
Id
());
nftOrderBo
.
setNftPublishTradeHash
(
assetMeta
.
getTx
Id
());
nftOrderBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
nftOrderBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
dataUtils
.
updateNftOrderPublishInfo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
(),
nftOrderBo
);
dataUtils
.
updateNftOrderPublishInfo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
(),
nftOrderBo
);
...
@@ -204,7 +204,7 @@ public class XuperPublishBiz {
...
@@ -204,7 +204,7 @@ public class XuperPublishBiz {
GalaxyNftPublishResultQueryRespDto
nftPublishResultQueryRespDto
=
GalaxyNftPublishResultQueryRespDto
.
getNew
();
GalaxyNftPublishResultQueryRespDto
nftPublishResultQueryRespDto
=
GalaxyNftPublishResultQueryRespDto
.
getNew
();
nftPublishResultQueryRespDto
.
setNftIdBegin
(
nftOrderBo
.
getNftId
());
nftPublishResultQueryRespDto
.
setNftIdBegin
(
nftOrderBo
.
getNftId
());
nftPublishResultQueryRespDto
.
setTaskMsg
(
nftOrderBo
.
getNftId
());
nftPublishResultQueryRespDto
.
setTaskMsg
(
nftOrderBo
.
getNftId
());
nftPublishResultQueryRespDto
.
setTxHash
(
nftOrderBo
.
getNft
Id
());
nftPublishResultQueryRespDto
.
setTxHash
(
nftOrderBo
.
getNft
PublishTradeHash
());
nftPublishResultQueryRespDto
.
setChainTimestamp
(
nftPublishChainTimestampStr
);
nftPublishResultQueryRespDto
.
setChainTimestamp
(
nftPublishChainTimestampStr
);
nftPublishResultQueryRespDto
.
setTaskStatus
(
Integer
.
valueOf
(
nftPublishStatusStr
));
nftPublishResultQueryRespDto
.
setTaskStatus
(
Integer
.
valueOf
(
nftPublishStatusStr
));
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperTradeBiz.java
View file @
84e40b30
...
@@ -14,7 +14,6 @@ import com.liquidnet.commons.lang.util.JsonUtils;
...
@@ -14,7 +14,6 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz
;
import
com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz
;
import
com.liquidnet.service.galaxy.biz.GalaxyEnumBiz
;
import
com.liquidnet.service.galaxy.constant.GalaxyEnum
;
import
com.liquidnet.service.galaxy.constant.GalaxyEnum
;
import
com.liquidnet.service.galaxy.constant.GalaxyErrorEnum
;
import
com.liquidnet.service.galaxy.constant.GalaxyErrorEnum
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBindBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBindBo
;
...
@@ -91,6 +90,8 @@ public class XuperTradeBiz {
...
@@ -91,6 +90,8 @@ public class XuperTradeBiz {
//初始化订单数据
//初始化订单数据
if
(
nftOrderBo
==
null
){
if
(
nftOrderBo
==
null
){
nftOrderBo
=
galaxyBeanTransferBiz
.
buildNftOrderBo
(
reqDto
.
getNftOrderPayId
(),
userInfoBo
,
seriesNftInfoBo
);
nftOrderBo
=
galaxyBeanTransferBiz
.
buildNftOrderBo
(
reqDto
.
getNftOrderPayId
(),
userInfoBo
,
seriesNftInfoBo
);
nftOrderBo
.
setNftPublishFromAddress
(
xuperConfig
.
getNftPlatformAddress
());
nftOrderBo
.
setNftBuyFromAddress
(
xuperConfig
.
getNftPlatformAddress
());
dataUtils
.
setNftOrderBo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
(),
nftOrderBo
);
dataUtils
.
setNftOrderBo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
(),
nftOrderBo
);
}
else
if
(
StringUtil
.
isNotNull
(
nftOrderBo
)){
}
else
if
(
StringUtil
.
isNotNull
(
nftOrderBo
)){
if
(
nftOrderBo
.
getNftPublishStatus
().
equalsIgnoreCase
(
GalaxyEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())
if
(
nftOrderBo
.
getNftPublishStatus
().
equalsIgnoreCase
(
GalaxyEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())
...
@@ -207,7 +208,7 @@ public class XuperTradeBiz {
...
@@ -207,7 +208,7 @@ public class XuperTradeBiz {
while
(
StringUtil
.
isEmpty
(
nftId
))
{
while
(
StringUtil
.
isEmpty
(
nftId
))
{
Thread
.
sleep
(
500
l
);
Thread
.
sleep
(
500
l
);
count
++;
count
++;
log
.
info
(
"=======执行第{}次查询,taskId:{}"
,
count
,
nft035ReqDto
.
getTaskId
());
log
.
info
(
"=======执行
nft发行
第{}次查询,taskId:{}"
,
count
,
nft035ReqDto
.
getTaskId
());
//执行nft发行结果查询
//执行nft发行结果查询
GalaxyNftPublishResultQueryReqDto
nftPublishResultQueryReqDto
=
GalaxyNftPublishResultQueryReqDto
.
getNew
();
GalaxyNftPublishResultQueryReqDto
nftPublishResultQueryReqDto
=
GalaxyNftPublishResultQueryReqDto
.
getNew
();
nftPublishResultQueryReqDto
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
nftPublishResultQueryReqDto
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
...
@@ -306,8 +307,7 @@ public class XuperTradeBiz {
...
@@ -306,8 +307,7 @@ public class XuperTradeBiz {
}
}
if
(
StringUtil
.
isNotNull
(
nftPublishStatus
)){
if
(
StringUtil
.
isNotNull
(
nftPublishStatus
)){
//转换任务状态
//转换任务状态
String
nftPublishStatusStr
=
GalaxyEnumBiz
.
getTaskStatusEnum
(
reqDto
.
getRouterType
(),
nftPublishStatus
.
toString
()).
getCode
();
nftOrderBo
.
setNftPublishStatus
(
nftPublishStatus
.
toString
());
nftOrderBo
.
setNftPublishStatus
(
nftPublishStatusStr
);
}
}
nftOrderBo
.
setNftPublishTradeHash
(
nftPublishTradeHash
);
nftOrderBo
.
setNftPublishTradeHash
(
nftPublishTradeHash
);
nftOrderBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
nftOrderBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
...
@@ -372,7 +372,7 @@ public class XuperTradeBiz {
...
@@ -372,7 +372,7 @@ public class XuperTradeBiz {
GalaxyNftBuyResultQueryReqDto
nftBuyResultQueryReqDto
=
GalaxyNftBuyResultQueryReqDto
.
getNew
();
GalaxyNftBuyResultQueryReqDto
nftBuyResultQueryReqDto
=
GalaxyNftBuyResultQueryReqDto
.
getNew
();
nftBuyResultQueryReqDto
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
nftBuyResultQueryReqDto
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
nftBuyResultQueryReqDto
.
setRouterType
(
reqDto
.
getRouterType
());
nftBuyResultQueryReqDto
.
setRouterType
(
reqDto
.
getRouterType
());
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
buyResultQueryRespDto
=
xuperTradeCommonBiz
.
nftBuyResultQuery
(
nftBuyResultQueryReqDto
);
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
buyResultQueryRespDto
=
xuperTradeCommonBiz
.
nftBuyResultQuery
(
nftBuyResultQueryReqDto
,
nftOrderBo
);
if
(
buyResultQueryRespDto
.
isSuccess
()){
if
(
buyResultQueryRespDto
.
isSuccess
()){
GalaxyNftBuyResultQueryRespDto
nftBuyResultQueryRespDtoTemp
=
buyResultQueryRespDto
.
getData
();
GalaxyNftBuyResultQueryRespDto
nftBuyResultQueryRespDtoTemp
=
buyResultQueryRespDto
.
getData
();
BeanUtil
.
copy
(
nftBuyResultQueryRespDtoTemp
,
nftOrderBo
);
BeanUtil
.
copy
(
nftBuyResultQueryRespDtoTemp
,
nftOrderBo
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/test/java/com/liquidnet/service/goblin/test/xuper/TestUrlHash.java
View file @
84e40b30
...
@@ -42,6 +42,17 @@ public class TestUrlHash {
...
@@ -42,6 +42,17 @@ public class TestUrlHash {
private
XuperConfig
xuperConfig
;
private
XuperConfig
xuperConfig
;
@Test
public
void
getAccount
(){
Account
account
=
null
;
try
{
account
=
xuperSdkUtil
.
getAccount
(
xuperConfig
.
getNftPlatformMnemonic
());
log
.
info
(
"accountgetAddress : {}"
,
account
.
getAddress
());
}
catch
(
Exception
var25
)
{
Base
.
logger
.
warning
(
"account esdsa sign failed"
+
var25
);
throw
new
XupterException
(
GalaxyErrorEnum
.
SERIES_NFT_HASH_CREATE_FAIL
.
getCode
(),
GalaxyErrorEnum
.
SERIES_NFT_HASH_CREATE_FAIL
.
getMessage
());
}
}
@Test
@Test
public
void
testGetNftHashByNftUrl
(){
public
void
testGetNftHashByNftUrl
(){
String
url
=
"https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg"
;
String
url
=
"https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg"
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/test/java/com/liquidnet/service/goblin/test/xuper/TestXuperSdkUtil.java
View file @
84e40b30
...
@@ -6,6 +6,7 @@ import com.liquidnet.common.third.xuper.constant.XuperEnum;
...
@@ -6,6 +6,7 @@ import com.liquidnet.common.third.xuper.constant.XuperEnum;
import
com.liquidnet.common.third.xuper.dto.*
;
import
com.liquidnet.common.third.xuper.dto.*
;
import
com.liquidnet.common.third.xuper.exception.XupterException
;
import
com.liquidnet.common.third.xuper.exception.XupterException
;
import
com.liquidnet.common.third.xuper.util.XuperSdkUtil
;
import
com.liquidnet.common.third.xuper.util.XuperSdkUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.galaxy.biz.GalaxyCommonBiz
;
import
com.liquidnet.service.galaxy.biz.GalaxyCommonBiz
;
...
@@ -21,6 +22,7 @@ import java.awt.image.BufferedImage;
...
@@ -21,6 +22,7 @@ import java.awt.image.BufferedImage;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Date
;
/**
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @author AnJiabin <anjiabin@zhengzai.tv>
...
@@ -48,8 +50,11 @@ public class TestXuperSdkUtil {
...
@@ -48,8 +50,11 @@ public class TestXuperSdkUtil {
private
static
String
customerMnemonic2
=
"person lucky trophy wall kangaroo body bounce coach unable sister second goat guitar virus tree security acoustic ankle kiss deputy sunny message weapon believe"
;
private
static
String
customerMnemonic2
=
"person lucky trophy wall kangaroo body bounce coach unable sister second goat guitar virus tree security acoustic ankle kiss deputy sunny message weapon believe"
;
@Test
@Test
public
void
test
(){
public
void
test
(){
byte
[]
byteArrays
=
Hash
.
doubleSha256
(
"百"
.
getBytes
());
// byte[] byteArrays = Hash.doubleSha256("百".getBytes());
System
.
out
.
println
(
new
String
(
byteArrays
));
// System.out.println(new String(byteArrays));
Integer
time
=
1656644857
;
String
nowTimeStr
=
DateUtil
.
format
(
new
Date
(
time
),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
);
System
.
out
.
println
(
"nowTimeStr==="
+
nowTimeStr
);
}
}
@Test
@Test
...
@@ -444,9 +449,9 @@ public class TestXuperSdkUtil {
...
@@ -444,9 +449,9 @@ public class TestXuperSdkUtil {
Xuper010QuerySdsReqDto
reqDto
=
Xuper010QuerySdsReqDto
.
getNew
();
Xuper010QuerySdsReqDto
reqDto
=
Xuper010QuerySdsReqDto
.
getNew
();
// 定义返回结果对象
// 定义返回结果对象
Xuper010QuerySdsRespDto
respDto
=
null
;
Xuper010QuerySdsRespDto
respDto
=
null
;
long
assetId
=
171095615845019437
l
;
//
long assetId = 171095615845019437l;
// long assetId = 1532351545249738541
l;
long
assetId
=
477060752401870637
l
;
long
shardId
=
1
l
;
long
shardId
=
4
l
;
try
{
try
{
reqDto
.
setAssetId
(
assetId
);
reqDto
.
setAssetId
(
assetId
);
reqDto
.
setShardId
(
shardId
);
reqDto
.
setShardId
(
shardId
);
...
...
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