记得上下班打卡 | 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
48edea42
Commit
48edea42
authored
Aug 15, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现百度链转让接口
parent
26d4b13a
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
643 additions
and
183 deletions
+643
-183
GalaxyEnum.java
...ava/com/liquidnet/service/galaxy/constant/GalaxyEnum.java
+37
-0
GalaxyErrorEnum.java
...om/liquidnet/service/galaxy/constant/GalaxyErrorEnum.java
+6
-2
GalaxyTransferNftInfoBo.java
...uidnet/service/galaxy/dto/bo/GalaxyTransferNftInfoBo.java
+37
-4
GalaxyNftTransferQueryReqDto.java
...ervice/galaxy/dto/param/GalaxyNftTransferQueryReqDto.java
+9
-2
GalaxyNftTransferQueryRespDto.java
...rvice/galaxy/dto/param/GalaxyNftTransferQueryRespDto.java
+22
-4
GalaxyNftTransferRespDto.java
...et/service/galaxy/dto/param/GalaxyNftTransferRespDto.java
+16
-1
pom.xml
...quidnet-common-third/liquidnet-common-third-xuper/pom.xml
+1
-1
Xuper010QuerySdsRespDto.java
...idnet/common/third/xuper/dto/Xuper010QuerySdsRespDto.java
+1
-1
Xuper011ListSdsByAddrReqDto.java
...t/common/third/xuper/dto/Xuper011ListSdsByAddrReqDto.java
+4
-2
Xuper013HistoryReqDto.java
...quidnet/common/third/xuper/dto/Xuper013HistoryReqDto.java
+8
-4
Xuper013HistoryRespDto.java
...uidnet/common/third/xuper/dto/Xuper013HistoryRespDto.java
+68
-5
XuperSdkUtil.java
...a/com/liquidnet/common/third/xuper/util/XuperSdkUtil.java
+37
-32
GalaxyBeanTransferBiz.java
...m/liquidnet/service/galaxy/biz/GalaxyBeanTransferBiz.java
+49
-0
AbstractDataUtils.java
...com/liquidnet/service/galaxy/utils/AbstractDataUtils.java
+48
-0
GalaxyTradeController.java
...dnet/service/galaxy/controller/GalaxyTradeController.java
+0
-10
XuperTradeBiz.java
...uidnet/service/galaxy/router/xuper/biz/XuperTradeBiz.java
+194
-5
GalaxyRouterStrategyXuperTradeImpl.java
...ter/xuper/service/GalaxyRouterStrategyXuperTradeImpl.java
+0
-3
GalaxyRouterStrategyZxlTradeImpl.java
...router/zxin/service/GalaxyRouterStrategyZxlTradeImpl.java
+1
-12
GalaxyTradeServiceImpl.java
...t/service/galaxy/service/impl/GalaxyTradeServiceImpl.java
+20
-2
TestXuperSdkUtil.java
...liquidnet/service/goblin/test/xuper/TestXuperSdkUtil.java
+85
-93
No files found.
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/constant/GalaxyEnum.java
View file @
48edea42
...
...
@@ -336,4 +336,41 @@ public class GalaxyEnum {
System
.
out
.
println
(
"支付成功"
);
}
}
/**
* nft转让状态
*/
public
enum
NftTransferStatusEnum
{
INIT
(
"-1"
,
"数据初始化"
),
PROCESSING
(
"0"
,
"转让中"
),
SUCCESS
(
"1"
,
"转让成功"
),
FAIL
(
"2"
,
"转让失败"
);
private
String
code
;
private
String
message
;
NftTransferStatusEnum
(
String
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
public
NftTransferStatusEnum
getEnumByCode
(
String
code
){
NftTransferStatusEnum
[]
arry
=
NftTransferStatusEnum
.
values
();
for
(
int
i
=
0
;
i
<
arry
.
length
;
i
++)
{
if
(
arry
[
i
].
getCode
().
equals
(
code
))
{
return
arry
[
i
];
}
}
return
null
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getMessage
(){
return
message
;
}
}
}
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/constant/GalaxyErrorEnum.java
View file @
48edea42
...
...
@@ -36,8 +36,12 @@ public enum GalaxyErrorEnum {
SERIES_NFT_INFO_NOT_EXIST
(
"NFT0010024"
,
"系列NFT信息查询不存在!"
),
SERIES_NFT_HASH_CREATE_FAIL
(
"NFT0010025"
,
"系列NFT的介质hash生成失败!"
),
NFT_TRANSFER_FAIL
(
"NFT0010026"
,
"NFT转让失败"
),
NFT_TRANSFER_OWNER_ERROR
(
"NFT0010027"
,
"NFT转让失败,拥有者不匹配"
),
NFT_TRANSFERING_ERROR
(
"NFT0010028"
,
"NFT正在转让中,不允许再次操作!"
);
NFT_TRANSFER_FAIL_OWNER_NOT_EXIST
(
"NFT0010027"
,
"NFT转让失败,拥有者不存在!"
),
NFT_TRANSFER_FAIL_RECEIVER_NOT_EXIST
(
"NFT0010028"
,
"NFT转让失败,接收者不存在!"
),
NFT_TRANSFER_OWNER_MATCH_ERROR
(
"NFT0010029"
,
"NFT转让失败,拥有者不匹配"
),
NFT_TRANSFERING_ERROR
(
"NFT0010030"
,
"NFT正在转让中,不允许再次操作!"
),
NFT_TRANSFER_NFTID_FORMAT_ERROR
(
"NFT0010031"
,
"NFT转让失败,nftid格式错误!"
),
NFT_TRANSFER_QUERY_ERROR
(
"NFT0010032"
,
"NFT转让结果查询失败,nft信息不存在!"
);
private
String
code
;
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/bo/GalaxyTransferNftInfoBo.java
View file @
48edea42
...
...
@@ -21,13 +21,33 @@ public class GalaxyTransferNftInfoBo implements Serializable,Cloneable{
*/
private
String
nftId
;
/**
*
nft当前拥有者addr
*
转让发起人用户id
*/
private
String
ownerAddr
;
private
String
userId
;
/**
*
nft历史拥有者addr
*
转让发起人区块链地址
*/
private
String
fromAddr
;
private
String
address
;
/**
* 接收者userId
*/
private
String
receiveUserId
;
/**
* 接收者区块链地址
*/
private
String
receiveAddress
;
/**
* nft当前拥有者用户id(转让成功后更新)
*/
private
String
ownerUserId
;
/**
* nft当前拥有者addr(转让成功后更新)
*/
private
String
ownerAddress
;
/**
* 转让hash
*/
private
String
transferHash
;
/**
* 系列的唯一Id
*/
...
...
@@ -36,6 +56,19 @@ public class GalaxyTransferNftInfoBo implements Serializable,Cloneable{
* 路由类型
*/
private
String
routerType
;
/**
* 转让状态(0转让中 1转让成功 2转让失败 )
*/
private
String
transferStatus
;
/**
* 错误码
*/
private
String
errorCode
;
/**
* 错误信息
*/
private
String
errorMsg
;
/**
* 创建时间
*/
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/param/GalaxyNftTransferQueryReqDto.java
View file @
48edea42
...
...
@@ -16,19 +16,26 @@ import java.io.Serializable;
* @class: GalaxyNftTransferReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/8/
4 18
:42
* @date 2022/8/
15 14
:42
*/
@ApiModel
(
value
=
"GalaxyNftTransferQueryReqDto"
,
description
=
"NFT转让结果查询"
)
@Data
public
class
GalaxyNftTransferQueryReqDto
extends
GalaxyBaseReqDto
implements
Serializable
,
Cloneable
{
/**
*
以下为发行参数***********************************
*
用户id
*/
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"用户ID[30]"
)
@NotBlank
(
message
=
"用户ID不能为空!"
)
@Size
(
min
=
1
,
max
=
30
,
message
=
"用户ID限制2-30位且不能包含特殊字符"
)
private
String
userId
;
/**
* nftId
*/
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"nft唯一id"
)
@NotBlank
(
message
=
"nft唯一id不能为空!"
)
private
String
nftId
;
@Override
public
String
toString
(){
return
JsonUtils
.
toJson
(
this
);
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/param/GalaxyNftTransferQueryRespDto.java
View file @
48edea42
...
...
@@ -19,12 +19,30 @@ import java.io.Serializable;
@ApiModel
(
value
=
"GalaxyNftTransferQueryRespDto"
,
description
=
"NFT转让结果查询"
)
@Data
public
class
GalaxyNftTransferQueryRespDto
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"用户Id"
)
private
String
userId
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"用户购买的nftId"
)
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"nft唯一id"
)
private
String
nftId
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"拥有者用户ID"
)
private
String
ownerUserId
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"拥有者地址"
)
private
String
ownerAddress
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"转出者用户ID"
)
private
String
fromUserId
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"转出者地址"
)
private
String
fromAddress
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"转让时间"
)
private
String
transferTime
;
@ApiModelProperty
(
position
=
3
,
required
=
true
,
value
=
"路由类型"
)
private
String
routerType
;
@ApiModelProperty
(
position
=
4
,
required
=
true
,
value
=
"转让hash"
)
private
String
transferHash
;
@Override
public
String
toString
(){
return
JsonUtils
.
toJson
(
this
);
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/param/GalaxyNftTransferRespDto.java
View file @
48edea42
...
...
@@ -19,15 +19,30 @@ import java.io.Serializable;
@ApiModel
(
value
=
"GalaxyNftTransferRespDto"
,
description
=
"NFT转让结果"
)
@Data
public
class
GalaxyNftTransferRespDto
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"nft唯一id"
)
private
String
nftId
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"拥有者用户ID"
)
private
String
ownerUserId
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"转让者用户ID"
)
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"拥有者地址"
)
private
String
ownerAddress
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"转出者用户ID"
)
private
String
fromUserId
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"转出者地址"
)
private
String
fromAddress
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"转让时间"
)
private
String
transferTime
;
@ApiModelProperty
(
position
=
3
,
required
=
true
,
value
=
"路由类型"
)
private
String
routerType
;
@ApiModelProperty
(
position
=
4
,
required
=
true
,
value
=
"转让hash"
)
private
String
transferHash
;
@Override
public
String
toString
(){
return
JsonUtils
.
toJson
(
this
);
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/pom.xml
View file @
48edea42
...
...
@@ -35,7 +35,7 @@
<dependency>
<groupId>
com.baidu.xuper
</groupId>
<artifactId>
xasset-sdk-java
</artifactId>
<version>
1.0.
4
</version>
<version>
1.0.
7
</version>
</dependency>
<dependency>
<groupId>
com.baidu.xuper
</groupId>
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper010QuerySdsRespDto.java
View file @
48edea42
...
...
@@ -25,7 +25,7 @@ public class Xuper010QuerySdsRespDto {
public
String
ownerAddr
;
public
long
uid
;
public
long
price
;
public
int
status
;
public
int
status
;
//0:已上链 1:授予中 4:转移中 5: 核销中 6: 已核销 10:异常详情参考错误码和状态码
public
String
txId
;
public
ShardAssetInfo
assetInfo
;
public
long
ctime
;
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper011ListSdsByAddrReqDto.java
View file @
48edea42
...
...
@@ -16,9 +16,11 @@ public class Xuper011ListSdsByAddrReqDto {
//要拉取的区块链账户地址
private
String
addr
=
""
;
//要拉取页数,第一页为1
private
int
page
=
1
;
private
Integer
page
=
1
;
//每页拉取数量,默认20,最大50(可选)
private
int
limit
=
50
;
private
Integer
limit
=
50
;
//资产id
private
Long
assetId
;
private
static
final
Xuper011ListSdsByAddrReqDto
obj
=
new
Xuper011ListSdsByAddrReqDto
();
public
static
Xuper011ListSdsByAddrReqDto
getNew
()
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper013HistoryReqDto.java
View file @
48edea42
...
...
@@ -6,7 +6,7 @@ import lombok.Data;
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 拉取数字商品历史登记记录
* @class: Xuper0
01GetStoken
ReqDto
* @class: Xuper0
13History
ReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
...
...
@@ -14,11 +14,15 @@ import lombok.Data;
@Data
public
class
Xuper013HistoryReqDto
{
//资产id
private
l
ong
assetId
;
private
L
ong
assetId
;
//要拉取页数,第一页为1
private
int
page
=
1
;
private
Integer
page
=
1
;
//每页拉取数量,默认20,最大50(可选)
private
int
limit
=
20
;
private
Integer
limit
=
20
;
/**
* 碎片id
*/
private
Long
shardId
;
private
static
final
Xuper013HistoryReqDto
obj
=
new
Xuper013HistoryReqDto
();
public
static
Xuper013HistoryReqDto
getNew
()
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper013HistoryRespDto.java
View file @
48edea42
...
...
@@ -8,21 +8,20 @@ import java.util.ArrayList;
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 拉取数字商品历史登记记录
* @class: Xuper0
01GetStokenReq
Dto
* @class: Xuper0
13HistoryResp
Dto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/
4/18 15:1
0
* @date 2022/
8/12 17:5
0
*/
@Data
public
class
Xuper013HistoryRespDto
{
public
long
requestId
;
public
int
errNo
;
public
String
errMsg
;
public
ArrayList
<
AssetInfo
>
list
;
public
ArrayList
<
History
>
list
;
public
int
totalCnt
;
@Data
public
static
class
AssetInfo
{
public
static
class
History
{
public
long
assetId
;
public
long
type
;
public
long
shardId
;
...
...
@@ -31,6 +30,70 @@ public class Xuper013HistoryRespDto {
public
String
from
;
public
String
to
;
public
long
ctime
;
public
long
getAssetId
()
{
return
assetId
;
}
public
void
setAssetId
(
long
assetId
)
{
this
.
assetId
=
assetId
;
}
public
long
getType
()
{
return
type
;
}
public
void
setType
(
long
type
)
{
this
.
type
=
type
;
}
public
long
getShardId
()
{
return
shardId
;
}
public
void
setShardId
(
long
shardId
)
{
this
.
shardId
=
shardId
;
}
public
long
getPrice
()
{
return
price
;
}
public
void
setPrice
(
long
price
)
{
this
.
price
=
price
;
}
public
String
getTxId
()
{
return
txId
;
}
public
void
setTxId
(
String
txId
)
{
this
.
txId
=
txId
;
}
public
String
getFrom
()
{
return
from
;
}
public
void
setFrom
(
String
from
)
{
this
.
from
=
from
;
}
public
String
getTo
()
{
return
to
;
}
public
void
setTo
(
String
to
)
{
this
.
to
=
to
;
}
public
long
getCtime
()
{
return
ctime
;
}
public
void
setCtime
(
long
ctime
)
{
this
.
ctime
=
ctime
;
}
}
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/util/XuperSdkUtil.java
View file @
48edea42
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/biz/GalaxyBeanTransferBiz.java
View file @
48edea42
...
...
@@ -6,8 +6,11 @@ import com.liquidnet.commons.lang.util.StringUtil;
import
com.liquidnet.service.galaxy.constant.GalaxyEnum
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyTransferNftInfoBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftTransferReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftTransferRespDto
;
import
com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftOrderFailLogVo
;
import
com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftTradeVo
;
import
com.liquidnet.service.galaxy.utils.GalaxyDataUtils
;
...
...
@@ -136,4 +139,50 @@ public class GalaxyBeanTransferBiz {
nftTradeVo
.
setCreatedAt
(
DateUtil
.
getNowTime
());
return
nftTradeVo
;
}
/**
* 构造nft转让信息
* @param reqDto
* @param userInfoBo
* @param receiveUserInfoBo
* @return
*/
public
GalaxyTransferNftInfoBo
buildTransferNftInfoBo
(
GalaxyNftTransferReqDto
reqDto
,
GalaxyUserInfoBo
userInfoBo
,
GalaxyUserInfoBo
receiveUserInfoBo
){
GalaxyTransferNftInfoBo
transferNftInfoBo
=
GalaxyTransferNftInfoBo
.
getNew
();
transferNftInfoBo
.
setNftId
(
reqDto
.
getNftId
());
transferNftInfoBo
.
setUserId
(
reqDto
.
getUserId
());
transferNftInfoBo
.
setAddress
(
userInfoBo
.
getBlockChainAddress
());
transferNftInfoBo
.
setReceiveUserId
(
reqDto
.
getReceiveUserId
());
transferNftInfoBo
.
setReceiveAddress
(
receiveUserInfoBo
.
getBlockChainAddress
());
transferNftInfoBo
.
setOwnerUserId
(
null
);
transferNftInfoBo
.
setOwnerAddress
(
null
);
transferNftInfoBo
.
setSeriesId
(
null
);
transferNftInfoBo
.
setRouterType
(
reqDto
.
getRouterType
());
transferNftInfoBo
.
setTransferStatus
(
GalaxyEnum
.
NftTransferStatusEnum
.
INIT
.
getCode
());
transferNftInfoBo
.
setTransferHash
(
null
);
transferNftInfoBo
.
setErrorCode
(
null
);
transferNftInfoBo
.
setErrorMsg
(
null
);
transferNftInfoBo
.
setCreatedAt
(
DateUtil
.
getNowTime
());
transferNftInfoBo
.
setUpdatedAt
(
null
);
return
transferNftInfoBo
;
}
/**
* 构造nft转让返回结果
* @param reqDto
* @param userInfoBo
* @param receiveUserInfoBo
* @return
*/
public
GalaxyNftTransferRespDto
buildNftTransferRespDto
(
GalaxyNftTransferReqDto
reqDto
,
GalaxyUserInfoBo
userInfoBo
,
GalaxyUserInfoBo
receiveUserInfoBo
,
GalaxyTransferNftInfoBo
transferNftInfoBo
){
GalaxyNftTransferRespDto
respDto
=
GalaxyNftTransferRespDto
.
getNew
();
respDto
.
setNftId
(
reqDto
.
getNftId
());
respDto
.
setOwnerUserId
(
receiveUserInfoBo
.
getUserId
());
respDto
.
setOwnerAddress
(
receiveUserInfoBo
.
getBlockChainAddress
());
respDto
.
setFromUserId
(
userInfoBo
.
getUserId
());
respDto
.
setFromAddress
(
userInfoBo
.
getBlockChainAddress
());
respDto
.
setTransferTime
(
DateUtil
.
getNowTime
());
respDto
.
setTransferHash
(
transferNftInfoBo
.
getTransferHash
());
return
respDto
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/utils/AbstractDataUtils.java
View file @
48edea42
...
...
@@ -532,4 +532,52 @@ public abstract class AbstractDataUtils {
}
return
null
;
}
/**
* 创建nft转让信息
* @param routerType
* @param nftId
* @param transferNftInfoBo
*/
public
void
setGalaxyTransferNftInfoBo
(
String
routerType
,
String
nftId
,
GalaxyTransferNftInfoBo
transferNftInfoBo
)
{
this
.
getRedisUtil
().
set
(
GalaxyConstant
.
REDIS_KEY_GALAXY_TRANSFER_NFTID
.
concat
(
routerType
).
concat
(
":"
)
+
nftId
,
transferNftInfoBo
);
}
/**
* 获取nft转让信息
* @param routerType
* @param nftId
* @return
*/
public
GalaxyTransferNftInfoBo
getGalaxyTransferNftInfoBo
(
String
routerType
,
String
nftId
)
{
String
redisKey
=
GalaxyConstant
.
REDIS_KEY_GALAXY_TRANSFER_NFTID
.
concat
(
routerType
).
concat
(
":"
)
+
nftId
;
Object
obj
=
this
.
getRedisUtil
().
get
(
redisKey
);
if
(
obj
!=
null
){
return
(
GalaxyTransferNftInfoBo
)
obj
;
}
return
null
;
}
/**
* 更新nft转移信息
* @param routerType
* @param nftId
* @param transferNftInfoBo
*/
public
void
updateTransferNftInfoBo
(
String
routerType
,
String
nftId
,
GalaxyTransferNftInfoBo
transferNftInfoBo
)
{
this
.
getRedisUtil
().
set
(
GalaxyConstant
.
REDIS_KEY_GALAXY_TRANSFER_NFTID
.
concat
(
routerType
).
concat
(
":"
)
+
nftId
,
transferNftInfoBo
);
// try{
// this.getQueueUtil().sendMySqlRedis(
// SqlMapping.get("galaxy_nft_order_info.updateNftBuyInfo"),
// new Object[]{nftOrderBo.getNftBuyTaskId(),nftOrderBo.getNftBuyChainTimestamp(),nftOrderBo.getNftBuyStatus()
// ,nftOrderBo.getNftBuyTradeHash(),nftOrderBo.getNftBuyPayTaskId()
// ,LocalDateTime.now(),nftOrderBo.getNftOrderPayId()}
// , MQConst.GalaxyQueue.SQL_NFT_ORDER_INFO.getKey()
// );
// }catch(Exception e){
// log.error(e.getMessage(),e);
// log.error("#setNftTradeInfo error ==> MESSAGE:{}",e.getMessage());
// }
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/controller/GalaxyTradeController.java
View file @
48edea42
...
...
@@ -64,11 +64,6 @@ public class GalaxyTradeController {
@ApiOperation
(
value
=
"NFT发行购买结果查询"
)
@PostMapping
(
value
=
{
"nftPublishAndBuyResultQuery"
})
public
ResponseDto
<
GalaxyNftPublishAndBuyResultQueryRespDto
>
nftPublishAndBuyResultQuery
(
@Valid
@RequestBody
GalaxyNftPublishAndBuyResultQueryReqDto
reqDto
){
try
{
Thread
.
sleep
(
2000
l
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
return
galaxyTradeService
.
nftPublishAndBuyResultQuery
(
reqDto
);
}
...
...
@@ -85,11 +80,6 @@ public class GalaxyTradeController {
@ApiOperation
(
value
=
"NFT转让结果查询"
)
@PostMapping
(
value
=
{
"nftTransferResultQuery"
})
public
ResponseDto
<
GalaxyNftTransferQueryRespDto
>
nftTransferResultQuery
(
@Valid
@RequestBody
GalaxyNftTransferQueryReqDto
reqDto
){
try
{
Thread
.
sleep
(
2000
l
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
return
galaxyTradeService
.
nftTransferQuery
(
reqDto
);
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperTradeBiz.java
View file @
48edea42
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/router/xuper/service/GalaxyRouterStrategyXuperTradeImpl.java
View file @
48edea42
...
...
@@ -28,9 +28,6 @@ public class GalaxyRouterStrategyXuperTradeImpl implements IGalaxyRouterStrategy
@Override
public
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
nftPublishAndBuy
(
GalaxyNftPublishAndBuyReqDto
reqDto
)
{
//测试发送队列
// queueUtil.sendMsgByRedis(MQConst.GalaxyQueue.JSON_NFT_PUBLISH_AND_BUY.getKey(), JsonUtils.toJson(reqDto));
// return ResponseDto.success();
return
xuperTradeBiz
.
nftPublishAndBuy
(
reqDto
);
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/service/GalaxyRouterStrategyZxlTradeImpl.java
View file @
48edea42
package
com
.
liquidnet
.
service
.
galaxy
.
router
.
zxin
.
service
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.galaxy.constant.GalaxyEnum
;
import
com.liquidnet.service.galaxy.dto.param.*
;
import
com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategyTrade
;
import
com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterTradeHandler
;
import
com.liquidnet.service.galaxy.router.zxin.biz.ZxinTradeBiz
;
import
com.liquidnet.service.galaxy.utils.QueueUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -29,17 +26,9 @@ public class GalaxyRouterStrategyZxlTradeImpl implements IGalaxyRouterStrategyTr
@Autowired
private
ZxinTradeBiz
zxinTradeBiz
;
@Autowired
private
QueueUtil
queueUtil
;
@Override
public
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
nftPublishAndBuy
(
GalaxyNftPublishAndBuyReqDto
reqDto
)
{
//测试发送队列
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
responseDto
=
zxinTradeBiz
.
nftPublishAndBuy
(
reqDto
);
if
(!
responseDto
.
isSuccess
()){
queueUtil
.
sendMsgByRedis
(
MQConst
.
GalaxyQueue
.
JSON_NFT_PUBLISH_AND_BUY
.
getKey
(),
JsonUtils
.
toJson
(
reqDto
));
}
return
ResponseDto
.
success
();
return
zxinTradeBiz
.
nftPublishAndBuy
(
reqDto
);
}
@Deprecated
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/service/impl/GalaxyTradeServiceImpl.java
View file @
48edea42
package
com
.
liquidnet
.
service
.
galaxy
.
service
.
impl
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.galaxy.constant.GalaxyErrorEnum
;
import
com.liquidnet.service.galaxy.dto.param.*
;
import
com.liquidnet.service.galaxy.router.strategy.GalaxyRouterStrategyContext
;
import
com.liquidnet.service.galaxy.service.IGalaxyTradeService
;
import
com.liquidnet.service.galaxy.utils.QueueUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -20,6 +24,9 @@ import org.springframework.stereotype.Service;
@Slf4j
@Service
(
"galaxyTradeServiceImpl"
)
public
class
GalaxyTradeServiceImpl
implements
IGalaxyTradeService
{
@Autowired
private
QueueUtil
queueUtil
;
@Autowired
private
GalaxyRouterStrategyContext
galaxyRouterStrategyContext
;
...
...
@@ -31,7 +38,11 @@ public class GalaxyTradeServiceImpl implements IGalaxyTradeService {
@Override
public
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
nftPublishAndBuy
(
GalaxyNftPublishAndBuyReqDto
reqDto
)
{
return
galaxyRouterStrategyContext
.
getTradeStrategy
(
reqDto
.
getRouterType
()).
nftPublishAndBuy
(
reqDto
);
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
responseDto
=
galaxyRouterStrategyContext
.
getTradeStrategy
(
reqDto
.
getRouterType
()).
nftPublishAndBuy
(
reqDto
);
if
(!
responseDto
.
isSuccess
()){
queueUtil
.
sendMsgByRedis
(
MQConst
.
GalaxyQueue
.
JSON_NFT_PUBLISH_AND_BUY
.
getKey
(),
JsonUtils
.
toJson
(
reqDto
));
}
return
ResponseDto
.
success
();
}
@Override
...
...
@@ -59,7 +70,14 @@ public class GalaxyTradeServiceImpl implements IGalaxyTradeService {
@Override
public
ResponseDto
<
GalaxyNftTransferRespDto
>
nftTransfer
(
GalaxyNftTransferReqDto
reqDto
)
{
return
galaxyRouterStrategyContext
.
getTradeStrategy
(
reqDto
.
getRouterType
()).
nftTransfer
(
reqDto
);
ResponseDto
<
GalaxyNftTransferRespDto
>
responseDto
=
galaxyRouterStrategyContext
.
getTradeStrategy
(
reqDto
.
getRouterType
()).
nftTransfer
(
reqDto
);
if
(!
responseDto
.
isSuccess
()){
//系统异常允许重试,业务异常不允许重试
if
(
responseDto
.
getCode
().
equalsIgnoreCase
(
GalaxyErrorEnum
.
NFT_TRANSFER_FAIL
.
getCode
())){
queueUtil
.
sendMsgByRedis
(
MQConst
.
GalaxyQueue
.
JSON_NFT_PUBLISH_AND_BUY
.
getKey
(),
JsonUtils
.
toJson
(
reqDto
));
}
}
return
ResponseDto
.
success
();
}
@Override
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/test/java/com/liquidnet/service/goblin/test/xuper/TestXuperSdkUtil.java
View file @
48edea42
This diff is collapsed.
Click to expand it.
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