记得上下班打卡 | 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
c67a9d7b
Commit
c67a9d7b
authored
Mar 17, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改购买逻辑
parent
4dabc3ae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
1 deletion
+73
-1
ZxinPublishBiz.java
...uidnet/service/galaxy/router/zxin/biz/ZxinPublishBiz.java
+71
-0
bootstrap-dev.yml
...-service-galaxy-impl/src/main/resources/bootstrap-dev.yml
+2
-1
No files found.
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinPublishBiz.java
View file @
c67a9d7b
...
...
@@ -173,4 +173,75 @@ public class ZxinPublishBiz {
}
return
null
;
}
public
void
nftBuyBuss
(
GalaxyUserInfoBo
userInfoBo
,
GalaxySeriesInfoBo
seriesInfoBo
){
// 3.2.1调用积分申请接口
// 3.2.2调用购买NFT接口
Nft043BuyReqDto
nft043BuyReqDto
=
Nft043BuyReqDto
.
getNew
();
// reqDto.setNftId("7f73aca56caaf57a20f0afff59318528f0f09ffbf028fe882161d3ce599d2854_1");
// nft043BuyReqDto.setNftId("08c152e5fa467d28b7add8e408fb3ecd1ed2ff209364adc1e394bde53929df8f_1");
nft043BuyReqDto
.
setNftId
(
"43c169ae33d2ca5390a49d2319c14223ed5e7447c4b40c0422ef81691ddfee89_4"
);
nft043BuyReqDto
.
setApplyScore
(
seriesInfoBo
.
getSellCount
().
intValue
());
nft043BuyReqDto
.
setReceiverPubKey
(
userInfoBo
.
getUserPubKey
());
nft043BuyReqDto
.
setPointReceiverAddr
(
userInfoBo
.
getBlockChainAddress
());
nft043BuyReqDto
.
setOfferCount
(
seriesInfoBo
.
getSellCount
().
longValue
());
nft043BuyReqDto
.
setOperateId
(
IDGenerator
.
get32UUID
());
/**
* 接收人的私钥签名,签名对象是(platformPubKey_receiverPubKey_pointReceiverAddr_applyScore_接口名_nftId_offerCount_operateId)
* 接口名:buy_nft
*/
String
signMetaData
=
zxlnftConfig
.
getNftPlatformPubKey
()
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getReceiverPubKey
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getPointReceiverAddr
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getApplyScore
().
toString
())
.
concat
(
"_"
).
concat
(
"buy_nft"
)
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getNftId
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOfferCount
().
toString
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOperateId
());
String
signature
=
zxlnftBiz
.
createSign
(
userInfoBo
.
getUserPriKey
(),
signMetaData
);
nft043BuyReqDto
.
setSignature
(
signature
);
ZxlnftResponseDto
<
Nft043BuyRespDto
>
nft043RespDto
=
zxlnftSdkUtil
.
nft043Buy
(
nft043BuyReqDto
);
if
(
nft043RespDto
.
isSuccess
()){
//3.2.4查询NFT购买结果
Nft044BuyResultReqDto
nft044ReqDto
=
Nft044BuyResultReqDto
.
getNew
();
nft044ReqDto
.
setTaskId
(
nft043RespDto
.
getData
().
getTaskId
());
long
timeStart
=
System
.
currentTimeMillis
();
ZxlnftResponseDto
<
Nft044BuyResultRespDto
>
nft044RespDto
=
zxlnftSdkUtil
.
nft044BuyResult
(
nft044ReqDto
);
if
(
nft044RespDto
.
isSuccess
()){
int
count
=
1
;
String
payTaskId
=
null
;
while
(
payTaskId
==
null
){
try
{
Thread
.
sleep
(
1000
l
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
count
++;
log
.
info
(
"=======执行第{}次查询,taskId:{}"
,
1
,
nft044ReqDto
.
getTaskId
());
ZxlnftResponseDto
<
Nft044BuyResultRespDto
>
nft044RespDtoTemp
=
zxlnftSdkUtil
.
nft044BuyResult
(
nft044ReqDto
);
if
(
nft044RespDtoTemp
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())){
payTaskId
=
nft044RespDtoTemp
.
getData
().
getPayTaskId
();
}
else
if
(
nft044RespDtoTemp
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_FAIL
.
getCode
())){
log
.
info
(
"任务执行失败!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
return
;
}
if
(
count
==
6
){
log
.
info
(
"=======查询共6次,跳出循环!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
break
;
}
}
log
.
info
(
"总共执行了多少次查询:{} 总耗时:{}"
,
count
,
System
.
currentTimeMillis
()
-
timeStart
);
if
(
StringUtil
.
isNotEmpty
(
payTaskId
)){
//3.2.5查询NFT购买支付结果
Nft045BuyPayResultReqDto
nft045ReqDto
=
Nft045BuyPayResultReqDto
.
getNew
();
nft045ReqDto
.
setTaskId
(
payTaskId
);
ZxlnftResponseDto
<
Nft045BuyPayResultRespDto
>
nft045RespDto
=
zxlnftSdkUtil
.
nft045BuyPayResult
(
nft045ReqDto
);
}
}
}
}
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/resources/bootstrap-dev.yml
View file @
c67a9d7b
...
...
@@ -6,7 +6,8 @@ liquidnet:
username
:
user
password
:
user123
eureka
:
host
:
172.17.192.42:7001
# host: 172.17.192.42:7001
host
:
127.0.0.1:7001
# end-dev-这里是配置信息基本值
spring
:
...
...
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