记得上下班打卡 | 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
459ae0d6
Commit
459ae0d6
authored
Mar 17, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改购买逻辑
parent
4eb7e81a
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
641 additions
and
121 deletions
+641
-121
GalaxyErrorCodeEnum.java
...iquidnet/service/galaxy/constant/GalaxyErrorCodeEnum.java
+4
-1
GalaxyNftOrderBo.java
...com/liquidnet/service/galaxy/dto/bo/GalaxyNftOrderBo.java
+1
-1
GalaxyNftPublishAndBuyReqDto.java
...ervice/galaxy/dto/param/GalaxyNftPublishAndBuyReqDto.java
+62
-0
GalaxyNftPublishAndBuyRespDto.java
...rvice/galaxy/dto/param/GalaxyNftPublishAndBuyRespDto.java
+42
-0
GalaxyNftPublishReqDto.java
...dnet/service/galaxy/dto/param/GalaxyNftPublishReqDto.java
+62
-0
GalaxyNftPublishRespDto.java
...net/service/galaxy/dto/param/GalaxyNftPublishRespDto.java
+42
-0
GalaxyNftOrderVo.java
...quidnet/service/galaxy/dto/vo/mongo/GalaxyNftOrderVo.java
+1
-1
IGalaxyPublishService.java
...quidnet/service/galaxy/service/IGalaxyPublishService.java
+3
-3
IGalaxyTradeService.java
...liquidnet/service/galaxy/service/IGalaxyTradeService.java
+9
-0
GalaxyNftTradeController.java
...t/service/galaxy/controller/GalaxyNftTradeController.java
+0
-24
GalaxyPublishController.java
...et/service/galaxy/controller/GalaxyPublishController.java
+8
-8
GalaxyTradeController.java
...dnet/service/galaxy/controller/GalaxyTradeController.java
+56
-0
IGalaxyRouterStrategy.java
...service/galaxy/router/strategy/IGalaxyRouterStrategy.java
+4
-0
GalaxyRouterStrategyEthImpl.java
...axy/router/strategy/impl/GalaxyRouterStrategyEthImpl.java
+10
-0
GalaxyRouterStrategyZxlImpl.java
...axy/router/strategy/impl/GalaxyRouterStrategyZxlImpl.java
+15
-1
ZxinPublishBiz.java
...uidnet/service/galaxy/router/zxin/biz/ZxinPublishBiz.java
+154
-74
ZxinTradeBiz.java
...iquidnet/service/galaxy/router/zxin/biz/ZxinTradeBiz.java
+123
-0
GalaxyPublishServiceImpl.java
...service/galaxy/service/impl/GalaxyPublishServiceImpl.java
+4
-5
GalaxyTradeServiceImpl.java
...t/service/galaxy/service/impl/GalaxyTradeServiceImpl.java
+38
-0
DataUtils.java
...in/java/com/liquidnet/service/galaxy/utils/DataUtils.java
+3
-3
No files found.
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/constant/GalaxyErrorCodeEnum.java
View file @
459ae0d6
...
...
@@ -11,7 +11,10 @@ package com.liquidnet.service.galaxy.constant;
*/
public
enum
GalaxyErrorCodeEnum
{
SERIES_CLAIM_ERROR
(
"NFT0010001"
,
"NFT系列声明失败"
),
SERIES_CLAIM_ERROR_FIVE_TIMES
(
"NFT0010002"
,
"NFT系列声明失败,任务查询超过5次"
);
SERIES_CLAIM_ERROR_FIVE_TIMES
(
"NFT0010002"
,
"NFT系列声明失败,任务查询超过5次"
),
PUBLISH_FAIL
(
"NFT0010003"
,
"NFT发行失败,未获取nft"
),
PUBLISH_BUY_FAIL
(
"NFT0010004"
,
"NFT发行购买失败,未发起购买"
),
PUBLISH_FAIL_ALREADY_EXIST
(
"NFT0010005"
,
"NFT发行失败,该订单已经发行过指定nft!"
);
private
String
code
;
private
String
message
;
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/bo/GalaxyNftOrderBo.java
View file @
459ae0d6
...
...
@@ -32,7 +32,7 @@ public class GalaxyNftOrderBo implements Serializable,Cloneable {
/**
* 接入方买入唯一标识
*/
private
String
o
rderPayId
;
private
String
nftO
rderPayId
;
/**
* nftId
*/
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/param/GalaxyNftPublishAndBuyReqDto.java
0 → 100644
View file @
459ae0d6
package
com
.
liquidnet
.
service
.
galaxy
.
dto
.
param
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: NFT购买(涉及NFT发行、NFT购买)
* @class: GalaxyNftPublishAndBuyReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/17 13:51
*/
@ApiModel
(
value
=
"GalaxyNftPublishAndBuyReqDto"
,
description
=
"NFT发行购买"
)
@Data
public
class
GalaxyNftPublishAndBuyReqDto
extends
GalaxyBaseReqDto
implements
Serializable
,
Cloneable
{
/**
* 以下为发行参数***********************************
*/
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"用户ID[30]"
)
@NotBlank
(
message
=
"用户ID不能为空!"
)
@Size
(
min
=
1
,
max
=
30
,
message
=
"用户ID限制2-30位且不能包含特殊字符"
)
private
String
userId
;
/**
* skuId
*/
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"系列唯一id标识,不超过20个字符"
)
@NotBlank
(
message
=
"skuId不能为空!"
)
@Size
(
min
=
2
,
max
=
20
,
message
=
"skuId限制2-20位且不能包含特殊字符"
)
private
String
skuId
;
/**
* nftOrderPayId
*/
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"nft订单支付id(保证唯一),不超过30个字符"
)
@NotBlank
(
message
=
"nft订单支付id不能为空"
)
@Size
(
min
=
2
,
max
=
30
,
message
=
"nft订单支付id限制2-30位且不能包含特殊字符"
)
private
String
nftOrderPayId
;
@Override
public
String
toString
(){
return
JsonUtils
.
toJson
(
this
);
}
private
static
final
GalaxyNftPublishAndBuyReqDto
obj
=
new
GalaxyNftPublishAndBuyReqDto
();
public
static
GalaxyNftPublishAndBuyReqDto
getNew
()
{
try
{
return
(
GalaxyNftPublishAndBuyReqDto
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GalaxyNftPublishAndBuyReqDto
();
}
}
}
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/param/GalaxyNftPublishAndBuyRespDto.java
0 → 100644
View file @
459ae0d6
package
com
.
liquidnet
.
service
.
galaxy
.
dto
.
param
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyNftPublishAndBuyRespDto
* @Package com.liquidnet.service.galaxy.dto.param;
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/17 13:51
*/
@ApiModel
(
value
=
"GalaxyNftPublishAndBuyRespDto"
,
description
=
"NFT购买"
)
@Data
public
class
GalaxyNftPublishAndBuyRespDto
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"用户Id"
)
private
String
userId
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"用户购买的nftId"
)
private
String
nftId
;
@Override
public
String
toString
(){
return
JsonUtils
.
toJson
(
this
);
}
private
static
final
GalaxyNftPublishAndBuyRespDto
obj
=
new
GalaxyNftPublishAndBuyRespDto
();
public
static
GalaxyNftPublishAndBuyRespDto
getNew
()
{
try
{
return
(
GalaxyNftPublishAndBuyRespDto
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GalaxyNftPublishAndBuyRespDto
();
}
}
}
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/param/GalaxyNftPublishReqDto.java
0 → 100644
View file @
459ae0d6
package
com
.
liquidnet
.
service
.
galaxy
.
dto
.
param
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: NFT购买(涉及NFT发行、NFT购买)
* @class: GalaxyNftPublishReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/17 13:51
*/
@ApiModel
(
value
=
"GalaxyNftPublishReqDto"
,
description
=
"NFT发行"
)
@Data
public
class
GalaxyNftPublishReqDto
extends
GalaxyBaseReqDto
implements
Serializable
,
Cloneable
{
/**
* 以下为发行参数***********************************
*/
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"用户ID[30]"
)
@NotBlank
(
message
=
"用户ID不能为空!"
)
@Size
(
min
=
1
,
max
=
30
,
message
=
"用户ID限制2-30位且不能包含特殊字符"
)
private
String
userId
;
/**
* skuId
*/
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"系列唯一id标识,不超过20个字符"
)
@NotBlank
(
message
=
"skuId不能为空!"
)
@Size
(
min
=
2
,
max
=
20
,
message
=
"skuId限制2-20位且不能包含特殊字符"
)
private
String
skuId
;
/**
* nftOrderPayId
*/
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"nft订单支付id(保证唯一),不超过30个字符"
)
@NotBlank
(
message
=
"nft订单支付id不能为空"
)
@Size
(
min
=
2
,
max
=
30
,
message
=
"nft订单支付id限制2-30位且不能包含特殊字符"
)
private
String
nftOrderPayId
;
@Override
public
String
toString
(){
return
JsonUtils
.
toJson
(
this
);
}
private
static
final
GalaxyNftPublishReqDto
obj
=
new
GalaxyNftPublishReqDto
();
public
static
GalaxyNftPublishReqDto
getNew
()
{
try
{
return
(
GalaxyNftPublishReqDto
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GalaxyNftPublishReqDto
();
}
}
}
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/param/GalaxyNftPublishRespDto.java
0 → 100644
View file @
459ae0d6
package
com
.
liquidnet
.
service
.
galaxy
.
dto
.
param
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyNftPublishRespDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/17 13:51
*/
@ApiModel
(
value
=
"GalaxyNftPublishRespDto"
,
description
=
"NFT发行"
)
@Data
public
class
GalaxyNftPublishRespDto
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"用户Id"
)
private
String
userId
;
@ApiModelProperty
(
position
=
1
,
required
=
true
,
value
=
"用户购买的nftId"
)
private
String
nftId
;
@Override
public
String
toString
(){
return
JsonUtils
.
toJson
(
this
);
}
private
static
final
GalaxyNftPublishRespDto
obj
=
new
GalaxyNftPublishRespDto
();
public
static
GalaxyNftPublishRespDto
getNew
()
{
try
{
return
(
GalaxyNftPublishRespDto
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GalaxyNftPublishRespDto
();
}
}
}
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/vo/mongo/GalaxyNftOrderVo.java
View file @
459ae0d6
...
...
@@ -32,7 +32,7 @@ public class GalaxyNftOrderVo implements Serializable,Cloneable {
/**
* 接入方买入唯一标识
*/
private
String
o
rderPayId
;
private
String
nftO
rderPayId
;
/**
* nftId
*/
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/service/IGalaxyPublishService.java
View file @
459ae0d6
...
...
@@ -2,8 +2,8 @@ package com.liquidnet.service.galaxy.service;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNft
Buy
ReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNft
Buy
RespDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNft
Publish
ReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNft
Publish
RespDto
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
...
...
@@ -15,5 +15,5 @@ import com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyRespDto;
* @date 2022/3/8 11:45
*/
public
interface
IGalaxyPublishService
{
ResponseDto
<
GalaxyNft
BuyRespDto
>
nftBuy
(
GalaxyNftBuy
ReqDto
reqDto
);
ResponseDto
<
GalaxyNft
PublishRespDto
>
nftPublish
(
GalaxyNftPublish
ReqDto
reqDto
);
}
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/service/IGalaxyTradeService.java
View file @
459ae0d6
package
com
.
liquidnet
.
service
.
galaxy
.
service
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyRespDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyRespDto
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -11,4 +17,7 @@ package com.liquidnet.service.galaxy.service;
* @date 2022/3/8 11:45
*/
public
interface
IGalaxyTradeService
{
ResponseDto
<
GalaxyNftBuyRespDto
>
nftBuy
(
GalaxyNftBuyReqDto
reqDto
);
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
nftPublishAndBuy
(
GalaxyNftPublishAndBuyReqDto
reqDto
);
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/controller/GalaxyNftTradeController.java
deleted
100644 → 0
View file @
4eb7e81a
package
com
.
liquidnet
.
service
.
galaxy
.
controller
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: NFT购买
* @class: GalaxyNftTradeController
* @Package com.liquidnet.service.galaxy.controller
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/14 18:08
*/
@Api
(
tags
=
"NFT艺术品相关"
)
@RestController
@RequestMapping
(
"nftTrade"
)
@Validated
@Slf4j
public
class
GalaxyNftTradeController
{
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/controller/GalaxyPublishController.java
View file @
459ae0d6
...
...
@@ -3,8 +3,8 @@ 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.GalaxyNft
Buy
ReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNft
Buy
RespDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNft
Publish
ReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNft
Publish
RespDto
;
import
com.liquidnet.service.galaxy.service.IGalaxyPublishService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -27,7 +27,7 @@ import javax.validation.Valid;
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 12:11
*/
@Api
(
tags
=
"NFT-发行
购买
相关"
)
@Api
(
tags
=
"NFT-发行相关"
)
@RestController
@RequestMapping
(
"nftPublish"
)
@Validated
...
...
@@ -36,11 +36,11 @@ public class GalaxyPublishController {
@Autowired
private
IGalaxyPublishService
galaxyPublishService
;
@ControllerLog
(
description
=
"NFT
购买
"
)
@ControllerLog
(
description
=
"NFT
发行
"
)
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"NFT
购买
"
)
@PostMapping
(
value
=
{
"nft
Buy
"
})
public
ResponseDto
<
GalaxyNft
BuyRespDto
>
nftBuy
(
@Valid
@RequestBody
GalaxyNftBuy
ReqDto
reqDto
){
return
galaxyPublishService
.
nft
Buy
(
reqDto
);
@ApiOperation
(
value
=
"NFT
发行
"
)
@PostMapping
(
value
=
{
"nft
Publish
"
})
public
ResponseDto
<
GalaxyNft
PublishRespDto
>
nftPublish
(
@Valid
@RequestBody
GalaxyNftPublish
ReqDto
reqDto
){
return
galaxyPublishService
.
nft
Publish
(
reqDto
);
}
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/controller/GalaxyTradeController.java
0 → 100644
View file @
459ae0d6
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.GalaxyNftBuyReqDto
;
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.service.IGalaxyTradeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.validation.Valid
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: NFT购买
* @class: GalaxyNftTradeController
* @Package com.liquidnet.service.galaxy.controller
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/14 18:08
*/
@Api
(
tags
=
"NFT交易相关"
)
@RestController
@RequestMapping
(
"nftTrade"
)
@Validated
@Slf4j
public
class
GalaxyTradeController
{
@Autowired
private
IGalaxyTradeService
galaxyTradeService
;
@ControllerLog
(
description
=
"NFT购买"
)
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"NFT购买"
)
@PostMapping
(
value
=
{
"nftBuy"
})
public
ResponseDto
<
GalaxyNftBuyRespDto
>
nftBuy
(
@Valid
@RequestBody
GalaxyNftBuyReqDto
reqDto
){
return
galaxyTradeService
.
nftBuy
(
reqDto
);
}
@ControllerLog
(
description
=
"NFT购买(发行+购买)"
)
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"NFT购买(发行+购买)"
)
@PostMapping
(
value
=
{
"nftPublishAndBuy"
})
public
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
nftPublishAndBuy
(
@Valid
@RequestBody
GalaxyNftPublishAndBuyReqDto
reqDto
){
return
galaxyTradeService
.
nftPublishAndBuy
(
reqDto
);
}
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/strategy/IGalaxyRouterStrategy.java
View file @
459ae0d6
...
...
@@ -21,5 +21,9 @@ public interface IGalaxyRouterStrategy {
ResponseDto
<
GalaxyArtSeriesClaimRespDto
>
seriesClaim
(
GalaxyArtSeriesClaimReqDto
reqDto
);
ResponseDto
<
GalaxyNftPublishRespDto
>
nftPublish
(
GalaxyNftPublishReqDto
reqDto
);
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
nftPublishAndBuy
(
GalaxyNftPublishAndBuyReqDto
reqDto
);
ResponseDto
<
GalaxyNftBuyRespDto
>
nftBuy
(
GalaxyNftBuyReqDto
reqDto
);
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/strategy/impl/GalaxyRouterStrategyEthImpl.java
View file @
459ae0d6
...
...
@@ -26,6 +26,16 @@ public class GalaxyRouterStrategyEthImpl extends AbstractGalaxyRouterStrategyImp
return
null
;
}
@Override
public
ResponseDto
<
GalaxyNftPublishRespDto
>
nftPublish
(
GalaxyNftPublishReqDto
reqDto
)
{
return
null
;
}
@Override
public
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
nftPublishAndBuy
(
GalaxyNftPublishAndBuyReqDto
reqDto
)
{
return
null
;
}
@Override
public
ResponseDto
<
GalaxyUserRegisterRespDto
>
userRegister
(
GalaxyUserRegisterReqDto
reqDto
)
{
return
null
;
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/strategy/impl/GalaxyRouterStrategyZxlImpl.java
View file @
459ae0d6
...
...
@@ -6,6 +6,7 @@ import com.liquidnet.service.galaxy.dto.param.*;
import
com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterHandler
;
import
com.liquidnet.service.galaxy.router.zxin.biz.ZxinArtworkBiz
;
import
com.liquidnet.service.galaxy.router.zxin.biz.ZxinPublishBiz
;
import
com.liquidnet.service.galaxy.router.zxin.biz.ZxinTradeBiz
;
import
com.liquidnet.service.galaxy.router.zxin.biz.ZxinUserBiz
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -33,6 +34,9 @@ public class GalaxyRouterStrategyZxlImpl extends AbstractGalaxyRouterStrategyImp
@Autowired
private
ZxinPublishBiz
zxinPublishBiz
;
@Autowired
private
ZxinTradeBiz
zxinTradeBiz
;
@Override
public
ResponseDto
<
GalaxyUserRegisterRespDto
>
userRegister
(
GalaxyUserRegisterReqDto
reqDto
)
{
return
zxinUserBiz
.
userRegister
(
reqDto
);
...
...
@@ -53,8 +57,18 @@ public class GalaxyRouterStrategyZxlImpl extends AbstractGalaxyRouterStrategyImp
return
zxinArtworkBiz
.
seriesClaim
(
reqDto
);
}
@Override
public
ResponseDto
<
GalaxyNftPublishRespDto
>
nftPublish
(
GalaxyNftPublishReqDto
reqDto
)
{
return
zxinPublishBiz
.
nftPublish
(
reqDto
);
}
@Override
public
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
nftPublishAndBuy
(
GalaxyNftPublishAndBuyReqDto
reqDto
)
{
return
zxinPublishBiz
.
nftPublishAndBuy
(
reqDto
);
}
@Override
public
ResponseDto
<
GalaxyNftBuyRespDto
>
nftBuy
(
GalaxyNftBuyReqDto
reqDto
)
{
return
zxin
Publish
Biz
.
nftBuy
(
reqDto
);
return
zxin
Trade
Biz
.
nftBuy
(
reqDto
);
}
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinPublishBiz.java
View file @
459ae0d6
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinTradeBiz.java
View file @
459ae0d6
package
com
.
liquidnet
.
service
.
galaxy
.
router
.
zxin
.
biz
;
import
com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz
;
import
com.liquidnet.common.third.zxlnft.config.ZxlnftConfig
;
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.IDGenerator
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.constant.GalaxyErrorCodeEnum
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyRespDto
;
import
com.liquidnet.service.galaxy.utils.DataUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
...
...
@@ -15,4 +32,110 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
public
class
ZxinTradeBiz
{
@Autowired
private
ZxlnftSdkUtil
zxlnftSdkUtil
;
@Autowired
private
ZxlWalletSdkUtil
zxlWalletSdkUtil
;
@Autowired
private
ZxlnftBiz
zxlnftBiz
;
@Autowired
private
ZxlnftConfig
zxlnftConfig
;
@Autowired
private
DataUtils
dataUtils
;
public
ResponseDto
<
GalaxyNftBuyRespDto
>
nftBuy
(
GalaxyNftBuyReqDto
nftBuyReqDto
){
//获取用户信息
GalaxyUserInfoBo
userInfoBo
=
dataUtils
.
getGalaxyUserInfo
(
nftBuyReqDto
.
getRouteType
(),
nftBuyReqDto
.
getUserId
());
//获取sku信息
GalaxySeriesInfoBo
seriesInfoBo
=
dataUtils
.
getSeriesInfoBo
(
nftBuyReqDto
.
getRouteType
(),
nftBuyReqDto
.
getSkuId
());
//获取nftOrder信息
GalaxyNftOrderBo
nftOrderBo
=
dataUtils
.
getNftOrderBo
(
nftBuyReqDto
.
getRouteType
(),
nftBuyReqDto
.
getNftOrderPayId
());
//返回参数nftId
String
nftId
=
null
;
if
(
StringUtil
.
isNotNull
(
nftOrderBo
)){
nftId
=
nftOrderBo
.
getNftId
();
}
if
(
StringUtil
.
isNotEmpty
(
nftId
)){
//执行购买逻辑
GalaxyNftBuyRespDto
nftBuyRespDto
=
this
.
nftBuyBusiness
(
nftId
,
userInfoBo
,
seriesInfoBo
);
return
ResponseDto
.
success
(
nftBuyRespDto
);
}
else
{
return
ResponseDto
.
failure
(
GalaxyErrorCodeEnum
.
PUBLISH_BUY_FAIL
.
getCode
(),
GalaxyErrorCodeEnum
.
PUBLISH_BUY_FAIL
.
getMessage
());
}
}
public
GalaxyNftBuyRespDto
nftBuyBusiness
(
String
nftId
,
GalaxyUserInfoBo
userInfoBo
,
GalaxySeriesInfoBo
seriesInfoBo
){
// 3.2.2调用购买NFT接口
Nft043BuyReqDto
nft043BuyReqDto
=
Nft043BuyReqDto
.
getNew
();
nft043BuyReqDto
.
setNftId
(
nftId
);
nft043BuyReqDto
.
setApplyScore
(
seriesInfoBo
.
getSellCount
().
intValue
());
nft043BuyReqDto
.
setReceiverPubKey
(
userInfoBo
.
getUserPubKey
());
nft043BuyReqDto
.
setPointReceiverAddr
(
userInfoBo
.
getBlockChainAddress
());
nft043BuyReqDto
.
setOfferCount
(
seriesInfoBo
.
getSellCount
().
longValue
());
nft043BuyReqDto
.
setOperateId
(
IDGenerator
.
get32UUID
());
/**
* 接收人的私钥签名,签名对象是(platformPubKey_receiverPubKey_pointReceiverAddr_applyScore_接口名_nftId_offerCount_operateId)
* 接口名:buy_nft
*/
String
signMetaData
=
zxlnftConfig
.
getNftPlatformPubKey
()
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getReceiverPubKey
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getPointReceiverAddr
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getApplyScore
().
toString
())
.
concat
(
"_"
).
concat
(
"buy_nft"
)
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getNftId
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOfferCount
().
toString
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOperateId
());
String
signature
=
zxlnftBiz
.
createSign
(
userInfoBo
.
getUserPriKey
(),
signMetaData
);
nft043BuyReqDto
.
setSignature
(
signature
);
ZxlnftResponseDto
<
Nft043BuyRespDto
>
nft043RespDto
=
zxlnftSdkUtil
.
nft043Buy
(
nft043BuyReqDto
);
if
(
nft043RespDto
.
isSuccess
()){
//3.2.4查询NFT购买结果
Nft044BuyResultReqDto
nft044ReqDto
=
Nft044BuyResultReqDto
.
getNew
();
nft044ReqDto
.
setTaskId
(
nft043RespDto
.
getData
().
getTaskId
());
long
timeStart
=
System
.
currentTimeMillis
();
ZxlnftResponseDto
<
Nft044BuyResultRespDto
>
nft044RespDto
=
zxlnftSdkUtil
.
nft044BuyResult
(
nft044ReqDto
);
if
(
nft044RespDto
.
isSuccess
()){
int
count
=
1
;
String
payTaskId
=
null
;
while
(
payTaskId
==
null
){
try
{
Thread
.
sleep
(
1000
l
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
count
++;
log
.
info
(
"=======执行第{}次查询,taskId:{}"
,
1
,
nft044ReqDto
.
getTaskId
());
ZxlnftResponseDto
<
Nft044BuyResultRespDto
>
nft044RespDtoTemp
=
zxlnftSdkUtil
.
nft044BuyResult
(
nft044ReqDto
);
if
(
nft044RespDtoTemp
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_SUCCESS
.
getCode
())){
payTaskId
=
nft044RespDtoTemp
.
getData
().
getPayTaskId
();
}
else
if
(
nft044RespDtoTemp
.
getData
().
getTaskStatus
().
toString
().
equals
(
ZxlnftEnum
.
TaskStatusEnum
.
TASK_FAIL
.
getCode
())){
log
.
info
(
"任务执行失败!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
return
null
;
}
if
(
count
==
6
){
log
.
info
(
"=======查询共6次,跳出循环!taskId:{}"
,
nft044ReqDto
.
getTaskId
());
break
;
}
}
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
);
}
}
}
return
null
;
}
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/service/impl/GalaxyPublishServiceImpl.java
View file @
459ae0d6
package
com
.
liquidnet
.
service
.
galaxy
.
service
.
impl
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyRespDto
;
import
com.liquidnet.service.galaxy.dto.param.*
;
import
com.liquidnet.service.galaxy.router.strategy.GalaxyRouterStrategyContext
;
import
com.liquidnet.service.galaxy.service.IGalaxyPublishService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -12,7 +11,7 @@ import org.springframework.stereotype.Service;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description:
TODO
* @Description:
NFT发行相关
* @class: GalaxyPublishServiceImpl
* @Package com.liquidnet.service.galaxy.service.impl
* @Copyright: LightNet @ Copyright (c) 2021
...
...
@@ -25,7 +24,7 @@ public class GalaxyPublishServiceImpl implements IGalaxyPublishService {
private
GalaxyRouterStrategyContext
galaxyRouterStrategyContext
;
@Override
public
ResponseDto
<
GalaxyNft
BuyRespDto
>
nftBuy
(
GalaxyNftBuy
ReqDto
reqDto
)
{
return
galaxyRouterStrategyContext
.
getStrategy
(
reqDto
.
getRouteType
()).
nft
Buy
(
reqDto
);
public
ResponseDto
<
GalaxyNft
PublishRespDto
>
nftPublish
(
GalaxyNftPublish
ReqDto
reqDto
)
{
return
galaxyRouterStrategyContext
.
getStrategy
(
reqDto
.
getRouteType
()).
nft
Publish
(
reqDto
);
}
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/service/impl/GalaxyTradeServiceImpl.java
0 → 100644
View file @
459ae0d6
package
com
.
liquidnet
.
service
.
galaxy
.
service
.
impl
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyReqDto
;
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.router.strategy.GalaxyRouterStrategyContext
;
import
com.liquidnet.service.galaxy.service.IGalaxyTradeService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyTradeServiceImpl
* @Package com.liquidnet.service.galaxy.service.impl
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/17 14:19
*/
@Slf4j
@Service
public
class
GalaxyTradeServiceImpl
implements
IGalaxyTradeService
{
@Autowired
private
GalaxyRouterStrategyContext
galaxyRouterStrategyContext
;
@Override
public
ResponseDto
<
GalaxyNftBuyRespDto
>
nftBuy
(
GalaxyNftBuyReqDto
reqDto
)
{
return
galaxyRouterStrategyContext
.
getStrategy
(
reqDto
.
getRouteType
()).
nftBuy
(
reqDto
);
}
@Override
public
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
nftPublishAndBuy
(
GalaxyNftPublishAndBuyReqDto
reqDto
)
{
return
galaxyRouterStrategyContext
.
getStrategy
(
reqDto
.
getRouteType
()).
nftPublishAndBuy
(
reqDto
);
}
}
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/utils/DataUtils.java
View file @
459ae0d6
...
...
@@ -61,9 +61,9 @@ public class DataUtils {
}
}
public
void
setNftOrderBo
(
String
routeType
,
String
sku
Id
,
GalaxyNftOrderBo
nftOrderBo
)
{
public
void
setNftOrderBo
(
String
routeType
,
String
nftOrderPay
Id
,
GalaxyNftOrderBo
nftOrderBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KET_GALAXY_TRADE
.
concat
(
routeType
).
concat
(
":"
)
+
sku
Id
,
nftOrderBo
,
keyExpireTime
);
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KET_GALAXY_TRADE
.
concat
(
routeType
).
concat
(
":"
)
+
nftOrderPay
Id
,
nftOrderBo
,
keyExpireTime
);
/**
* 入库mongo
*/
...
...
@@ -77,7 +77,7 @@ public class DataUtils {
if
(
obj
!=
null
){
return
(
GalaxyNftOrderBo
)
obj
;
}
else
{
GalaxyNftOrderVo
nftOrderVo
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"
o
rderPayId"
).
is
(
orderPayId
)),
GalaxyNftOrderVo
.
class
,
GalaxyNftOrderVo
.
class
.
getSimpleName
());
GalaxyNftOrderVo
nftOrderVo
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"
nftO
rderPayId"
).
is
(
orderPayId
)),
GalaxyNftOrderVo
.
class
,
GalaxyNftOrderVo
.
class
.
getSimpleName
());
if
(
nftOrderVo
==
null
)
{
return
null
;
}
...
...
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