Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fzm-joying
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
lei
fzm-joying
Commits
b5d16b08
Commit
b5d16b08
authored
Jul 23, 2021
by
tangtuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改nft发行逻辑
parent
2d9bbf38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
CommemorateNftServiceImpl.java
...om/fzm/common/service/impl/CommemorateNftServiceImpl.java
+3
-2
NftServiceImpl.java
...main/java/com/fzm/common/service/impl/NftServiceImpl.java
+2
-2
No files found.
joying-common/src/main/java/com/fzm/common/service/impl/CommemorateNftServiceImpl.java
View file @
b5d16b08
...
...
@@ -89,12 +89,13 @@ public class CommemorateNftServiceImpl extends ServiceImpl<CommemorateNftMapper,
if
(
StringUtils
.
isBlank
(
tradeHash
))
{
throw
GlobalException
.
newException
(
ResultCode
.
PUBLISH_ERROR
,
"nft发行失败"
);
}
String
realHash
=
paraChainClient
.
getRealTxHashFromGrp
(
hash
);
// 确认交易结果
TxResult
txResult
=
paraChainClient
.
cycleConfirmTxWithHash
(
realHash
,
fals
e
,
1000
);
TxResult
txResult
=
paraChainClient
.
cycleConfirmTxWithHash
(
hash
,
tru
e
,
1000
);
if
(!
TxStatusEnum
.
SUCCESS
.
equals
(
txResult
.
getStatus
()))
{
throw
GlobalException
.
newException
(
ResultCode
.
PUBLISH_ERROR
,
txResult
.
getErrMsg
().
getValue
());
}
String
realHash
=
paraChainClient
.
getRealTxHashFromGrp
(
hash
);
commemorateNft
.
setNftHash
(
realHash
).
setTokenId
(
tokenId
).
setPublishTime
(
new
Date
());
save
(
commemorateNft
);
// 使用nft发行量作为Redisson信号量限制领取次数
...
...
joying-common/src/main/java/com/fzm/common/service/impl/NftServiceImpl.java
View file @
b5d16b08
...
...
@@ -111,7 +111,6 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
String
[]
split
=
txHash
.
split
(
"-"
);
String
hash
=
split
[
0
];
long
tokenId
=
Long
.
parseLong
(
split
[
1
]);
String
realHash
=
paraChainClient
.
getRealTxHashFromGrp
(
hash
);
Nft
nft
=
getById
(
nftDto
.
getId
());
// 构建上链信息
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
...
...
@@ -126,10 +125,11 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
throw
GlobalException
.
newException
(
ResultCode
.
PUBLISH_ERROR
,
"nft发行失败"
);
}
// 确认交易结果
TxResult
txResult
=
paraChainClient
.
cycleConfirmTxWithHash
(
realHash
,
fals
e
,
1000
);
TxResult
txResult
=
paraChainClient
.
cycleConfirmTxWithHash
(
hash
,
tru
e
,
1000
);
if
(!
TxStatusEnum
.
SUCCESS
.
equals
(
txResult
.
getStatus
()))
{
throw
GlobalException
.
newException
(
ResultCode
.
PUBLISH_ERROR
,
txResult
.
getErrMsg
().
getValue
());
}
String
realHash
=
paraChainClient
.
getRealTxHashFromGrp
(
hash
);
nft
.
setNftHash
(
realHash
);
nft
.
setTokenId
(
tokenId
);
nft
.
setPublishTime
(
new
Date
());
...
...
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