记得上下班打卡 | 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
5f6ada01
Commit
5f6ada01
authored
Jun 29, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现xuper相关艺术品上传
parent
77a1e8fa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
170 additions
and
170 deletions
+170
-170
XuperTradeCommonBiz.java
.../service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
+113
-64
GalaxyPublishController.java
...et/service/galaxy/controller/GalaxyPublishController.java
+56
-56
XuperTradeBiz.java
...uidnet/service/galaxy/router/xuper/biz/XuperTradeBiz.java
+1
-50
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
View file @
5f6ada01
package
com
.
liquidnet
.
service
.
galaxy
.
router
.
xuper
.
biz
;
import
com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz
;
import
com.liquidnet.common.third.zxlnft.config.ZxlnftConfig
;
import
com.liquidnet.common.exception.constant.ErrorCode
;
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.Nft044BuyResultReqDto
;
import
com.liquidnet.common.third.zxlnft.dto.Nft044BuyResultRespDto
;
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.base.ResponseDto
;
import
com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz
;
import
com.liquidnet.service.galaxy.biz.GalaxyEnumBiz
;
import
com.liquidnet.service.galaxy.constant.GalaxyEnum
;
import
com.liquidnet.service.galaxy.constant.GalaxyErrorEnum
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBindBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyRespDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyRespDto
;
import
com.liquidnet.service.galaxy.dto.param.*
;
import
com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftOrderFailLogVo
;
import
com.liquidnet.service.galaxy.exception.GalaxyNftBuyException
;
import
com.liquidnet.service.galaxy.utils.GalaxyDataUtils
;
...
...
@@ -43,13 +44,10 @@ import java.util.Date;
@Component
public
class
XuperTradeCommonBiz
{
@Autowired
private
ZxlnftSdkUtil
zxlnft
SdkUtil
;
private
XuperSdkUtil
xuper
SdkUtil
;
@Autowired
private
ZxlnftBiz
zxlnftBiz
;
@Autowired
private
ZxlnftConfig
zxlnftConfig
;
private
XuperConfig
xuperConfig
;
@Autowired
private
GalaxyDataUtils
dataUtils
;
...
...
@@ -94,45 +92,53 @@ public class XuperTradeCommonBiz {
private
GalaxyNftBuyRespDto
nftBuyBusinessSync
(
String
routerType
,
String
nftId
,
GalaxyUserInfoBo
userInfoBo
,
GalaxySeriesNftInfoBo
seriesNftInfoBo
,
GalaxyNftOrderBo
nftOrderBo
){
//定义返回参数
String
nftBuyTaskId
=
null
;
Lo
ng
nftBuyChainTimestamp
=
null
;
Stri
ng
nftBuyChainTimestamp
=
null
;
Integer
nftBuyStatus
=
null
;
String
nftBuyTradeHash
=
null
;
String
nftBuyPayTaskId
=
null
;
/**
* 获取订单和nft绑定信息
*/
Long
shardId
=
-
1
l
;
GalaxyNftOrderBindBo
nftOrderBindBo
=
dataUtils
.
getGalaxyNftOrderBindBo
(
routerType
,
nftOrderBo
.
getNftOrderPayId
());
if
(
StringUtil
.
isNotNull
(
nftOrderBindBo
)){
shardId
=
nftOrderBindBo
.
getNftIdIndex
().
longValue
();
}
//如果购买任务不为空,则直接进行购买任务查询
if
(
StringUtil
.
isNotEmpty
(
nftOrderBo
.
getNftBuyTaskId
())){
nftBuyTaskId
=
nftOrderBo
.
getNftBuyTaskId
();
}
if
(
StringUtil
.
isEmpty
(
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);
// }
//购买
Xuper007GrantShardReqDto
xuper007GrantShardReqDto
=
Xuper007GrantShardReqDto
.
getNew
();
// 定义返回结果对象
Xuper007GrantShardRespDto
xuper007GrantShardRespDto
=
null
;
long
assetId
=
Long
.
parseLong
(
seriesNftInfoBo
.
getSeriesId
());
try
{
xuper007GrantShardReqDto
.
setMnemonic
(
xuperConfig
.
getNftPlatformMnemonic
());
xuper007GrantShardReqDto
.
setAssetId
(
assetId
);
xuper007GrantShardReqDto
.
setShardId
(
shardId
);
xuper007GrantShardReqDto
.
setToAddr
(
xuperSdkUtil
.
getAccount
(
userInfoBo
.
getMnemonic
()).
getAddress
());
xuper007GrantShardReqDto
.
setToUserId
(
100000
l
);
xuper007GrantShardReqDto
.
setPrice
(
seriesNftInfoBo
.
getSellCount
().
longValue
());
XuperResponseDto
<
Xuper007GrantShardRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper007GrantShard
(
xuper007GrantShardReqDto
);
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
(
xuper007GrantShardRespDto
));
if
(
StringUtil
.
isNotNull
(
xuper007GrantShardRespDto
)&&
xuper007GrantShardRespDto
.
getErrNo
()==
0
){
nftBuyTaskId
=
String
.
valueOf
(
assetId
);
nftOrderBo
.
setNftBuyTaskId
(
nftBuyTaskId
);
}
}
//如果购买任务id不为空
...
...
@@ -149,22 +155,28 @@ public class XuperTradeCommonBiz {
Thread
.
sleep
(
500
l
);
count
++;
log
.
info
(
"=======执行第{}次查询,taskId:{}"
,
count
,
nft044ReqDto
.
getTaskId
());
ZxlnftResponseDto
<
Nft044BuyResultRespDto
>
nft044RespDto
=
zxlnftSdkUtil
.
nft044BuyResult
(
nft044ReqDto
);
if
(
nft044RespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())){
nftBuyPayTaskId
=
nft044RespDto
.
getData
().
getPayTaskId
();
nftBuyChainTimestamp
=
nft044RespDto
.
getData
().
getChainTimestamp
();
nftBuyStatus
=
nft044RespDto
.
getData
().
getTaskStatus
();
nftBuyTradeHash
=
nft044RespDto
.
getData
().
getTxHash
();
}
else
if
(
nft044RespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_FAIL
.
getCode
())){
//执行nft购买结果查询
GalaxyNftBuyResultQueryReqDto
nftBuyResultQueryReqDto
=
GalaxyNftBuyResultQueryReqDto
.
getNew
();
nftBuyResultQueryReqDto
.
setNftOrderPayId
(
nftOrderBo
.
getNftOrderPayId
());
nftBuyResultQueryReqDto
.
setRouterType
(
routerType
);
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
buyResultQueryRespDto
=
this
.
nftBuyResultQuery
(
nftBuyResultQueryReqDto
);
if
(
buyResultQueryRespDto
.
isSuccess
()){
if
(
buyResultQueryRespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())){
nftBuyPayTaskId
=
buyResultQueryRespDto
.
getData
().
getPayTaskId
();
nftBuyChainTimestamp
=
buyResultQueryRespDto
.
getData
().
getChainTimestamp
();
nftBuyStatus
=
buyResultQueryRespDto
.
getData
().
getTaskStatus
();
nftBuyTradeHash
=
buyResultQueryRespDto
.
getData
().
getTxHash
();
}
else
if
(
buyResultQueryRespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_FAIL
.
getCode
())){
log
.
info
(
"任务执行失败!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
nftBuyStatus
=
nft044RespDto
.
getData
().
getTaskStatus
();
nftBuyStatus
=
buyResultQueryRespDto
.
getData
().
getTaskStatus
();
//购买失败
throw
new
GalaxyNftBuyException
(
GalaxyErrorEnum
.
NFT_BUY_FAIL
.
getCode
(),
"nft044BuyResult_resp:"
+
GalaxyErrorEnum
.
NFT_BUY_FAIL
.
getMessage
());
}
else
if
(
nft044
RespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
PROCESSING
.
getCode
())){
}
else
if
(
buyResultQuery
RespDto
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
PROCESSING
.
getCode
())){
log
.
info
(
"任务执行中!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
nftBuyStatus
=
nft044RespDto
.
getData
().
getTaskStatus
();
nftBuyStatus
=
buyResultQueryRespDto
.
getData
().
getTaskStatus
();
}
}
if
(
count
==
20
){
//查询超过20次,则把nftId设置为空,为后续重新入队
nftId
=
null
;
...
...
@@ -173,12 +185,6 @@ public class XuperTradeCommonBiz {
}
}
log
.
info
(
"总共执行了多少次查询:{} 总耗时:{}"
,
count
,
System
.
currentTimeMillis
()
-
timeStart
);
// if(StringUtil.isNotEmpty(payTaskId)){
// //3.2.5查询NFT购买支付结果
// Nft045BuyPayResultReqDto nft045ReqDto = Nft045BuyPayResultReqDto.getNew();
// nft045ReqDto.setTaskId(payTaskId);
// ZxlnftResponseDto<Nft045BuyPayResultRespDto> nft045RespDto = zxlnftSdkUtil.nft045BuyPayResult(nft045ReqDto);
// }
}
catch
(
GalaxyNftBuyException
e
){
throw
new
GalaxyNftBuyException
(
e
.
getCode
(),
e
.
getMessage
());
}
catch
(
Exception
e
){
...
...
@@ -190,7 +196,7 @@ public class XuperTradeCommonBiz {
//更新订单缓存数据状态
if
(
StringUtil
.
isNotNull
(
nftBuyChainTimestamp
)){
//设置时间
String
nftBuyChainTimestampStr
=
DateUtil
.
format
(
new
Date
(
nftBuyChainTimestamp
*
1000
),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
);
String
nftBuyChainTimestampStr
=
DateUtil
.
format
(
new
Date
(),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
);
nftOrderBo
.
setNftBuyChainTimestamp
(
nftBuyChainTimestampStr
);
}
if
(
StringUtil
.
isNotNull
(
nftBuyStatus
)){
...
...
@@ -214,4 +220,47 @@ public class XuperTradeCommonBiz {
nftBuyRespDto
.
setNftId
(
nftId
);
return
nftBuyRespDto
;
}
public
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
nftBuyResultQuery
(
GalaxyNftBuyResultQueryReqDto
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
());
}
if
(
StringUtil
.
isEmpty
(
nftOrderBo
.
getNftBuyTaskId
())){
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getCode
(),
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getMessage
());
}
//执行资产碎片授予查询
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
));
if
(
String
.
valueOf
(
xuper010QuerySdsRespDto
.
getErrNo
()).
equalsIgnoreCase
(
ErrorCode
.
SUCCESS
.
getCode
())){
GalaxyNftBuyResultQueryRespDto
resultQueryRespDto
=
GalaxyNftBuyResultQueryRespDto
.
getNew
();
String
nowTimeStr
=
DateUtil
.
getNowTime
();
//转换任务状态
Integer
taskStatus
=
Integer
.
valueOf
(
GalaxyEnumBiz
.
getGrantStatusEnum
(
reqDto
.
getRouterType
(),
String
.
valueOf
(
xuper010QuerySdsRespDto
.
getMeta
().
getStatus
())).
getCode
());
resultQueryRespDto
.
setTaskStatus
(
taskStatus
);
resultQueryRespDto
.
setChainTimestamp
(
nowTimeStr
);
resultQueryRespDto
.
setPayTaskId
(
xuper010QuerySdsRespDto
.
getMeta
().
getTxId
());
return
ResponseDto
.
success
(
resultQueryRespDto
);
}
else
{
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_PUBLISH_AND_BUY_QUERY_FAIL
.
getCode
(),
GalaxyErrorEnum
.
NFT_PUBLISH_AND_BUY_QUERY_FAIL
.
getMessage
());
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/controller/GalaxyPublishController.java
View file @
5f6ada01
package
com
.
liquidnet
.
service
.
galaxy
.
controller
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.aop.annotation.ControllerLog
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto
;
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.service.IGalaxyPublishService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyPublishController
* @Package com.liquidnet.service.galaxy.controller
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 12:11
*/
@Api
(
tags
=
"NFT发行相关"
)
@RestController
@RequestMapping
(
"nftPublish"
)
@Validated
@Slf4j
public
class
GalaxyPublishController
{
@Resource
(
name
=
"galaxyPublishServiceImpl"
)
private
IGalaxyPublishService
galaxyPublishService
;
@ControllerLog
(
description
=
"NFT发行"
)
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"NFT发行"
)
@PostMapping
(
value
=
{
"nftPublish"
})
public
ResponseDto
<
GalaxyNftPublishRespDto
>
nftPublish
(
@Valid
@RequestBody
GalaxyNftPublishReqDto
reqDto
){
return
galaxyPublishService
.
nftPublish
(
reqDto
);
}
@ControllerLog
(
description
=
"NFT发行结果查询"
)
@ApiOperationSupport
(
order
=
3
)
@ApiOperation
(
value
=
"NFT发行结果查询"
)
@PostMapping
(
value
=
{
"nftPublishResultQuery"
})
public
ResponseDto
<
GalaxyNftPublishResultQueryRespDto
>
nftPublishResultQuery
(
@Valid
@RequestBody
GalaxyNftPublishResultQueryReqDto
reqDto
)
{
return
galaxyPublishService
.
nftPublishResultQuery
(
reqDto
);
}
}
//
package com.liquidnet.service.galaxy.controller;
//
//
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
//
import com.liquidnet.service.base.ResponseDto;
//
import com.liquidnet.service.galaxy.aop.annotation.ControllerLog;
//
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto;
//
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.service.IGalaxyPublishService;
//
import io.swagger.annotations.Api;
//
import io.swagger.annotations.ApiOperation;
//
import lombok.extern.slf4j.Slf4j;
//
import org.springframework.validation.annotation.Validated;
//
import org.springframework.web.bind.annotation.PostMapping;
//
import org.springframework.web.bind.annotation.RequestBody;
//
import org.springframework.web.bind.annotation.RequestMapping;
//
import org.springframework.web.bind.annotation.RestController;
//
//
import javax.annotation.Resource;
//
import javax.validation.Valid;
//
/
//
**
//
* @author AnJiabin <anjiabin@zhengzai.tv>
//
* @version V1.0
//
* @Description: TODO
//
* @class: GalaxyPublishController
//
* @Package com.liquidnet.service.galaxy.controller
//
* @Copyright: LightNet @ Copyright (c) 2021
//
* @date 2022/3/15 12:11
//
*/
//
@Api(tags = "NFT发行相关")
//
@RestController
//
@RequestMapping("nftPublish")
//
@Validated
//
@Slf4j
//
public class GalaxyPublishController {
//
@Resource(name = "galaxyPublishServiceImpl")
//
private IGalaxyPublishService galaxyPublishService;
//
//
@ControllerLog(description = "NFT发行")
//
@ApiOperationSupport(order = 1)
//
@ApiOperation(value = "NFT发行")
//
@PostMapping(value = {"nftPublish"})
//
public ResponseDto<GalaxyNftPublishRespDto> nftPublish(@Valid @RequestBody GalaxyNftPublishReqDto reqDto){
//
return galaxyPublishService.nftPublish(reqDto);
//
}
//
//
@ControllerLog(description = "NFT发行结果查询")
//
@ApiOperationSupport(order = 3)
//
@ApiOperation(value = "NFT发行结果查询")
//
@PostMapping(value = {"nftPublishResultQuery"})
//
public ResponseDto<GalaxyNftPublishResultQueryRespDto> nftPublishResultQuery(@Valid @RequestBody GalaxyNftPublishResultQueryReqDto reqDto) {
//
return galaxyPublishService.nftPublishResultQuery(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 @
5f6ada01
...
...
@@ -112,19 +112,8 @@ public class XuperTradeBiz {
}
}
String
author
=
seriesNftInfoBo
.
getAuthor
();
String
nftName
=
seriesNftInfoBo
.
getNftName
();
String
nftUrl
=
seriesNftInfoBo
.
getNftUrl
();
String
displayUrl
=
seriesNftInfoBo
.
getDisplayUrl
();
String
nftDesc
=
seriesNftInfoBo
.
getNftDesc
();
String
nftFlag
=
seriesNftInfoBo
.
getNftFlag
();
//发行个数
Long
publishCount
=
1L
;
//开始索引
Integer
seriesBeginIndex
=
null
;
//发行金额
Long
sellCount
=
seriesNftInfoBo
.
getSellCount
().
longValue
();
//积分
/**
* 根据sku获取系列Id
*/
...
...
@@ -322,7 +311,7 @@ public class XuperTradeBiz {
GalaxyNftBuyResultQueryReqDto
nftBuyResultQueryReqDto
=
GalaxyNftBuyResultQueryReqDto
.
getNew
();
nftBuyResultQueryReqDto
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
nftBuyResultQueryReqDto
.
setRouterType
(
reqDto
.
getRouterType
());
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
buyResultQueryRespDto
=
this
.
nftBuyResultQuery
(
nftBuyResultQueryReqDto
);
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
buyResultQueryRespDto
=
xuperTradeCommonBiz
.
nftBuyResultQuery
(
nftBuyResultQueryReqDto
);
if
(
buyResultQueryRespDto
.
isSuccess
()){
GalaxyNftBuyResultQueryRespDto
nftBuyResultQueryRespDtoTemp
=
buyResultQueryRespDto
.
getData
();
BeanUtil
.
copy
(
nftBuyResultQueryRespDtoTemp
,
nftOrderBo
);
...
...
@@ -346,42 +335,4 @@ public class XuperTradeBiz {
}
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_PUBLISH_AND_BUY_QUERY_FAIL
.
getCode
(),
GalaxyErrorEnum
.
NFT_PUBLISH_AND_BUY_QUERY_FAIL
.
getMessage
(),
resultQueryRespDto
);
}
public
ResponseDto
<
GalaxyNftBuyResultQueryRespDto
>
nftBuyResultQuery
(
GalaxyNftBuyResultQueryReqDto
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
());
}
if
(
StringUtil
.
isEmpty
(
nftOrderBo
.
getNftBuyTaskId
())){
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getCode
(),
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getMessage
());
}
//执行资产碎片授予查询
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
();
String
nowTimeStr
=
DateUtil
.
getNowTime
();
//转换任务状态
Integer
taskStatus
=
Integer
.
valueOf
(
GalaxyEnumBiz
.
getGrantStatusEnum
(
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