记得上下班打卡 | 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
c0c280e3
Commit
c0c280e3
authored
Jun 28, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现xuper相关艺术品上传
parent
629bf9af
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
193 additions
and
56 deletions
+193
-56
XuperEnum.java
.../com/liquidnet/common/third/xuper/constant/XuperEnum.java
+43
-5
Xuper010QuerySdsRespDto.java
...idnet/common/third/xuper/dto/Xuper010QuerySdsRespDto.java
+39
-1
GalaxyEnumBiz.java
.../java/com/liquidnet/service/galaxy/biz/GalaxyEnumBiz.java
+55
-6
XuperTradeCommonBiz.java
.../service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
+28
-33
XuperTradeBiz.java
...uidnet/service/galaxy/router/xuper/biz/XuperTradeBiz.java
+28
-11
No files found.
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/constant/XuperEnum.java
View file @
c0c280e3
...
...
@@ -42,9 +42,9 @@ public class XuperEnum {
}
/**
* 资产状态 1:初始 3:发行中 4:发行成功 5:冻结中 6:已冻结 7:封禁中 8:已封禁
* 资产
发行
状态 1:初始 3:发行中 4:发行成功 5:冻结中 6:已冻结 7:封禁中 8:已封禁
*/
public
enum
AssetStatusEnum
{
public
enum
Asset
Publish
StatusEnum
{
INIT
(
"1"
,
"初始"
),
PUBLISHING
(
"3"
,
"发行中"
),
PUBLISH_SUCCESS
(
"4"
,
"发行成功"
),
...
...
@@ -55,13 +55,51 @@ public class XuperEnum {
private
String
code
;
private
String
message
;
AssetStatusEnum
(
String
code
,
String
message
)
{
Asset
Publish
StatusEnum
(
String
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
public
AssetStatusEnum
getEnumByCode
(
String
code
){
AssetStatusEnum
[]
arry
=
AssetStatusEnum
.
values
();
public
AssetPublishStatusEnum
getEnumByCode
(
String
code
){
AssetPublishStatusEnum
[]
arry
=
AssetPublishStatusEnum
.
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
;
}
}
/**
* 资产授予状态 0:已上链 1:授予中 4:转移中 5: 核销中 6: 已核销 10:异常详情参考错误码和状态码
*/
public
enum
AssetGrantStatusEnum
{
GRANT_SUCCESS
(
"0"
,
"已上链"
),
GRANTING
(
"1"
,
"授予中"
),
TRANSFERING
(
"4"
,
"转移中"
),
CANCELING
(
"5"
,
"核销中"
),
CANCELED
(
"6"
,
"已核销"
),
OTHER_ERROR
(
"10"
,
"异常详情参考错误码和状态码"
);
private
String
code
;
private
String
message
;
AssetGrantStatusEnum
(
String
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
public
AssetGrantStatusEnum
getEnumByCode
(
String
code
){
AssetGrantStatusEnum
[]
arry
=
AssetGrantStatusEnum
.
values
();
for
(
int
i
=
0
;
i
<
arry
.
length
;
i
++)
{
if
(
arry
[
i
].
getCode
().
equals
(
code
))
{
return
arry
[
i
];
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper010QuerySdsRespDto.java
View file @
c0c280e3
...
...
@@ -17,7 +17,45 @@ public class Xuper010QuerySdsRespDto {
public
long
requestId
;
public
int
errNo
;
public
String
errMsg
;
public
XassetDef
.
ShardMeta
meta
;
public
ShardMeta
meta
;
@Data
public
static
class
ShardMeta
{
public
long
assetId
;
public
long
shardId
;
public
String
ownerAddr
;
public
long
uid
;
public
long
price
;
public
int
status
;
public
String
txId
;
public
ShardAssetInfo
assetInfo
;
public
long
ctime
;
}
@Data
public
static
class
ShardAssetInfo
{
public
String
title
;
public
int
assetCate
;
public
XassetDef
.
Thumb
[]
thumb
;
public
String
shortDesc
;
public
String
createAddr
;
public
long
groupId
;
}
@Data
public
static
class
Thumb
{
private
Xuper005QueryAssetRespDto
.
Urls
urls
;
private
String
width
;
private
String
height
;
}
@Data
public
static
class
Urls
{
private
String
icon
;
private
String
url1
;
private
String
url2
;
private
String
url3
;
}
private
static
final
Xuper010QuerySdsRespDto
obj
=
new
Xuper010QuerySdsRespDto
();
public
static
Xuper010QuerySdsRespDto
getNew
()
{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/biz/GalaxyEnumBiz.java
View file @
c0c280e3
...
...
@@ -48,15 +48,15 @@ public class GalaxyEnumBiz {
break
;
}
case
"xuper"
:
if
(
code
.
equalsIgnoreCase
(
XuperEnum
.
Asset
StatusEnum
.
INIT
.
getCode
())||
code
.
equalsIgnoreCase
(
XuperEnum
.
Asset
StatusEnum
.
PUBLISHING
.
getCode
())){
if
(
code
.
equalsIgnoreCase
(
XuperEnum
.
Asset
PublishStatusEnum
.
INIT
.
getCode
())||
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetPublish
StatusEnum
.
PUBLISHING
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
PROCESSING
;
break
;
}
else
if
(
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetStatusEnum
.
PUBLISH_SUCCESS
.
getCode
())){
}
else
if
(
code
.
equalsIgnoreCase
(
XuperEnum
.
Asset
Publish
StatusEnum
.
PUBLISH_SUCCESS
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
TASK_SUCCESS
;
break
;
}
else
if
(
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetStatusEnum
.
FREEZING
.
getCode
())
||
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetStatusEnum
.
BANNEDING
.
getCode
())
||
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetStatusEnum
.
BANNEDED
.
getCode
())
}
else
if
(
code
.
equalsIgnoreCase
(
XuperEnum
.
Asset
Publish
StatusEnum
.
FREEZING
.
getCode
())
||
code
.
equalsIgnoreCase
(
XuperEnum
.
Asset
Publish
StatusEnum
.
BANNEDING
.
getCode
())
||
code
.
equalsIgnoreCase
(
XuperEnum
.
Asset
Publish
StatusEnum
.
BANNEDED
.
getCode
())
){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
TASK_FAIL
;
break
;
...
...
@@ -105,4 +105,53 @@ public class GalaxyEnumBiz {
}
return
userBindStatusEnum
;
}
}
/**
* 资产授予状态转换
* @param routerType
* @param code
* @return
*/
public
static
GalaxyEnum
.
TaskStatusEnum
getGrantStatusEnum
(
String
routerType
,
String
code
){
GalaxyEnum
.
TaskStatusEnum
taskStatusEnum
=
null
;
switch
(
routerType
){
case
"zxinchain"
:
if
(
code
.
equalsIgnoreCase
(
ZxlnftEnum
.
TaskStatusEnum
.
PROCESSING
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
PROCESSING
;
break
;
}
else
if
(
code
.
equalsIgnoreCase
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
TASK_SUCCESS
;
break
;
}
else
if
(
code
.
equalsIgnoreCase
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_FAIL
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
TASK_FAIL
;
break
;
}
case
"antchain"
:
if
(
code
.
equalsIgnoreCase
(
AntchainEnum
.
TaskStatusEnum
.
PROCESSING
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
PROCESSING
;
break
;
}
else
if
(
code
.
equalsIgnoreCase
(
AntchainEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
TASK_SUCCESS
;
break
;
}
else
if
(
code
.
equalsIgnoreCase
(
AntchainEnum
.
TaskStatusEnum
.
TASK_FAIL
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
TASK_FAIL
;
break
;
}
case
"xuper"
:
if
(
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetGrantStatusEnum
.
GRANTING
.
getCode
())||
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetGrantStatusEnum
.
TRANSFERING
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
PROCESSING
;
break
;
}
else
if
(
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetGrantStatusEnum
.
GRANT_SUCCESS
.
getCode
())){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
TASK_SUCCESS
;
break
;
}
else
if
(
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetGrantStatusEnum
.
CANCELING
.
getCode
())
||
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetGrantStatusEnum
.
CANCELED
.
getCode
())
||
code
.
equalsIgnoreCase
(
XuperEnum
.
AssetGrantStatusEnum
.
OTHER_ERROR
.
getCode
())
){
taskStatusEnum
=
GalaxyEnum
.
TaskStatusEnum
.
TASK_FAIL
;
break
;
}
}
return
taskStatusEnum
;
}
}
\ No newline at end of file
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
View file @
c0c280e3
package
com
.
liquidnet
.
service
.
galaxy
.
router
.
xuper
.
biz
;
import
com.liquidnet.common.third.xuper.dto.Xuper007GrantShardReqDto
;
import
com.liquidnet.common.third.xuper.dto.Xuper007GrantShardRespDto
;
import
com.liquidnet.common.third.xuper.dto.XuperResponseDto
;
import
com.liquidnet.common.third.xuper.exception.XupterException
;
import
com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz
;
import
com.liquidnet.common.third.zxlnft.config.ZxlnftConfig
;
import
com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum
;
...
...
@@ -13,7 +9,6 @@ import com.liquidnet.common.third.zxlnft.dto.ZxlnftResponseDto;
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.JsonUtils
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz
;
import
com.liquidnet.service.galaxy.biz.GalaxyEnumBiz
;
...
...
@@ -110,34 +105,34 @@ public class XuperTradeCommonBiz {
}
if
(
StringUtil
.
isEmpty
(
nftBuyTaskId
)){
//购买
Xuper007GrantShardReqDto
xuper007GrantShardReqDto
=
Xuper007GrantShardReqDto
.
getNew
();
// 定义返回结果对象
Xuper007GrantShardRespDto
xuper007GrantShardRespDto
=
null
;
long
assetId
=
171095615845019437
l
;
// long assetId = 1532351545249738541l;
try
{
xuper007GrantShardReqDto
.
setMnemonic
(
creatorMnemonic
);
xuper007GrantShardReqDto
.
setAssetId
(
assetId
);
xuper007GrantShardReqDto
.
setShardId
(
1
l
);
xuper007GrantShardReqDto
.
setToAddr
(
xuperSdkUtil
.
getAccount
(
customerMnemonic
).
getAddress
());
xuper007GrantShardReqDto
.
setToUserId
(
100000
l
);
xuper007GrantShardReqDto
.
setPrice
(
1234
l
);
XuperResponseDto
<
Xuper007GrantShardRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper007GrantShard
(
reqDto
);
if
(
xuperResponseDto
.
isSuccess
()){
xuper007GrantShardRespDto
=
xuperResponseDto
.
getParseData
(
Xuper007GrantShardRespDto
.
class
);
}
}
catch
(
XupterException
e
)
{
log
.
error
(
"biz error msg "
+
e
.
getMessage
(),
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"sys error msg "
+
e
.
getMessage
(),
e
);
}
log
.
info
(
"testXuper007GrantShard resp : "
+
JsonUtils
.
toJson
(
respDto
));
if
(
nft043RespDto
.
isSuccess
()){
nftBuyTaskId
=
nft043RespDto
.
getData
().
getTaskId
();
nftOrderBo
.
setNftBuyTaskId
(
nftBuyTaskId
);
}
//
//购买
//
Xuper007GrantShardReqDto xuper007GrantShardReqDto = Xuper007GrantShardReqDto.getNew();
//
// 定义返回结果对象
//
Xuper007GrantShardRespDto xuper007GrantShardRespDto = null;
//
long assetId = 171095615845019437l;
//
//
long assetId = 1532351545249738541l;
//
//
try {
//
xuper007GrantShardReqDto.setMnemonic(creatorMnemonic);
//
xuper007GrantShardReqDto.setAssetId(assetId);
//
xuper007GrantShardReqDto.setShardId(1l);
//
xuper007GrantShardReqDto.setToAddr(xuperSdkUtil.getAccount(customerMnemonic).getAddress());
//
xuper007GrantShardReqDto.setToUserId(100000l);
//
xuper007GrantShardReqDto.setPrice(1234l);
//
XuperResponseDto<Xuper007GrantShardRespDto> xuperResponseDto = xuperSdkUtil.xuper007GrantShard(reqDto);
//
if(xuperResponseDto.isSuccess()){
//
xuper007GrantShardRespDto = xuperResponseDto.getParseData(Xuper007GrantShardRespDto.class);
//
}
//
}catch (XupterException e) {
//
log.error("biz error msg "+e.getMessage(),e);
//
}catch (Exception e) {
//
log.error("sys error msg "+e.getMessage(),e);
//
}
//
log.info("testXuper007GrantShard resp : "+ JsonUtils.toJson(respDto));
//
if(nft043RespDto.isSuccess()){
//
nftBuyTaskId = nft043RespDto.getData().getTaskId();
//
nftOrderBo.setNftBuyTaskId(nftBuyTaskId);
//
}
}
//如果购买任务id不为空
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperTradeBiz.java
View file @
c0c280e3
...
...
@@ -5,9 +5,10 @@ import com.liquidnet.common.third.xuper.config.XuperConfig;
import
com.liquidnet.common.third.xuper.dto.*
;
import
com.liquidnet.common.third.xuper.exception.XupterException
;
import
com.liquidnet.common.third.xuper.util.XuperSdkUtil
;
import
com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum
;
import
com.liquidnet.common.third.zxlnft.dto.*
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz
;
import
com.liquidnet.service.galaxy.biz.GalaxyEnumBiz
;
...
...
@@ -58,6 +59,9 @@ public class XuperTradeBiz {
@Autowired
private
QueueUtil
queueUtil
;
@Autowired
private
XuperPublishBiz
xuperPublishBiz
;
/**
* 发行和购买
* @param reqDto
...
...
@@ -302,7 +306,7 @@ public class XuperTradeBiz {
GalaxyNftPublishResultQueryReqDto
nftPublishResultQueryReqDto
=
GalaxyNftPublishResultQueryReqDto
.
getNew
();
nftPublishResultQueryReqDto
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
nftPublishResultQueryReqDto
.
setRouterType
(
reqDto
.
getRouterType
());
ResponseDto
<
GalaxyNftPublishResultQueryRespDto
>
publishResultQueryRespDto
=
zxin
PublishBiz
.
nftPublishResultQuery
(
nftPublishResultQueryReqDto
);
ResponseDto
<
GalaxyNftPublishResultQueryRespDto
>
publishResultQueryRespDto
=
xuper
PublishBiz
.
nftPublishResultQuery
(
nftPublishResultQueryReqDto
);
if
(
publishResultQueryRespDto
.
isSuccess
()){
GalaxyNftPublishResultQueryRespDto
nftPublishResultQueryRespDtoTemp
=
publishResultQueryRespDto
.
getData
();
BeanUtil
.
copy
(
nftPublishResultQueryRespDtoTemp
,
nftOrderBo
);
...
...
@@ -353,16 +357,29 @@ public class XuperTradeBiz {
if
(
StringUtil
.
isEmpty
(
nftOrderBo
.
getNftBuyTaskId
())){
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getCode
(),
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getMessage
());
}
//3.2.4查询NFT购买结果
Nft044BuyResultReqDto
nft044ReqDto
=
Nft044BuyResultReqDto
.
getNew
();
nft044ReqDto
.
setTaskId
(
nftOrderBo
.
getNftBuyTaskId
());
ZxlnftResponseDto
<
Nft044BuyResultRespDto
>
nft044RespDto
=
zxlnftSdkUtil
.
nft044BuyResult
(
nft044ReqDto
);
//执行资产碎片授予查询
Xuper010QuerySdsReqDto
xuper010QuerySdsReqDto
=
Xuper010QuerySdsReqDto
.
getNew
();
// 定义返回结果对象
Xuper010QuerySdsRespDto
xuper010QuerySdsRespDto
=
null
;
long
shardId
=
1
l
;
try
{
xuper010QuerySdsReqDto
.
setAssetId
(
Long
.
parseLong
(
nftOrderBo
.
getSeriesId
()));
xuper010QuerySdsReqDto
.
setShardId
(
shardId
);
XuperResponseDto
<
Xuper010QuerySdsRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper010QuerySds
(
xuper010QuerySdsReqDto
);
if
(
xuperResponseDto
.
isSuccess
()){
xuper010QuerySdsRespDto
=
xuperResponseDto
.
getParseData
(
Xuper010QuerySdsRespDto
.
class
);
}
}
catch
(
XupterException
e
)
{
log
.
error
(
"biz error msg "
+
e
.
getMessage
(),
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"sys error msg "
+
e
.
getMessage
(),
e
);
}
log
.
info
(
"testXuper010QuerySds resp : "
+
JsonUtils
.
toJson
(
xuper010QuerySdsRespDto
));
GalaxyNftBuyResultQueryRespDto
resultQueryRespDto
=
GalaxyNftBuyResultQueryRespDto
.
getNew
();
BeanUtil
.
copy
(
nft044RespDto
.
getData
(),
resultQueryRespDto
);
String
nowTimeStr
=
DateUtil
.
format
(
new
Date
(
nft044RespDto
.
getData
().
getChainTimestamp
().
longValue
()*
1000
),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
);
String
nowTimeStr
=
DateUtil
.
getNowTime
();
//转换任务状态
Integer
taskStatus
=
Integer
.
valueOf
(
GalaxyEnumBiz
.
get
TaskStatusEnum
(
reqDto
.
getRouterType
(),
nft044RespDto
.
getData
().
getTaskStatus
().
toString
(
)).
getCode
());
Integer
taskStatus
=
Integer
.
valueOf
(
GalaxyEnumBiz
.
get
GrantStatusEnum
(
reqDto
.
getRouterType
(),
String
.
valueOf
(
xuper010QuerySdsRespDto
.
getMeta
().
getStatus
()
)).
getCode
());
resultQueryRespDto
.
setTaskStatus
(
taskStatus
);
resultQueryRespDto
.
setChainTimestamp
(
nowTimeStr
);
return
ResponseDto
.
success
(
resultQueryRespDto
);
...
...
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