记得上下班打卡 | 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
e6d8d072
Commit
e6d8d072
authored
Mar 28, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交galaxy消费相关
parent
a91d90e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
23 deletions
+33
-23
mysql_db_ddl.sql
...alaxy/liquidnet-service-galaxy-impl/docu/mysql_db_ddl.sql
+2
-2
ZxinTradeBiz.java
...iquidnet/service/galaxy/router/zxin/biz/ZxinTradeBiz.java
+24
-8
DataUtils.java
...in/java/com/liquidnet/service/galaxy/utils/DataUtils.java
+0
-13
TestZxlWalletSdkUtil.java
...va/com/liquidnet/service/galaxy/TestZxlWalletSdkUtil.java
+7
-0
No files found.
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/docu/mysql_db_ddl.sql
View file @
e6d8d072
...
...
@@ -10,8 +10,8 @@ create table galaxy_user_info
mnemonic
varchar
(
200
)
COMMENT
'助记词'
,
mnemonic_index
varchar
(
3
)
NOT
NULL
DEFAULT
'0'
COMMENT
'助记词索引'
,
user_identification
varchar
(
200
)
COMMENT
'用户链上唯一ID'
,
user_pub_key
varchar
(
2
00
)
COMMENT
'用户公钥'
,
user_pri_key
varchar
(
2
00
)
COMMENT
'用户私钥'
,
user_pub_key
varchar
(
5
00
)
COMMENT
'用户公钥'
,
user_pri_key
varchar
(
5
00
)
COMMENT
'用户私钥'
,
block_chain_address
varchar
(
200
)
COMMENT
'区块链地址'
,
router_type
varchar
(
200
)
NOT
NULL
COMMENT
'路由类型(zxinchain、eth、antchain)'
,
created_at
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinTradeBiz.java
View file @
e6d8d072
...
...
@@ -7,10 +7,7 @@ import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum;
import
com.liquidnet.common.third.zxlnft.dto.*
;
import
com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil
;
import
com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.constant.GalaxyErrorEnum
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo
;
...
...
@@ -23,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.io.UnsupportedEncodingException
;
import
java.math.BigDecimal
;
import
java.util.Date
;
...
...
@@ -280,7 +278,11 @@ public class ZxinTradeBiz {
Nft043BuyReqDto
nft043BuyReqDto
=
Nft043BuyReqDto
.
getNew
();
nft043BuyReqDto
.
setNftId
(
nftId
);
nft043BuyReqDto
.
setApplyScore
(
seriesInfoBo
.
getSellCount
().
intValue
());
nft043BuyReqDto
.
setReceiverPubKey
(
userInfoBo
.
getUserPubKey
());
try
{
nft043BuyReqDto
.
setReceiverPubKey
(
BASE64Util
.
decode
(
userInfoBo
.
getUserPubKey
()));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
nft043BuyReqDto
.
setPointReceiverAddr
(
userInfoBo
.
getBlockChainAddress
());
nft043BuyReqDto
.
setOfferCount
(
seriesInfoBo
.
getSellCount
().
longValue
());
nft043BuyReqDto
.
setOperateId
(
IDGenerator
.
get32UUID
());
...
...
@@ -297,7 +299,12 @@ public class ZxinTradeBiz {
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getNftId
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOfferCount
().
toString
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOperateId
());
String
signature
=
zxlnftBiz
.
createSign
(
userInfoBo
.
getUserPriKey
(),
signMetaData
);
String
signature
=
null
;
try
{
signature
=
zxlnftBiz
.
createSign
(
BASE64Util
.
decode
(
userInfoBo
.
getUserPriKey
()),
signMetaData
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
nft043BuyReqDto
.
setSignature
(
signature
);
String
nftBuyTaskId
=
null
;
...
...
@@ -330,7 +337,11 @@ public class ZxinTradeBiz {
Nft043BuyReqDto
nft043BuyReqDto
=
Nft043BuyReqDto
.
getNew
();
nft043BuyReqDto
.
setNftId
(
nftId
);
nft043BuyReqDto
.
setApplyScore
(
seriesInfoBo
.
getSellCount
().
intValue
());
nft043BuyReqDto
.
setReceiverPubKey
(
userInfoBo
.
getUserPubKey
());
try
{
nft043BuyReqDto
.
setReceiverPubKey
(
BASE64Util
.
decode
(
userInfoBo
.
getUserPubKey
()));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
nft043BuyReqDto
.
setPointReceiverAddr
(
userInfoBo
.
getBlockChainAddress
());
nft043BuyReqDto
.
setOfferCount
(
seriesInfoBo
.
getSellCount
().
longValue
());
nft043BuyReqDto
.
setOperateId
(
IDGenerator
.
get32UUID
());
...
...
@@ -347,7 +358,12 @@ public class ZxinTradeBiz {
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getNftId
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOfferCount
().
toString
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOperateId
());
String
signature
=
zxlnftBiz
.
createSign
(
userInfoBo
.
getUserPriKey
(),
signMetaData
);
String
signature
=
null
;
try
{
signature
=
zxlnftBiz
.
createSign
(
BASE64Util
.
decode
(
userInfoBo
.
getUserPriKey
()),
signMetaData
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
nft043BuyReqDto
.
setSignature
(
signature
);
ZxlnftResponseDto
<
Nft043BuyRespDto
>
nft043RespDto
=
zxlnftSdkUtil
.
nft043Buy
(
nft043BuyReqDto
);
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/utils/DataUtils.java
View file @
e6d8d072
package
com
.
liquidnet
.
service
.
galaxy
.
utils
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.BASE64Util
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
...
...
@@ -26,7 +25,6 @@ import org.springframework.data.mongodb.core.query.Query;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.stereotype.Component
;
import
java.io.UnsupportedEncodingException
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
...
...
@@ -50,17 +48,6 @@ public class DataUtils {
//入库mongo
GalaxyUserInfoVo
userInfoVo
=
GalaxyUserInfoVo
.
getNew
();
BeanUtil
.
copy
(
userInfoBo
,
userInfoVo
);
//保持原始base64编码存储
try
{
userInfoVo
.
setUserPubKey
(
BASE64Util
.
encoded
(
userInfoBo
.
getUserPubKey
()));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
try
{
userInfoVo
.
setUserPriKey
(
BASE64Util
.
encoded
(
userInfoBo
.
getUserPriKey
()));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
userInfoVo
.
setCreatedAt
(
LocalDateTime
.
now
());
mongoTemplate
.
save
(
userInfoVo
,
GalaxyUserInfoVo
.
class
.
getSimpleName
());
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/test/java/com/liquidnet/service/galaxy/TestZxlWalletSdkUtil.java
View file @
e6d8d072
...
...
@@ -257,6 +257,13 @@ public class TestZxlWalletSdkUtil {
cosUrl
=
"https://nft-user-1255940152.file.myqcloud.com/nft/5867f50e40075319f8bc0bdca59967414d1d9046a4d3c1aaf9bdd8199bb46e4a/0d2d845b56feee933c705786add60b5f12f2909ffcfa7a6b23e58d47a83918cf/%E7%82%AB%E8%BF%882022%E5%AD%A3%E8%8A%82%E7%8F%8D%E8%97%8F%E7%89%88%E6%96%B0%E4%B8%8A%E5%B8%82%E7%B3%BB%E5%88%97/nft_img_20220308_126193.png"
;
cosUrl
=
"https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/NOW_ZXL_NFT_PIC_skuId001/2022-03-04/ZXLNFTIMAGE202203041742464921866377.jpg"
;
//bingbingcangpin
cosUrl
=
"https://nft-user-1255940152.cos.ap-guangzhou.myqcloud.com/nft/3faf86686c80bf7a63700b11d9683ef90778f9162feb6b49265afecaedc68eba/%E3%80%8A%E5%A4%A9%E5%A0%82%E3%80%8B25%E5%91%A8%E5%B9%B4%E7%BA%AA%E5%BF%B5%E6%95%B0%E5%AD%97%E9%BB%91%E8%83%B6/%E3%80%8A%E5%A4%A9%E5%A0%82%E3%80%8B%E6%95%B0%E5%AD%97%E9%BB%91%E8%83%B6%E4%BA%8C%E6%AC%BE.mp4"
;
cosUrl
=
"https://nft-user-1255940152.cos.ap-guangzhou.myqcloud.com/nft/3faf86686c80bf7a63700b11d9683ef90778f9162feb6b49265afecaedc68eba/%E3%80%8A%E5%A4%A9%E5%A0%82%E3%80%8B25%E5%91%A8%E5%B9%B4%E7%BA%AA%E5%BF%B5%E6%95%B0%E5%AD%97%E9%BB%91%E8%83%B6/%E3%80%8A%E5%A4%A9%E5%A0%82%E3%80%8B%E6%95%B0%E5%AD%97%E9%BB%91%E8%83%B6%E4%BA%94%E6%AC%BE.mp4"
;
// cosUrl = "https://nft-user-1255940152.cos.ap-guangzhou.myqcloud.com/nft/3faf86686c80bf7a63700b11d9683ef90778f9162feb6b49265afecaedc68eba/%E3%80%8A%E5%A4%A9%E5%A0%82%E3%80%8B25%E5%91%A8%E5%B9%B4%E7%BA%AA%E5%BF%B5%E6%95%B0%E5%AD%97%E9%BB%91%E8%83%B6/%E3%80%8A%E5%A4%A9%E5%A0%82%E3%80%8B%E6%95%B0%E5%AD%97%E9%BB%91%E8%83%B6%E5%9B%9B%E6%AC%BE.mp4";
SM3HashEncodeReq
req
=
SM3HashEncodeReq
.
getNew
();
byte
[]
fileByteArray
=
zxlnftBiz
.
getNftFileByteArray
(
cosUrl
);
req
.
setData
(
fileByteArray
);
...
...
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