记得上下班打卡 | 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
1d967377
Commit
1d967377
authored
Mar 24, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化相关策略实现
parent
646deb65
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
134 additions
and
3 deletions
+134
-3
GalaxyErrorEnum.java
...om/liquidnet/service/galaxy/constant/GalaxyErrorEnum.java
+2
-1
GalaxyNftPublishResultQueryRespDto.java
.../galaxy/dto/param/GalaxyNftPublishResultQueryRespDto.java
+1
-1
ZxinPublishBiz.java
...uidnet/service/galaxy/router/zxin/biz/ZxinPublishBiz.java
+127
-0
GalaxyRouterStrategyZxlPublishImpl.java
...uter/zxin/service/GalaxyRouterStrategyZxlPublishImpl.java
+1
-1
TestZxlWalletSdkUtil.java
...va/com/liquidnet/service/galaxy/TestZxlWalletSdkUtil.java
+3
-0
No files found.
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/constant/GalaxyErrorEnum.java
View file @
1d967377
...
@@ -19,7 +19,8 @@ public enum GalaxyErrorEnum {
...
@@ -19,7 +19,8 @@ public enum GalaxyErrorEnum {
SERIES_NOT_EXIST
(
"NFT0010007"
,
"没有查询到该sku对应系列声明"
),
SERIES_NOT_EXIST
(
"NFT0010007"
,
"没有查询到该sku对应系列声明"
),
SERIES_CLAIM_PROCESSING
(
"NFT0010008"
,
"系列声明正在处理中,不允许重复声明!"
),
SERIES_CLAIM_PROCESSING
(
"NFT0010008"
,
"系列声明正在处理中,不允许重复声明!"
),
SERIES_CLAIM_SUCCESSED
(
"NFT0010009"
,
"系列已声明成功,不允许重复声明!"
),
SERIES_CLAIM_SUCCESSED
(
"NFT0010009"
,
"系列已声明成功,不允许重复声明!"
),
SERIES_CLAIM_NOT_EXIST
(
"NFT0010010"
,
"系列声明初始化信息不存在,请检查是否已上传对应素材!"
);
SERIES_CLAIM_NOT_EXIST
(
"NFT0010010"
,
"系列声明初始化信息不存在,请检查是否已上传对应素材!"
),
PUBLISH_ORDER_NOT_EXIST
(
"NFT0010011"
,
"NFT购买订单不存在!"
);
private
String
code
;
private
String
code
;
private
String
message
;
private
String
message
;
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/param/GalaxyNftPublishResultQueryRespDto.java
View file @
1d967377
...
@@ -45,7 +45,7 @@ public class GalaxyNftPublishResultQueryRespDto implements Serializable,Cloneabl
...
@@ -45,7 +45,7 @@ public class GalaxyNftPublishResultQueryRespDto implements Serializable,Cloneabl
* 链上交易时间戳
* 链上交易时间戳
*/
*/
@ApiModelProperty
(
position
=
3
,
required
=
true
,
value
=
"chainTimestamp"
)
@ApiModelProperty
(
position
=
3
,
required
=
true
,
value
=
"chainTimestamp"
)
private
Lo
ng
chainTimestamp
;
private
Stri
ng
chainTimestamp
;
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinPublishBiz.java
View file @
1d967377
...
@@ -6,6 +6,8 @@ import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum;
...
@@ -6,6 +6,8 @@ import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum;
import
com.liquidnet.common.third.zxlnft.dto.*
;
import
com.liquidnet.common.third.zxlnft.dto.*
;
import
com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil
;
import
com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil
;
import
com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil
;
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.IDGenerator
;
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
;
...
@@ -15,12 +17,16 @@ import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo;
...
@@ -15,12 +17,16 @@ import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryRespDto
;
import
com.liquidnet.service.galaxy.router.strategy.biz.GalaxyEnumBiz
;
import
com.liquidnet.service.galaxy.utils.DataUtils
;
import
com.liquidnet.service.galaxy.utils.DataUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @author AnJiabin <anjiabin@zhengzai.tv>
...
@@ -86,6 +92,127 @@ public class ZxinPublishBiz {
...
@@ -86,6 +92,127 @@ public class ZxinPublishBiz {
String
taskId
=
null
;
String
taskId
=
null
;
//查询系列信息
Nft032SeriesReqDto
nft032ReqDto
=
Nft032SeriesReqDto
.
getNew
();
nft032ReqDto
.
setSeriesId
(
seriesId
);
ZxlnftResponseDto
<
Nft032SeriesRespDto
>
resp
=
zxlnftSdkUtil
.
nft032Series
(
nft032ReqDto
);
if
(
resp
.
isSuccess
()){
//该系列已经发行多少个nft
Long
crtCount
=
resp
.
getData
().
getSeriesInfo
().
getCrtCount
();
log
.
info
(
"系列:{} 已发行 :{}"
,
seriesId
,
crtCount
);
//设置开始索引
seriesBeginIndex
=
Integer
.
parseInt
(
String
.
valueOf
(
crtCount
.
longValue
()
+
1
));
}
//3.1.2调用NFT发行接口
/**
* 发行无限制系列
*/
Nft034PublishReqDto
nft034ReqDto
=
Nft034PublishReqDto
.
getNew
();
nft034ReqDto
.
setAuthor
(
author
);
nft034ReqDto
.
setName
(
nftName
);
nft034ReqDto
.
setUrl
(
nftUrl
);
nft034ReqDto
.
setDisplayUrl
(
displayUrl
);
nft034ReqDto
.
setDesc
(
nftDesc
);
nft034ReqDto
.
setFlag
(
nftFlag
);
nft034ReqDto
.
setPublishCount
(
publishCount
);
//无限制零系列
nft034ReqDto
.
setSeriesId
(
seriesId
);
nft034ReqDto
.
setSeriesBeginIndex
(
seriesBeginIndex
);
nft034ReqDto
.
setSellStatus
(
Integer
.
parseInt
(
ZxlnftEnum
.
SellStatusEnum
.
CAN_SELL
.
getCode
()));
nft034ReqDto
.
setSellCount
(
sellCount
);
nft034ReqDto
.
setOperateId
(
IDGenerator
.
get32UUID
());
nft034ReqDto
.
setMetaData
(
""
);
ZxlnftResponseDto
<
Nft034PublishRespDto
>
nft034RespDto
=
zxlnftSdkUtil
.
nft034Publish
(
nft034ReqDto
);
if
(
nft034RespDto
.
isSuccess
())
{
taskId
=
nft034RespDto
.
getData
().
getTaskId
();
}
GalaxyNftPublishRespDto
nftPublishRespDto
=
GalaxyNftPublishRespDto
.
getNew
();
nftPublishRespDto
.
setUserId
(
reqDto
.
getUserId
());
nftPublishRespDto
.
setNftId
(
nftId
);
//构造缓存数据
if
(
nftOrderBo
==
null
){
nftOrderBo
=
GalaxyNftOrderBo
.
getNew
();
nftOrderBo
.
setUserId
(
userInfoBo
.
getUserId
());
nftOrderBo
.
setSkuId
(
reqDto
.
getSkuId
());
nftOrderBo
.
setSeriesName
(
seriesInfoBo
.
getSeriesName
());
nftOrderBo
.
setSeriesId
(
seriesInfoBo
.
getSeriesId
());
nftOrderBo
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
nftOrderBo
.
setNftId
(
nftId
);
nftOrderBo
.
setNftPrice
(
seriesInfoBo
.
getSellCount
().
longValue
());
nftOrderBo
.
setFromAddress
(
""
);
nftOrderBo
.
setToAddress
(
""
);
nftOrderBo
.
setNftPublishTaskId
(
taskId
);
dataUtils
.
setNftOrderBo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
(),
nftOrderBo
);
}
return
ResponseDto
.
success
(
nftPublishRespDto
);
}
public
ResponseDto
<
GalaxyNftPublishResultQueryRespDto
>
nftPublishResultQuery
(
GalaxyNftPublishResultQueryReqDto
reqDto
){
//获取订单信息
GalaxyNftOrderBo
nftOrderBo
=
dataUtils
.
getNftOrderBo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
());
if
(
StringUtil
.
isNull
(
nftOrderBo
)){
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
PUBLISH_ORDER_NOT_EXIST
.
getCode
(),
GalaxyErrorEnum
.
PUBLISH_ORDER_NOT_EXIST
.
getMessage
());
}
//3.1.4查询 NFT发行结果
Nft035PublishResultReqDto
nft035ReqDto
=
Nft035PublishResultReqDto
.
getNew
();
nft035ReqDto
.
setTaskId
(
nftOrderBo
.
getNftPublishTaskId
());
ZxlnftResponseDto
<
Nft035PublishResultRespDto
>
nft035RespDtoTemp
=
zxlnftSdkUtil
.
nft035PublishResult
(
nft035ReqDto
);
if
(
nft035RespDtoTemp
.
isSuccess
()){
GalaxyNftPublishResultQueryRespDto
nftPublishResultQueryRespDto
=
GalaxyNftPublishResultQueryRespDto
.
getNew
();
BeanUtil
.
copy
(
nft035RespDtoTemp
.
getData
(),
nftPublishResultQueryRespDto
);
String
nowTimeStr
=
DateUtil
.
format
(
new
Date
(
nft035RespDtoTemp
.
getData
().
getChainTimestamp
().
longValue
()*
1000
),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
);
//转换任务状态
Integer
taskStatus
=
Integer
.
valueOf
(
GalaxyEnumBiz
.
getTaskStatusEnum
(
reqDto
.
getRouterType
(),
nft035RespDtoTemp
.
getData
().
getTaskStatus
().
toString
()).
getCode
());
nftPublishResultQueryRespDto
.
setTaskStatus
(
taskStatus
);
nftPublishResultQueryRespDto
.
setChainTimestamp
(
nowTimeStr
);
return
ResponseDto
.
success
(
nftPublishResultQueryRespDto
);
}
else
{
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
PUBLISH_FAIL
.
getCode
(),
GalaxyErrorEnum
.
PUBLISH_FAIL
.
getMessage
());
}
}
public
ResponseDto
<
GalaxyNftPublishRespDto
>
nftPublishBackup
(
GalaxyNftPublishReqDto
reqDto
)
{
//获取订单信息
GalaxyNftOrderBo
nftOrderBo
=
dataUtils
.
getNftOrderBo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
());
if
(
StringUtil
.
isNotNull
(
nftOrderBo
)&&
StringUtil
.
isNotEmpty
(
nftOrderBo
.
getNftId
())){
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
PUBLISH_FAIL_ALREADY_EXIST
.
getCode
(),
GalaxyErrorEnum
.
PUBLISH_FAIL_ALREADY_EXIST
.
getMessage
());
}
//获取用户信息
GalaxyUserInfoBo
userInfoBo
=
dataUtils
.
getGalaxyUserInfo
(
reqDto
.
getRouterType
(),
reqDto
.
getUserId
());
//获取sku信息
GalaxySeriesInfoBo
seriesInfoBo
=
dataUtils
.
getSeriesInfoBo
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
());
String
author
=
seriesInfoBo
.
getAuthor
();
String
nftName
=
seriesInfoBo
.
getNftName
();
String
nftUrl
=
seriesInfoBo
.
getNftUrl
();
String
displayUrl
=
seriesInfoBo
.
getDisplayUrl
();
String
nftDesc
=
seriesInfoBo
.
getNftDesc
();
String
nftFlag
=
seriesInfoBo
.
getNftFlag
();
//发行个数
Long
publishCount
=
1L
;
//开始索引
Integer
seriesBeginIndex
=
0
;
Long
sellCount
=
Long
.
valueOf
(
seriesInfoBo
.
getSellCount
().
multiply
(
BigDecimal
.
valueOf
(
100
l
)).
longValue
());
//积分
/**
* 根据sku获取系列Id
*/
String
seriesId
=
seriesInfoBo
.
getSeriesId
();
//返回参数nftId
String
nftId
=
null
;
String
taskId
=
null
;
//查询系列信息
//查询系列信息
Nft032SeriesReqDto
nft032ReqDto
=
Nft032SeriesReqDto
.
getNew
();
Nft032SeriesReqDto
nft032ReqDto
=
Nft032SeriesReqDto
.
getNew
();
nft032ReqDto
.
setSeriesId
(
seriesId
);
nft032ReqDto
.
setSeriesId
(
seriesId
);
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/service/GalaxyRouterStrategyZxlPublishImpl.java
View file @
1d967377
...
@@ -36,6 +36,6 @@ public class GalaxyRouterStrategyZxlPublishImpl implements IGalaxyRouterStrategy
...
@@ -36,6 +36,6 @@ public class GalaxyRouterStrategyZxlPublishImpl implements IGalaxyRouterStrategy
@Override
@Override
public
ResponseDto
<
GalaxyNftPublishResultQueryRespDto
>
nftPublishResultQuery
(
GalaxyNftPublishResultQueryReqDto
reqDto
)
{
public
ResponseDto
<
GalaxyNftPublishResultQueryRespDto
>
nftPublishResultQuery
(
GalaxyNftPublishResultQueryReqDto
reqDto
)
{
return
null
;
return
zxinPublishBiz
.
nftPublishResultQuery
(
reqDto
)
;
}
}
}
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/test/java/com/liquidnet/service/galaxy/TestZxlWalletSdkUtil.java
View file @
1d967377
...
@@ -254,6 +254,9 @@ public class TestZxlWalletSdkUtil {
...
@@ -254,6 +254,9 @@ public class TestZxlWalletSdkUtil {
// String cosUrl = "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef//2022-02-24/ZXLNFTIMAGE202202241704292368452405.jpg";
// String cosUrl = "https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef//2022-02-24/ZXLNFTIMAGE202202241704292368452405.jpg";
cosUrl
=
"https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg"
;
cosUrl
=
"https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg"
;
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_124595.png"
;
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_124595.png"
;
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"
;
SM3HashEncodeReq
req
=
SM3HashEncodeReq
.
getNew
();
SM3HashEncodeReq
req
=
SM3HashEncodeReq
.
getNew
();
byte
[]
fileByteArray
=
zxlnftBiz
.
getNftFileByteArray
(
cosUrl
);
byte
[]
fileByteArray
=
zxlnftBiz
.
getNftFileByteArray
(
cosUrl
);
req
.
setData
(
fileByteArray
);
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