记得上下班打卡 | git大法好,push需谨慎

Commit 0fb5fdab authored by anjiabin's avatar anjiabin

Merge remote-tracking branch 'origin/dev-zxlnft' into dev-zxlnft

# Conflicts:
#	liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/test/java/com/liquidnet/service/galaxy/TestZxlnftSdkUtil.java
parents 26fe54b2 0fdd01d3
...@@ -91,6 +91,140 @@ public class GalaxyConstant { ...@@ -91,6 +91,140 @@ public class GalaxyConstant {
} }
} }
/**
* 注册类型
*/
public enum RegisterTypeEnum{
PERSON("1","企业"),
COMPANY("2","个人");
private String code;
private String message;
RegisterTypeEnum(String code, String message) {
this.code = code;
this.message = message;
}
public RegisterTypeEnum getEnumByCode(String code){
RegisterTypeEnum[] arry = RegisterTypeEnum.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 enum CardTypeEnum{
// 1-身份证 2-护照 3-港澳通行证 4-台湾通行证 5-外国人永居身份证 6-港澳台居民居住证 7-其它
ID_CARD("1","身份证"),
ID_CARD_PP("2","护照"),
ID_CARD_HM("3","港澳通行证"),
ID_CARD_TW("4","台湾通行证"),
ID_CARD_FOR("5","外国人永居身份证"),
ID_CARD_HMTW("6","港澳台居民居住证"),
ID_CARD_OTHER("7","其它");
private String code;
private String message;
CardTypeEnum(String code, String message) {
this.code = code;
this.message = message;
}
public CardTypeEnum getEnumByCode(String code){
CardTypeEnum[] arry = CardTypeEnum.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 enum TaskStatusEnum{
PROCESSING("0","任务执行中"),
TASK_SUCCESS("1","任务成功"),
TASK_FAIL("2","任务失败");
private String code;
private String message;
TaskStatusEnum(String code, String message) {
this.code = code;
this.message = message;
}
public TaskStatusEnum getEnumByCode(String code){
TaskStatusEnum[] arry = TaskStatusEnum.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;
}
}
/**
* 标记任务状态
*/
public enum UserBindStatusEnum{
BIND_PROCESSING("0","绑定中"),
BIND_SUCCESS("1","已绑定"),
BIND_FAIL("2","绑定失败"),
BIND_CANNOT_QUERY("3","未发起过绑定(未查询到)");
private String code;
private String message;
UserBindStatusEnum(String code, String message) {
this.code = code;
this.message = message;
}
public UserBindStatusEnum getEnumByCode(String code){
UserBindStatusEnum[] arry = UserBindStatusEnum.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;
}
}
public static void main(String[] args) { public static void main(String[] args) {
Integer aaa = 1; Integer aaa = 1;
if(aaa.toString().equals(RouterTypeEnum.ZXINCHAIN.getCode())){ if(aaa.toString().equals(RouterTypeEnum.ZXINCHAIN.getCode())){
......
...@@ -52,6 +52,16 @@ public class GalaxyNftOrderBo implements Serializable,Cloneable { ...@@ -52,6 +52,16 @@ public class GalaxyNftOrderBo implements Serializable,Cloneable {
*/ */
private String toAddress; private String toAddress;
/**
* nft发行任务ID
*/
private String nftPublishTaskId;
/**
* nft购买
* @return
*/
@Override @Override
public String toString(){ public String toString(){
return JsonUtils.toJson(this); return JsonUtils.toJson(this);
......
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: TODO
* @class: GalaxyArtSeriesClaimResultQueryReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 10:51
*/
@ApiModel(value = "GalaxyArtSeriesClaimResultQueryReqDto", description = "NFT系列声明结果查询")
@Data
public class GalaxyArtSeriesClaimResultQueryReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
@ApiModelProperty(position = 1, required = true, value = "系列唯一id标识,不超过20个字符")
@NotBlank(message = "skuId不能为空!")
@Size(min = 2, max = 20, message = "skuId限制2-20位且不能包含特殊字符")
private String skuId;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyArtSeriesClaimResultQueryReqDto obj = new GalaxyArtSeriesClaimResultQueryReqDto();
public static GalaxyArtSeriesClaimResultQueryReqDto getNew() {
try {
return (GalaxyArtSeriesClaimResultQueryReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyArtSeriesClaimResultQueryReqDto();
}
}
}
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: GalaxyArtSeriesClaimResultQueryRespDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 10:51
*/
@ApiModel(value = "GalaxyArtSeriesClaimResultQueryRespDto", description = "NFT系列声明返回结果")
@Data
public class GalaxyArtSeriesClaimResultQueryRespDto implements Serializable,Cloneable {
/**
* 标记任务状态,2:任务执行中 7:任务成功 10:任务失败
*/
@ApiModelProperty(position = 3, required = true, value = "标记任务状态,0:任务执行中 1:任务成功 2:任务失败")
private Integer taskStatus;
/**
* 失败情况下会有提示信息
*/
@ApiModelProperty(position = 3, required = true, value = "失败情况下会有提示信息")
private String taskMsg;
/**
* 系列ID,后面用于查询系列信息
*/
@ApiModelProperty(position = 3, required = true, value = "系列ID,后面用于查询系列信息")
private String seriesId;
/**
* 交易hash
*/
@ApiModelProperty(position = 3, required = true, value = "交易hash")
private String txHash;
/**
* 链上交易时间戳
*/
@ApiModelProperty(position = 3, required = true, value = "chainTimestamp")
private Long chainTimestamp;
@Override
public String toString() {
return JsonUtils.toJson(this);
}
private static final GalaxyArtSeriesClaimResultQueryRespDto obj = new GalaxyArtSeriesClaimResultQueryRespDto();
public static GalaxyArtSeriesClaimResultQueryRespDto getNew() {
try {
return (GalaxyArtSeriesClaimResultQueryRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyArtSeriesClaimResultQueryRespDto();
}
}
}
\ No newline at end of file
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: TODO
* @class: GalaxyNftBuyPayResultQueryReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 11:23
*/
@ApiModel(value = "GalaxyNftBuyPayResultQueryReqDto", description = "NFT购买支付结果查询")
@Data
public class GalaxyNftBuyPayResultQueryReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
/**
* 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 GalaxyNftBuyPayResultQueryReqDto obj = new GalaxyNftBuyPayResultQueryReqDto();
public static GalaxyNftBuyPayResultQueryReqDto getNew() {
try {
return (GalaxyNftBuyPayResultQueryReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftBuyPayResultQueryReqDto();
}
}
}
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: GalaxyNftBuyPayResultQueryRespDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 11:23
*/
@ApiModel(value = "GalaxyNftBuyPayResultQueryRespDto", description = "NFT购买支付结果查询")
@Data
public class GalaxyNftBuyPayResultQueryRespDto implements Serializable,Cloneable {
/**
* 标记任务状态,0:任务执行中 1:任务成功 2:任务失败
*/
@ApiModelProperty(position = 3, required = true, value = "标记任务状态,0:任务执行中 1:任务成功 2:任务失败")
private Integer taskStatus;
/**
* 失败情况下会有提示信息
*/
@ApiModelProperty(position = 3, required = true, value = "失败情况下会有提示信息")
private String taskMsg;
/**
* 交易hash
*/
@ApiModelProperty(position = 3, required = true, value = "交易hash")
private String txHash;
/**
* 链上交易时间戳
*/
@ApiModelProperty(position = 3, required = true, value = "chainTimestamp")
private Long chainTimestamp;
@Override
public String toString() {
return JsonUtils.toJson(this);
}
private static final GalaxyNftBuyPayResultQueryRespDto obj = new GalaxyNftBuyPayResultQueryRespDto();
public static GalaxyNftBuyPayResultQueryRespDto getNew() {
try {
return (GalaxyNftBuyPayResultQueryRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftBuyPayResultQueryRespDto();
}
}
}
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: TODO
* @class: GalaxyNftBuyResultQueryReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 11:22
*/
@ApiModel(value = "GalaxyNftBuyResultQueryReqDto", description = "NFT购买结果查询")
@Data
public class GalaxyNftBuyResultQueryReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
/**
* 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 GalaxyNftBuyResultQueryReqDto obj = new GalaxyNftBuyResultQueryReqDto();
public static GalaxyNftBuyResultQueryReqDto getNew() {
try {
return (GalaxyNftBuyResultQueryReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftBuyResultQueryReqDto();
}
}
}
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: GalaxyNftBuyResultQueryRespDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 11:23
*/
@ApiModel(value = "GalaxyNftBuyResultQueryRespDto", description = "NFT购买结果查询")
@Data
public class GalaxyNftBuyResultQueryRespDto implements Serializable,Cloneable {
@ApiModelProperty(position = 3, required = true, value = "标记任务状态,0:任务执行中 1:任务成功 2:任务失败")
private Integer taskStatus;
/**
* 失败情况下会有提示信息
*/
@ApiModelProperty(position = 3, required = true, value = "失败情况下会有提示信息")
private String taskMsg;
/**
* 交易hash
*/
@ApiModelProperty(position = 3, required = true, value = "交易hash")
private String txHash;
/**
* 链上交易时间戳
*/
@ApiModelProperty(position = 3, required = true, value = "chainTimestamp")
private Long chainTimestamp;
@ApiModelProperty(position = 3, required = true, value = "支付任务ID")
private String payTaskId;
@Override
public String toString() {
return JsonUtils.toJson(this);
}
private static final GalaxyNftBuyResultQueryRespDto obj = new GalaxyNftBuyResultQueryRespDto();
public static GalaxyNftBuyResultQueryRespDto getNew() {
try {
return (GalaxyNftBuyResultQueryRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftBuyResultQueryRespDto();
}
}
}
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: TODO
* @class: GalaxyNftPublishResultQueryReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 11:22
*/
@ApiModel(value = "GalaxyNftPublishResultQueryReqDto", description = "NFT发行结果查询")
@Data
public class GalaxyNftPublishResultQueryReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
/**
* 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 GalaxyNftPublishResultQueryReqDto obj = new GalaxyNftPublishResultQueryReqDto();
public static GalaxyNftPublishResultQueryReqDto getNew() {
try {
return (GalaxyNftPublishResultQueryReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftPublishResultQueryReqDto();
}
}
}
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: GalaxyNftPublishResultQueryRespDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 11:22
*/
@ApiModel(value = "GalaxyNftPublishResultQueryRespDto", description = "NFT发行结果查询")
@Data
public class GalaxyNftPublishResultQueryRespDto implements Serializable,Cloneable {
/**
* nftId格式,发行人公钥hash_系列_系列索引id,申请多少个,最后一段计算出来即可,
* 比如申请10个,nftIdBegin位xx_xx_1,那么就可以推导出x_xx_1到x_xx_10
*/
@ApiModelProperty(position = 3, required = true, value = "nftId格式")
private String nftIdBegin;
@ApiModelProperty(position = 3, required = true, value = "标记任务状态,0:任务执行中 1:任务成功 2:任务失败")
private Integer taskStatus;
/**
* 失败情况下会有提示信息
*/
@ApiModelProperty(position = 3, required = true, value = "失败情况下会有提示信息")
private String taskMsg;
/**
* 交易hash
*/
@ApiModelProperty(position = 3, required = true, value = "交易hash")
private String txHash;
/**
* 链上交易时间戳
*/
@ApiModelProperty(position = 3, required = true, value = "chainTimestamp")
private Long chainTimestamp;
@Override
public String toString() {
return JsonUtils.toJson(this);
}
private static final GalaxyNftPublishResultQueryRespDto obj = new GalaxyNftPublishResultQueryRespDto();
public static GalaxyNftPublishResultQueryRespDto getNew() {
try {
return (GalaxyNftPublishResultQueryRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftPublishResultQueryRespDto();
}
}
}
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: TODO
* @class: GalaxyUserBindStatusQueryReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 12:06
*/
@ApiModel(value = "GalaxyUserBindStatusQueryReqDto", description = "用户绑定状态查询")
@Data
public class GalaxyUserBindStatusQueryReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
/**
* nftOrderPayId
*/
@ApiModelProperty(position = 1, required = true, value = "用户区块链地址")
@NotBlank(message = "用户区块链地址不能为空!")
@Size(min = 2, max = 100, message = "用户区块链地址不能超过100个字符")
private String blockChainAddress;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyUserBindStatusQueryReqDto obj = new GalaxyUserBindStatusQueryReqDto();
public static GalaxyUserBindStatusQueryReqDto getNew() {
try {
return (GalaxyUserBindStatusQueryReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyUserBindStatusQueryReqDto();
}
}
}
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: GalaxyUserBindStatusQueryRespDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 12:06
*/
@ApiModel(value = "GalaxyUserBindStatusQueryRespDto", description = "用户绑定状态查询")
@Data
public class GalaxyUserBindStatusQueryRespDto implements Serializable,Cloneable {
@ApiModelProperty(position = 3, required = true, value = "用户区块链地址")
private String blockChainAddress;
@ApiModelProperty(position = 3, required = true, value = "0:绑定中 1:已绑定 2:绑定失败 3:未发起过绑定(未查询到)")
private Integer userBindStatus;
@Override
public String toString() {
return JsonUtils.toJson(this);
}
private static final GalaxyUserBindStatusQueryRespDto obj = new GalaxyUserBindStatusQueryRespDto();
public static GalaxyUserBindStatusQueryRespDto getNew() {
try {
return (GalaxyUserBindStatusQueryRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyUserBindStatusQueryRespDto();
}
}
}
...@@ -18,4 +18,6 @@ public interface IGalaxyArtworkService { ...@@ -18,4 +18,6 @@ public interface IGalaxyArtworkService {
ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto); ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto);
ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto); ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto);
ResponseDto<GalaxyArtSeriesClaimResultQueryRespDto> seriesClaimResultQuery(GalaxyArtSeriesClaimResultQueryReqDto reqDto);
} }
...@@ -4,6 +4,8 @@ package com.liquidnet.service.galaxy.service; ...@@ -4,6 +4,8 @@ package com.liquidnet.service.galaxy.service;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto; import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto; import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryRespDto;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
...@@ -16,4 +18,6 @@ import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto; ...@@ -16,4 +18,6 @@ import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto;
*/ */
public interface IGalaxyPublishService { public interface IGalaxyPublishService {
ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto); ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto);
ResponseDto<GalaxyNftPublishResultQueryRespDto> nftPublishResultQuery(GalaxyNftPublishResultQueryReqDto reqDto);
} }
...@@ -2,10 +2,7 @@ package com.liquidnet.service.galaxy.service; ...@@ -2,10 +2,7 @@ package com.liquidnet.service.galaxy.service;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyReqDto; import com.liquidnet.service.galaxy.dto.param.*;
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> * @author AnJiabin <anjiabin@zhengzai.tv>
...@@ -20,4 +17,8 @@ public interface IGalaxyTradeService { ...@@ -20,4 +17,8 @@ public interface IGalaxyTradeService {
ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto); ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto);
ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto); ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto);
ResponseDto<GalaxyNftBuyResultQueryRespDto> nftBuyResultQuery(GalaxyNftBuyResultQueryReqDto reqDto);
ResponseDto<GalaxyNftBuyPayResultQueryRespDto> nftBuyPayResultQuery(GalaxyNftBuyPayResultQueryReqDto reqDto);
} }
...@@ -2,6 +2,8 @@ package com.liquidnet.service.galaxy.service; ...@@ -2,6 +2,8 @@ package com.liquidnet.service.galaxy.service;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryRespDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto; import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto; import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
...@@ -16,4 +18,7 @@ import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto; ...@@ -16,4 +18,7 @@ import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
*/ */
public interface IGalaxyUserService { public interface IGalaxyUserService {
ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto); ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto);
ResponseDto<GalaxyUserBindStatusQueryRespDto> userBindStatusQuery(GalaxyUserBindStatusQueryReqDto reqDto);
} }
package com.liquidnet.commons.lang.util;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: TreadUtil
* @Package com.liquidnet.commons.lang.util
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/17 18:52
*/
@Slf4j
public class FixedSizeThreadPool {
//手写线程池需要准备什么?
// 1.需要1个仓库
private BlockingQueue<Runnable> blockingQueue;
// 2.需要一个线程的集合
private List<Thread> workers;
//3. 需要具体干活的线程
public static class Worker extends Thread {
// 图上的卡车
// 1.到我们的仓库中去拿东西(blockingQueue)
//
private FixedSizeThreadPool pool;
// 创建构造方法,声明自己属于哪个线程池
public Worker(FixedSizeThreadPool pool) {
this.pool = pool;
}
@Override
public void run() {
// 开始工作
while (this.pool.isWorking || this.pool.blockingQueue.size() > 0) {
Runnable task = null;
// 从队列中拿东西的时候,需要的是阻塞
try {
if (this.pool.isWorking) {
task = this.pool.blockingQueue.take();
} else {
task = this.pool.blockingQueue.poll();
}
} catch (Exception e) {
e.printStackTrace();
}
if (task != null) {
task.run();
log.info("线程:{}执行完毕", Thread.currentThread().getName());
// System.out.println("线程:"+Thread.currentThread().getName());
}
}
}
}
// 线程池的初始化,构造函数
public FixedSizeThreadPool(int poolSize, int taskSize) {
if (poolSize <= 0 || taskSize <= 0)
throw new IllegalArgumentException("非法参数");
this.blockingQueue = new LinkedBlockingQueue<>(taskSize);
this.workers = Collections.synchronizedList(new ArrayList<>());
for (int i = 0; i < poolSize; i++) {
Worker work = new Worker(this);
work.start();
workers.add(work);
}
}
// 把任务提交到仓库中的办法
public boolean submit(Runnable task) {
if (isWorking) {
return this.blockingQueue.offer(task);
} else {
return false;
}
}
// 关闭的方法:
//a.仓库停止接收任务
//b.一旦仓库中还有任务就要继续执行
//c. 拿任务就不该阻塞
//d.一旦任务阻塞,我就中断他
private volatile boolean isWorking = true;
public void shutDown() {
// 执行关闭即可
this.isWorking = false;
for (Thread thread : workers) {
if (thread.getState().equals(Thread.State.BLOCKED)) {
thread.interrupt();// 中断线程
}
}
}
public static void main(String[] args) {
FixedSizeThreadPool fixedSizeThreadPool = new FixedSizeThreadPool(3, 6);
for (int i = 0; i < 6; i++) {
fixedSizeThreadPool.submit(
new Runnable() {
@Override
public void run() {
System.out.println("放入线程");
try {
Thread.sleep(2000L);
} catch (InterruptedException e) {
e.printStackTrace();
log.error("一个线程被中断");
}
}
}
);
}
fixedSizeThreadPool.shutDown();
}
}
package com.liquidnet.service.galaxy.router.eth.service;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterArtworkHandler;
import com.liquidnet.service.galaxy.router.strategy.impl.AbstractGalaxyRouterStrategyArtwork;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyRouterStrategyEthArtworkImpl
* @Package com.liquidnet.service.galaxy.router.eth.service
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 13:49
*/
@Slf4j
@Component
@StrategyGalaxyRouterArtworkHandler(GalaxyConstant.RouterTypeEnum.ETH)
public class GalaxyRouterStrategyEthArtworkImpl extends AbstractGalaxyRouterStrategyArtwork {
}
package com.liquidnet.service.galaxy.router.eth.service;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterPublishHandler;
import com.liquidnet.service.galaxy.router.strategy.impl.AbstractGalaxyRouterStrategyPublish;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyRouterStrategyEthArtworkImpl
* @Package com.liquidnet.service.galaxy.router.eth.service
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 13:49
*/
@Slf4j
@Component
@StrategyGalaxyRouterPublishHandler(GalaxyConstant.RouterTypeEnum.ETH)
public class GalaxyRouterStrategyEthPublishImpl extends AbstractGalaxyRouterStrategyPublish {
}
package com.liquidnet.service.galaxy.router.eth.service;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterTradeHandler;
import com.liquidnet.service.galaxy.router.strategy.impl.AbstractGalaxyRouterStrategyTrade;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyRouterStrategyEthArtworkImpl
* @Package com.liquidnet.service.galaxy.router.eth.service
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 13:49
*/
@Slf4j
@Component
@StrategyGalaxyRouterTradeHandler(GalaxyConstant.RouterTypeEnum.ETH)
public class GalaxyRouterStrategyEthTradeImpl extends AbstractGalaxyRouterStrategyTrade {
}
package com.liquidnet.service.galaxy.router.eth.service;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterUserHandler;
import com.liquidnet.service.galaxy.router.strategy.impl.AbstractGalaxyRouterStrategyUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyRouterStrategyEthUserImpl
* @Package com.liquidnet.service.galaxy.router.eth.service
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 13:49
*/
@Slf4j
@Component
@StrategyGalaxyRouterUserHandler(GalaxyConstant.RouterTypeEnum.ETH)
public class GalaxyRouterStrategyEthUserImpl extends AbstractGalaxyRouterStrategyUser {
}
...@@ -16,13 +16,40 @@ import java.util.Map; ...@@ -16,13 +16,40 @@ import java.util.Map;
*/ */
@Component @Component
public class GalaxyRouterStrategyContext { public class GalaxyRouterStrategyContext {
private final Map<String, IGalaxyRouterStrategy> handlerMap = new HashMap<>(); private final Map<String, IGalaxyRouterStrategyArtwork> artworkHandlerMap = new HashMap<>();
private final Map<String, IGalaxyRouterStrategyUser> userHandlerMap = new HashMap<>();
private final Map<String, IGalaxyRouterStrategyPublish> publishHandlerMap = new HashMap<>();
private final Map<String, IGalaxyRouterStrategyTrade> tradeHandlerMap = new HashMap<>();
public IGalaxyRouterStrategy getStrategy(String type) { public IGalaxyRouterStrategyArtwork getArtworkStrategy(String type) {
return handlerMap.get(type); return artworkHandlerMap.get(type);
} }
public void putStrategy(String code, IGalaxyRouterStrategy strategy) { public void putArtworkStrategy(String code, IGalaxyRouterStrategyArtwork strategy) {
handlerMap.put(code, strategy); artworkHandlerMap.put(code, strategy);
}
public IGalaxyRouterStrategyUser getUserStrategy(String type) {
return userHandlerMap.get(type);
}
public void putUserStrategy(String code, IGalaxyRouterStrategyUser strategy) {
userHandlerMap.put(code, strategy);
}
public IGalaxyRouterStrategyPublish getPublishStrategy(String type) {
return publishHandlerMap.get(type);
}
public void putPublishStrategy(String code, IGalaxyRouterStrategyPublish strategy) {
publishHandlerMap.put(code, strategy);
}
public IGalaxyRouterStrategyTrade getTradeStrategy(String type) {
return tradeHandlerMap.get(type);
}
public void putTradeStrategy(String code, IGalaxyRouterStrategyTrade strategy) {
tradeHandlerMap.put(code, strategy);
} }
} }
package com.liquidnet.service.galaxy.router.strategy; package com.liquidnet.service.galaxy.router.strategy;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterHandler; import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterArtworkHandler;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterPublishHandler;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterTradeHandler;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterUserHandler;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -20,11 +23,33 @@ import java.util.Map; ...@@ -20,11 +23,33 @@ import java.util.Map;
public class GalaxyRouterStrategyListener implements ApplicationListener<ContextRefreshedEvent> { public class GalaxyRouterStrategyListener implements ApplicationListener<ContextRefreshedEvent> {
@Override @Override
public void onApplicationEvent(ContextRefreshedEvent event) { public void onApplicationEvent(ContextRefreshedEvent event) {
Map<String, Object> beans = event.getApplicationContext().getBeansWithAnnotation(StrategyGalaxyRouterHandler.class); //artwork
GalaxyRouterStrategyContext strategyContext = event.getApplicationContext().getBean(GalaxyRouterStrategyContext.class); GalaxyRouterStrategyContext strategyContext = event.getApplicationContext().getBean(GalaxyRouterStrategyContext.class);
beans.forEach((name, bean) -> { Map<String, Object> artworkBeans = event.getApplicationContext().getBeansWithAnnotation(StrategyGalaxyRouterArtworkHandler.class);
StrategyGalaxyRouterHandler typeHandler = bean.getClass().getAnnotation(StrategyGalaxyRouterHandler.class); artworkBeans.forEach((name, bean) -> {
strategyContext.putStrategy(typeHandler.value().getCode(), (IGalaxyRouterStrategy) bean); StrategyGalaxyRouterArtworkHandler typeHandler = bean.getClass().getAnnotation(StrategyGalaxyRouterArtworkHandler.class);
strategyContext.putArtworkStrategy(typeHandler.value().getCode(), (IGalaxyRouterStrategyArtwork)bean);
});
//user
Map<String, Object> userBeans = event.getApplicationContext().getBeansWithAnnotation(StrategyGalaxyRouterUserHandler.class);
userBeans.forEach((name, bean) -> {
StrategyGalaxyRouterUserHandler typeHandler = bean.getClass().getAnnotation(StrategyGalaxyRouterUserHandler.class);
strategyContext.putUserStrategy(typeHandler.value().getCode(),(IGalaxyRouterStrategyUser)bean);
});
//publish
Map<String, Object> publisBeans = event.getApplicationContext().getBeansWithAnnotation(StrategyGalaxyRouterPublishHandler.class);
publisBeans.forEach((name, bean) -> {
StrategyGalaxyRouterPublishHandler typeHandler = bean.getClass().getAnnotation(StrategyGalaxyRouterPublishHandler.class);
strategyContext.putPublishStrategy(typeHandler.value().getCode(),(IGalaxyRouterStrategyPublish)bean);
});
//trade
Map<String, Object> tradeBeans = event.getApplicationContext().getBeansWithAnnotation(StrategyGalaxyRouterTradeHandler.class);
tradeBeans.forEach((name, bean) -> {
StrategyGalaxyRouterTradeHandler typeHandler = bean.getClass().getAnnotation(StrategyGalaxyRouterTradeHandler.class);
strategyContext.putTradeStrategy(typeHandler.value().getCode(),(IGalaxyRouterStrategyTrade)bean);
}); });
} }
} }
...@@ -6,24 +6,16 @@ import com.liquidnet.service.galaxy.dto.param.*; ...@@ -6,24 +6,16 @@ import com.liquidnet.service.galaxy.dto.param.*;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 * @version V1.0
* @Description: TODO * @Description: 艺术品路由策略
* @class: Test * @class: IGalaxyRouterArtworkStrategy
* @Package com.liquidnet.service.galaxy.router.strategy * @Package com.liquidnet.service.galaxy.router.strategy
* @Copyright: LightNet @ Copyright (c) 2021 * @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/8 10:27 * @date 2022/3/18 12:27
*/ */
public interface IGalaxyRouterStrategy { public interface IGalaxyRouterStrategyArtwork {
ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto);
ResponseDto<GalaxyNftImageRespDto> nftImageCheck(GalaxyNftImageReqDto reqDto); ResponseDto<GalaxyNftImageRespDto> nftImageCheck(GalaxyNftImageReqDto reqDto);
ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto); ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto);
ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto); ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto);
ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto);
ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto);
ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto);
} }
package com.liquidnet.service.galaxy.router.strategy;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.*;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: IGalaxyRouterPublishStrategy
* @class: IGalaxyRouterArtworkStrategy
* @Package com.liquidnet.service.galaxy.router.strategy
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 12:27
*/
public interface IGalaxyRouterStrategyPublish {
ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto);
}
package com.liquidnet.service.galaxy.router.strategy;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.*;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 交易路由策略
* @class: IGalaxyRouterTradeStrategy
* @Package com.liquidnet.service.galaxy.router.strategy
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 12:27
*/
public interface IGalaxyRouterStrategyTrade {
ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto);
ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto);
}
package com.liquidnet.service.galaxy.router.strategy;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.*;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 用户路由策略
* @class: IGalaxyRouterUserStrategy
* @Package com.liquidnet.service.galaxy.router.strategy
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 12:27
*/
public interface IGalaxyRouterStrategyUser {
ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto);
}
package com.liquidnet.service.galaxy.router.strategy.annotation;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import java.lang.annotation.*;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: StrategyGalaxyRouterArtworkHandler
* @Package com.liquidnet.service.galaxy.router.strategy.annotation
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/8 11:31
*/
@Documented
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface StrategyGalaxyRouterArtworkHandler {
GalaxyConstant.RouterTypeEnum value();
}
package com.liquidnet.service.galaxy.router.strategy.annotation;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import java.lang.annotation.*;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: StrategyGalaxyRouterPublishHandler
* @Package com.liquidnet.service.galaxy.router.strategy.annotation
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/8 11:31
*/
@Documented
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface StrategyGalaxyRouterPublishHandler {
GalaxyConstant.RouterTypeEnum value();
}
package com.liquidnet.service.galaxy.router.strategy.annotation;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import java.lang.annotation.*;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: StrategyGalaxyRouterTradeHandler
* @Package com.liquidnet.service.galaxy.router.strategy.annotation
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/8 11:31
*/
@Documented
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface StrategyGalaxyRouterTradeHandler {
GalaxyConstant.RouterTypeEnum value();
}
...@@ -8,7 +8,7 @@ import java.lang.annotation.*; ...@@ -8,7 +8,7 @@ import java.lang.annotation.*;
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 * @version V1.0
* @Description: TODO * @Description: TODO
* @class: StrategyGalaxyRouterHandler * @class: StrategyGalaxyRouterUserHandler
* @Package com.liquidnet.service.galaxy.router.strategy.annotation * @Package com.liquidnet.service.galaxy.router.strategy.annotation
* @Copyright: LightNet @ Copyright (c) 2021 * @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/8 11:31 * @date 2022/3/8 11:31
...@@ -17,6 +17,6 @@ import java.lang.annotation.*; ...@@ -17,6 +17,6 @@ import java.lang.annotation.*;
@Inherited @Inherited
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface StrategyGalaxyRouterHandler { public @interface StrategyGalaxyRouterUserHandler {
GalaxyConstant.RouterTypeEnum value(); GalaxyConstant.RouterTypeEnum value();
} }
package com.liquidnet.service.galaxy.router.strategy.impl;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategyArtwork;
import lombok.extern.slf4j.Slf4j;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: AbstractGalaxyRouterArtworkStrategyImpl
* @Package com.liquidnet.service.galaxy.router.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 12:54
*/
@Slf4j
public abstract class AbstractGalaxyRouterStrategyArtwork implements IGalaxyRouterStrategyArtwork {
public ResponseDto<GalaxyNftImageRespDto> nftImageCheck(GalaxyNftImageReqDto reqDto){
return null;
}
public ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto){
return null;
}
public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto){
return null;
}
}
package com.liquidnet.service.galaxy.router.strategy.impl;
import com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategy;
import lombok.extern.slf4j.Slf4j;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: AbstractPayChannelStrategyImpl
* @Package com.liquidnet.service.dragon.channel.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/16 13:04
*/
@Slf4j
public abstract class AbstractGalaxyRouterStrategyImpl implements IGalaxyRouterStrategy {
}
package com.liquidnet.service.galaxy.router.strategy.impl;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto;
import com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategyPublish;
import lombok.extern.slf4j.Slf4j;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: AbstractGalaxyRouterPublishStrategyImpl
* @Package com.liquidnet.service.galaxy.router.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 12:54
*/
@Slf4j
public abstract class AbstractGalaxyRouterStrategyPublish implements IGalaxyRouterStrategyPublish {
public ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto) {
return null;
}
}
package com.liquidnet.service.galaxy.router.strategy.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.IGalaxyRouterStrategyTrade;
import lombok.extern.slf4j.Slf4j;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: AbstractGalaxyRouterTradeStrategyImpl
* @Package com.liquidnet.service.galaxy.router.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 12:54
*/
@Slf4j
public abstract class AbstractGalaxyRouterStrategyTrade implements IGalaxyRouterStrategyTrade {
public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto){
return null;
}
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto){
return null;
}
}
package com.liquidnet.service.galaxy.router.strategy.impl;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategyUser;
import lombok.extern.slf4j.Slf4j;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: AbstractGalaxyRouterUserStrategyImpl
* @Package com.liquidnet.service.galaxy.router.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/18 12:54
*/
@Slf4j
public abstract class AbstractGalaxyRouterStrategyUser implements IGalaxyRouterStrategyUser {
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto){
return null;
}
}
...@@ -6,7 +6,6 @@ import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum; ...@@ -6,7 +6,6 @@ import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum;
import com.liquidnet.common.third.zxlnft.dto.*; import com.liquidnet.common.third.zxlnft.dto.*;
import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil; import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil;
import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil; import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil; import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
...@@ -14,7 +13,8 @@ import com.liquidnet.service.galaxy.constant.GalaxyErrorCodeEnum; ...@@ -14,7 +13,8 @@ import com.liquidnet.service.galaxy.constant.GalaxyErrorCodeEnum;
import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo; import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo; import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo; import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
import com.liquidnet.service.galaxy.dto.param.*; import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto;
import com.liquidnet.service.galaxy.utils.DataUtils; import com.liquidnet.service.galaxy.utils.DataUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -185,143 +185,4 @@ public class ZxinPublishBiz { ...@@ -185,143 +185,4 @@ public class ZxinPublishBiz {
} }
return ResponseDto.success(nftPublishRespDto); return ResponseDto.success(nftPublishRespDto);
} }
public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto) {
//获取用户信息
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouteType(),reqDto.getUserId());
//获取sku信息
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(reqDto.getRouteType(),reqDto.getSkuId());
String author = seriesInfoBo.getAuthor();
String nftName = seriesInfoBo.getNftName();
String nftUrl = seriesInfoBo.getNftUrl();
String displayUrl = seriesInfoBo.getDisplayUrl();
String nftDesc = seriesInfoBo.getNftDesc();
String nftFlag = seriesInfoBo.getNftFlag();
//发行个数
Long publishCount = 1L;
//开始索引
Integer seriesBeginIndex = 0;
//发行金额
Long sellCount = Long.valueOf(seriesInfoBo.getSellCount().multiply(BigDecimal.valueOf(100l)).longValue()); //积分
/**
* 根据sku获取系列Id
*/
String seriesId = seriesInfoBo.getSkuId();
//返回参数nftId
String nftId = null;
//查询系列信息
Nft032SeriesReqDto nft032ReqDto = Nft032SeriesReqDto.getNew();
nft032ReqDto.setSeriesId(seriesId);
ZxlnftResponseDto<Nft032SeriesRespDto> resp = zxlnftSdkUtil.nft032Series(nft032ReqDto);
if(!resp.isSuccess()){
//该系列已经发行多少个nft
Long crtCount = resp.getData().getSeriesInfo().getCrtCount();
log.info("系列:{} 已发行 :{}", seriesId, crtCount);
//设置开始索引
seriesBeginIndex = Integer.parseInt(String.valueOf(crtCount.longValue() + 1));
}
//3.1.2调用NFT发行接口
/**
* 发行无限制系列
*/
Nft034PublishReqDto nft034ReqDto = Nft034PublishReqDto.getNew();
nft034ReqDto.setAuthor(author);
nft034ReqDto.setName(nftName);
nft034ReqDto.setUrl(nftUrl);
nft034ReqDto.setDisplayUrl(displayUrl);
nft034ReqDto.setDesc(nftDesc);
nft034ReqDto.setFlag(nftFlag);
nft034ReqDto.setPublishCount(publishCount);
//无限制零系列
nft034ReqDto.setSeriesId(seriesId);
nft034ReqDto.setSeriesBeginIndex(seriesBeginIndex);
nft034ReqDto.setSellStatus(Integer.parseInt(ZxlnftEnum.SellStatusEnum.CAN_SELL.getCode()));
nft034ReqDto.setSellCount(sellCount);
nft034ReqDto.setOperateId(IDGenerator.get32UUID());
nft034ReqDto.setMetaData("");
ZxlnftResponseDto<Nft034PublishRespDto> nft034RespDto = zxlnftSdkUtil.nft034Publish(nft034ReqDto);
if (nft034RespDto.isSuccess()) {
//3.1.4查询 NFT发行结果
Nft035PublishResultReqDto nft035ReqDto = Nft035PublishResultReqDto.getNew();
nft035ReqDto.setTaskId(nft034RespDto.getData().getTaskId());
//休眠1秒钟,等待执行结果
try {
Thread.sleep(1000l);
} catch (InterruptedException e) {
e.printStackTrace();
}
long timeStart = System.currentTimeMillis();
log.info("=======执行第{}次查询,taskId:{}", 1, nft035ReqDto.getTaskId());
ZxlnftResponseDto<Nft035PublishResultRespDto> nft035RespDto = zxlnftSdkUtil.nft035PublishResult(nft035ReqDto);
if (nft035RespDto.isSuccess()) {
if (nft035RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())) {
log.info("任务执行失败!taskId:{} taskMsg:{}", nft035ReqDto.getTaskId(), nft035RespDto.getData().getTaskMsg());
return null;
}
int count = 1;
String nftIdBegin = nft035RespDto.getData().getNftIdBegin();
if (nft035RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.PROCESSING.getCode())) {
log.info(ZxlnftEnum.TaskStatusEnum.PROCESSING.getMessage());
while (StringUtil.isEmpty(nftIdBegin)) {
//休眠1秒钟,等待执行结果
try {
Thread.sleep(1000l);
} catch (InterruptedException e) {
e.printStackTrace();
}
count++;
ZxlnftResponseDto<Nft035PublishResultRespDto> nft035RespDtoTemp = zxlnftSdkUtil.nft035PublishResult(nft035ReqDto);
log.info("=======执行第{}次查询,taskId:{}", count, nft035ReqDto.getTaskId());
if (nft035RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())) {
nftIdBegin = nft035RespDtoTemp.getData().getNftIdBegin();
} else if (nft035RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())) {
log.info("任务执行失败!taskId:{}", nft035ReqDto.getTaskId());
return null;
}
if (count == 6) {
log.info("=======查询共6次,跳出循环!taskId:{}", nft035ReqDto.getTaskId());
break;
}
}
} else if (nft035RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())) {
log.info(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getMessage());
}
log.info("发行NFT后返回给前端nftID:{}", nftIdBegin);
log.info("总共执行了{}次查询 总耗时:{} MS", count, (System.currentTimeMillis() - timeStart));
if (StringUtil.isNotEmpty(nftIdBegin)) {
nftId = nftIdBegin;
//3.1.3调用NFT查询接口
Nft036InfoReqDto nft036ReqDto = Nft036InfoReqDto.getNew();
nft036ReqDto.setNftId(nftIdBegin);
ZxlnftResponseDto<Nft036InfoRespDto> nft036RespDto = zxlnftSdkUtil.nft036Info(nft036ReqDto);
log.info("调用NFT查询接口 : {}", nft036RespDto.toJson());
}
}
}
if(StringUtil.isNotEmpty(nftId)){
//执行购买逻辑
GalaxyNftPublishAndBuyRespDto nftPublishAndBuyRespDto = GalaxyNftPublishAndBuyRespDto.getNew();
GalaxyNftBuyRespDto nftBuyRespDto = zxinTradeBiz.nftBuyBusiness(nftId,userInfoBo,seriesInfoBo);
BeanUtil.copy(nftBuyRespDto,nftPublishAndBuyRespDto);
return ResponseDto.success(nftPublishAndBuyRespDto);
}else{
return ResponseDto.failure(GalaxyErrorCodeEnum.PUBLISH_FAIL.getCode(),GalaxyErrorCodeEnum.PUBLISH_FAIL.getMessage());
}
}
} }
...@@ -6,6 +6,7 @@ import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum; ...@@ -6,6 +6,7 @@ import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum;
import com.liquidnet.common.third.zxlnft.dto.*; import com.liquidnet.common.third.zxlnft.dto.*;
import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil; import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil;
import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil; import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil; import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
...@@ -15,11 +16,15 @@ import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo; ...@@ -15,11 +16,15 @@ import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo; import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyReqDto; import com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyRespDto; 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.utils.DataUtils; import com.liquidnet.service.galaxy.utils.DataUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.math.BigDecimal;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 * @version V1.0
...@@ -71,7 +76,148 @@ public class ZxinTradeBiz { ...@@ -71,7 +76,148 @@ public class ZxinTradeBiz {
return ResponseDto.failure(GalaxyErrorCodeEnum.PUBLISH_BUY_FAIL.getCode(),GalaxyErrorCodeEnum.PUBLISH_BUY_FAIL.getMessage()); return ResponseDto.failure(GalaxyErrorCodeEnum.PUBLISH_BUY_FAIL.getCode(),GalaxyErrorCodeEnum.PUBLISH_BUY_FAIL.getMessage());
} }
} }
public GalaxyNftBuyRespDto nftBuyBusiness(String nftId,GalaxyUserInfoBo userInfoBo, GalaxySeriesInfoBo seriesInfoBo){
public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto) {
//获取用户信息
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouteType(),reqDto.getUserId());
//获取sku信息
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(reqDto.getRouteType(),reqDto.getSkuId());
String author = seriesInfoBo.getAuthor();
String nftName = seriesInfoBo.getNftName();
String nftUrl = seriesInfoBo.getNftUrl();
String displayUrl = seriesInfoBo.getDisplayUrl();
String nftDesc = seriesInfoBo.getNftDesc();
String nftFlag = seriesInfoBo.getNftFlag();
//发行个数
Long publishCount = 1L;
//开始索引
Integer seriesBeginIndex = 0;
//发行金额
Long sellCount = Long.valueOf(seriesInfoBo.getSellCount().multiply(BigDecimal.valueOf(100l)).longValue()); //积分
/**
* 根据sku获取系列Id
*/
String seriesId = seriesInfoBo.getSkuId();
//返回参数nftId
String nftId = null;
//查询系列信息
Nft032SeriesReqDto nft032ReqDto = Nft032SeriesReqDto.getNew();
nft032ReqDto.setSeriesId(seriesId);
ZxlnftResponseDto<Nft032SeriesRespDto> resp = zxlnftSdkUtil.nft032Series(nft032ReqDto);
if(!resp.isSuccess()){
//该系列已经发行多少个nft
Long crtCount = resp.getData().getSeriesInfo().getCrtCount();
log.info("系列:{} 已发行 :{}", seriesId, crtCount);
//设置开始索引
seriesBeginIndex = Integer.parseInt(String.valueOf(crtCount.longValue() + 1));
}
//3.1.2调用NFT发行接口
/**
* 发行无限制系列
*/
Nft034PublishReqDto nft034ReqDto = Nft034PublishReqDto.getNew();
nft034ReqDto.setAuthor(author);
nft034ReqDto.setName(nftName);
nft034ReqDto.setUrl(nftUrl);
nft034ReqDto.setDisplayUrl(displayUrl);
nft034ReqDto.setDesc(nftDesc);
nft034ReqDto.setFlag(nftFlag);
nft034ReqDto.setPublishCount(publishCount);
//无限制零系列
nft034ReqDto.setSeriesId(seriesId);
nft034ReqDto.setSeriesBeginIndex(seriesBeginIndex);
nft034ReqDto.setSellStatus(Integer.parseInt(ZxlnftEnum.SellStatusEnum.CAN_SELL.getCode()));
nft034ReqDto.setSellCount(sellCount);
nft034ReqDto.setOperateId(IDGenerator.get32UUID());
nft034ReqDto.setMetaData("");
ZxlnftResponseDto<Nft034PublishRespDto> nft034RespDto = zxlnftSdkUtil.nft034Publish(nft034ReqDto);
if (nft034RespDto.isSuccess()) {
//3.1.4查询 NFT发行结果
Nft035PublishResultReqDto nft035ReqDto = Nft035PublishResultReqDto.getNew();
nft035ReqDto.setTaskId(nft034RespDto.getData().getTaskId());
//休眠1秒钟,等待执行结果
try {
Thread.sleep(1000l);
} catch (InterruptedException e) {
e.printStackTrace();
}
long timeStart = System.currentTimeMillis();
log.info("=======执行第{}次查询,taskId:{}", 1, nft035ReqDto.getTaskId());
ZxlnftResponseDto<Nft035PublishResultRespDto> nft035RespDto = zxlnftSdkUtil.nft035PublishResult(nft035ReqDto);
if (nft035RespDto.isSuccess()) {
if (nft035RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())) {
log.info("任务执行失败!taskId:{} taskMsg:{}", nft035ReqDto.getTaskId(), nft035RespDto.getData().getTaskMsg());
return null;
}
int count = 1;
String nftIdBegin = nft035RespDto.getData().getNftIdBegin();
if (nft035RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.PROCESSING.getCode())) {
log.info(ZxlnftEnum.TaskStatusEnum.PROCESSING.getMessage());
while (StringUtil.isEmpty(nftIdBegin)) {
//休眠1秒钟,等待执行结果
try {
Thread.sleep(1000l);
} catch (InterruptedException e) {
e.printStackTrace();
}
count++;
ZxlnftResponseDto<Nft035PublishResultRespDto> nft035RespDtoTemp = zxlnftSdkUtil.nft035PublishResult(nft035ReqDto);
log.info("=======执行第{}次查询,taskId:{}", count, nft035ReqDto.getTaskId());
if (nft035RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())) {
nftIdBegin = nft035RespDtoTemp.getData().getNftIdBegin();
} else if (nft035RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())) {
log.info("任务执行失败!taskId:{}", nft035ReqDto.getTaskId());
return null;
}
if (count == 6) {
log.info("=======查询共6次,跳出循环!taskId:{}", nft035ReqDto.getTaskId());
break;
}
}
} else if (nft035RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())) {
log.info(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getMessage());
}
log.info("发行NFT后返回给前端nftID:{}", nftIdBegin);
log.info("总共执行了{}次查询 总耗时:{} MS", count, (System.currentTimeMillis() - timeStart));
if (StringUtil.isNotEmpty(nftIdBegin)) {
nftId = nftIdBegin;
//3.1.3调用NFT查询接口
Nft036InfoReqDto nft036ReqDto = Nft036InfoReqDto.getNew();
nft036ReqDto.setNftId(nftIdBegin);
ZxlnftResponseDto<Nft036InfoRespDto> nft036RespDto = zxlnftSdkUtil.nft036Info(nft036ReqDto);
log.info("调用NFT查询接口 : {}", nft036RespDto.toJson());
}
}
}
if(StringUtil.isNotEmpty(nftId)){
//执行购买逻辑
GalaxyNftPublishAndBuyRespDto nftPublishAndBuyRespDto = GalaxyNftPublishAndBuyRespDto.getNew();
GalaxyNftBuyRespDto nftBuyRespDto = this.nftBuyBusiness(nftId,userInfoBo,seriesInfoBo);
BeanUtil.copy(nftBuyRespDto,nftPublishAndBuyRespDto);
return ResponseDto.success(nftPublishAndBuyRespDto);
}else{
return ResponseDto.failure(GalaxyErrorCodeEnum.PUBLISH_FAIL.getCode(),GalaxyErrorCodeEnum.PUBLISH_FAIL.getMessage());
}
}
private GalaxyNftBuyRespDto nftBuyBusiness(String nftId,GalaxyUserInfoBo userInfoBo, GalaxySeriesInfoBo seriesInfoBo){
// 3.2.2调用购买NFT接口 // 3.2.2调用购买NFT接口
Nft043BuyReqDto nft043BuyReqDto = Nft043BuyReqDto.getNew(); Nft043BuyReqDto nft043BuyReqDto = Nft043BuyReqDto.getNew();
nft043BuyReqDto.setNftId(nftId); nft043BuyReqDto.setNftId(nftId);
......
package com.liquidnet.service.galaxy.router.strategy.impl; package com.liquidnet.service.galaxy.router.zxin.service;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyConstant; import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.dto.param.*; import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterHandler; import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterArtworkHandler;
import com.liquidnet.service.galaxy.router.strategy.impl.AbstractGalaxyRouterStrategyArtwork;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinArtworkBiz; 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 lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -19,29 +17,15 @@ import org.springframework.stereotype.Component; ...@@ -19,29 +17,15 @@ import org.springframework.stereotype.Component;
* @class: PayChannelStrategyAlipayImpl * @class: PayChannelStrategyAlipayImpl
* @Package com.liquidnet.service.dragon.channel.strategy.impl * @Package com.liquidnet.service.dragon.channel.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2021 * @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/13 13:06 * @date 2022/3/18 13:06
*/ */
@Slf4j @Slf4j
@Component @Component
@StrategyGalaxyRouterHandler(GalaxyConstant.RouterTypeEnum.ZXINCHAIN) @StrategyGalaxyRouterArtworkHandler(GalaxyConstant.RouterTypeEnum.ZXINCHAIN)
public class GalaxyRouterStrategyZxlImpl extends AbstractGalaxyRouterStrategyImpl { public class GalaxyRouterStrategyZxlArtworkImpl extends AbstractGalaxyRouterStrategyArtwork {
@Autowired
private ZxinUserBiz zxinUserBiz;
@Autowired @Autowired
private ZxinArtworkBiz zxinArtworkBiz; private ZxinArtworkBiz zxinArtworkBiz;
@Autowired
private ZxinPublishBiz zxinPublishBiz;
@Autowired
private ZxinTradeBiz zxinTradeBiz;
@Override
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return zxinUserBiz.userRegister(reqDto);
}
@Override @Override
public ResponseDto<GalaxyNftImageRespDto> nftImageCheck(GalaxyNftImageReqDto reqDto) { public ResponseDto<GalaxyNftImageRespDto> nftImageCheck(GalaxyNftImageReqDto reqDto) {
return zxinArtworkBiz.nftImageCheck(reqDto); return zxinArtworkBiz.nftImageCheck(reqDto);
...@@ -56,19 +40,4 @@ public class GalaxyRouterStrategyZxlImpl extends AbstractGalaxyRouterStrategyImp ...@@ -56,19 +40,4 @@ public class GalaxyRouterStrategyZxlImpl extends AbstractGalaxyRouterStrategyImp
public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) { public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) {
return zxinArtworkBiz.seriesClaim(reqDto); 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 zxinTradeBiz.nftBuy(reqDto);
}
} }
package com.liquidnet.service.galaxy.router.zxin.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterPublishHandler;
import com.liquidnet.service.galaxy.router.strategy.impl.AbstractGalaxyRouterStrategyPublish;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinPublishBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: PayChannelStrategyAlipayImpl
* @Package com.liquidnet.service.dragon.channel.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 13:06
*/
@Slf4j
@Component
@StrategyGalaxyRouterPublishHandler(GalaxyConstant.RouterTypeEnum.ZXINCHAIN)
public class GalaxyRouterStrategyZxlPublishImpl extends AbstractGalaxyRouterStrategyPublish {
@Autowired
private ZxinPublishBiz zxinPublishBiz;
@Override
public ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto) {
return zxinPublishBiz.nftPublish(reqDto);
}
}
package com.liquidnet.service.galaxy.router.strategy.impl; package com.liquidnet.service.galaxy.router.zxin.service;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyConstant; import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.dto.param.*; import com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyReqDto;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterHandler; 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.annotation.StrategyGalaxyRouterTradeHandler;
import com.liquidnet.service.galaxy.router.strategy.impl.AbstractGalaxyRouterStrategyTrade;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinTradeBiz;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 * @version V1.0
* @Description: TODO * @Description: TODO
* @class: PayChannelStrategyApplepayImpl * @class: PayChannelStrategyAlipayImpl
* @Package com.liquidnet.service.dragon.channel.strategy.impl * @Package com.liquidnet.service.dragon.channel.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2021 * @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/13 13:06 * @date 2022/3/18 13:06
*/ */
@Slf4j @Slf4j
@Component @Component
@StrategyGalaxyRouterHandler(GalaxyConstant.RouterTypeEnum.ETH) @StrategyGalaxyRouterTradeHandler(GalaxyConstant.RouterTypeEnum.ZXINCHAIN)
public class GalaxyRouterStrategyEthImpl extends AbstractGalaxyRouterStrategyImpl { public class GalaxyRouterStrategyZxlTradeImpl extends AbstractGalaxyRouterStrategyTrade {
@Autowired
@Override private ZxinTradeBiz zxinTradeBiz;
public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto) {
return null;
}
@Override @Override
public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto) { public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto) {
return null; return zxinTradeBiz.nftPublishAndBuy(reqDto);
}
@Override
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftImageRespDto> nftImageCheck(GalaxyNftImageReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto) {
return null;
} }
@Override @Override
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) { public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) {
return null; return zxinTradeBiz.nftBuy(reqDto);
} }
} }
package com.liquidnet.service.galaxy.router.zxin.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterUserHandler;
import com.liquidnet.service.galaxy.router.strategy.impl.AbstractGalaxyRouterStrategyUser;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinUserBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: PayChannelStrategyAlipayImpl
* @Package com.liquidnet.service.dragon.channel.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/18 13:06
*/
@Slf4j
@Component
@StrategyGalaxyRouterUserHandler(GalaxyConstant.RouterTypeEnum.ZXINCHAIN)
public class GalaxyRouterStrategyZxlUserImpl extends AbstractGalaxyRouterStrategyUser {
@Autowired
private ZxinUserBiz zxinUserBiz;
@Override
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return zxinUserBiz.userRegister(reqDto);
}
}
...@@ -25,16 +25,21 @@ public class GalaxyArtworkServiceImpl implements IGalaxyArtworkService { ...@@ -25,16 +25,21 @@ public class GalaxyArtworkServiceImpl implements IGalaxyArtworkService {
@Override @Override
public ResponseDto<GalaxyNftImageRespDto> nftImageCheck(GalaxyNftImageReqDto reqDto) { public ResponseDto<GalaxyNftImageRespDto> nftImageCheck(GalaxyNftImageReqDto reqDto) {
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).nftImageCheck(reqDto); return galaxyRouterStrategyContext.getArtworkStrategy(reqDto.getRouteType()).nftImageCheck(reqDto);
} }
@Override @Override
public ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto) { public ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto) {
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).nftUpload(reqDto); return galaxyRouterStrategyContext.getArtworkStrategy(reqDto.getRouteType()).nftUpload(reqDto);
} }
@Override @Override
public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) { public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) {
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).seriesClaim(reqDto); return galaxyRouterStrategyContext.getArtworkStrategy(reqDto.getRouteType()).seriesClaim(reqDto);
}
@Override
public ResponseDto<GalaxyArtSeriesClaimResultQueryRespDto> seriesClaimResultQuery(GalaxyArtSeriesClaimResultQueryReqDto reqDto) {
return null;
} }
} }
...@@ -25,6 +25,11 @@ public class GalaxyPublishServiceImpl implements IGalaxyPublishService { ...@@ -25,6 +25,11 @@ public class GalaxyPublishServiceImpl implements IGalaxyPublishService {
@Override @Override
public ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto) { public ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto) {
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).nftPublish(reqDto); return galaxyRouterStrategyContext.getPublishStrategy(reqDto.getRouteType()).nftPublish(reqDto);
}
@Override
public ResponseDto<GalaxyNftPublishResultQueryRespDto> nftPublishResultQuery(GalaxyNftPublishResultQueryReqDto reqDto) {
return null;
} }
} }
package com.liquidnet.service.galaxy.service.impl; package com.liquidnet.service.galaxy.service.impl;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyReqDto; import com.liquidnet.service.galaxy.dto.param.*;
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.router.strategy.GalaxyRouterStrategyContext;
import com.liquidnet.service.galaxy.service.IGalaxyTradeService; import com.liquidnet.service.galaxy.service.IGalaxyTradeService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -28,11 +25,21 @@ public class GalaxyTradeServiceImpl implements IGalaxyTradeService { ...@@ -28,11 +25,21 @@ public class GalaxyTradeServiceImpl implements IGalaxyTradeService {
@Override @Override
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) { public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) {
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).nftBuy(reqDto); return galaxyRouterStrategyContext.getTradeStrategy(reqDto.getRouteType()).nftBuy(reqDto);
} }
@Override @Override
public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto) { public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto) {
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).nftPublishAndBuy(reqDto); return galaxyRouterStrategyContext.getTradeStrategy(reqDto.getRouteType()).nftPublishAndBuy(reqDto);
}
@Override
public ResponseDto<GalaxyNftBuyResultQueryRespDto> nftBuyResultQuery(GalaxyNftBuyResultQueryReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftBuyPayResultQueryRespDto> nftBuyPayResultQuery(GalaxyNftBuyPayResultQueryReqDto reqDto) {
return null;
} }
} }
package com.liquidnet.service.galaxy.service.impl; package com.liquidnet.service.galaxy.service.impl;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryRespDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto; import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto; import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.router.strategy.GalaxyRouterStrategyContext; import com.liquidnet.service.galaxy.router.strategy.GalaxyRouterStrategyContext;
...@@ -26,6 +28,11 @@ public class GalaxyUserServiceImpl implements IGalaxyUserService { ...@@ -26,6 +28,11 @@ public class GalaxyUserServiceImpl implements IGalaxyUserService {
@Override @Override
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) { public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return galaxyRouterStrategyContext.getStrategy(reqDto.getRouteType()).userRegister(reqDto); return galaxyRouterStrategyContext.getUserStrategy(reqDto.getRouteType()).userRegister(reqDto);
}
@Override
public ResponseDto<GalaxyUserBindStatusQueryRespDto> userBindStatusQuery(GalaxyUserBindStatusQueryReqDto reqDto) {
return null;
} }
} }
...@@ -6,8 +6,8 @@ liquidnet: ...@@ -6,8 +6,8 @@ liquidnet:
username: user username: user
password: user123 password: user123
eureka: eureka:
host: 172.17.192.42:7001 # host: 172.17.192.42:7001
# host: 127.0.0.1:7001 host: 127.0.0.1:7001
# end-dev-这里是配置信息基本值 # end-dev-这里是配置信息基本值
spring: spring:
......
...@@ -451,14 +451,13 @@ public class TestZxlnftSdkUtil { ...@@ -451,14 +451,13 @@ public class TestZxlnftSdkUtil {
public void nft032Series(){ public void nft032Series(){
Nft032SeriesReqDto reqDto = Nft032SeriesReqDto.getNew(); Nft032SeriesReqDto reqDto = Nft032SeriesReqDto.getNew();
//无限制系列 NOW_ZXL_NFT_PIC_skuId001 //无限制系列 NOW_ZXL_NFT_PIC_skuId001
reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_8a827e181b695fb8d9b081d3855d2895ced1d003ee186622a005cec37ea77e59"); // reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_8a827e181b695fb8d9b081d3855d2895ced1d003ee186622a005cec37ea77e59");
//无限制系列 NOW_ZXL_NFT_PIC_skuId002 //无限制系列 NOW_ZXL_NFT_PIC_skuId002
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_b9b105d186742e44691c540bbacddd1c3a883a49d899b81c5b1a5cf10b4ad4e6"); // reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_b9b105d186742e44691c540bbacddd1c3a883a49d899b81c5b1a5cf10b4ad4e6");
//第一个系列 //第一个系列
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6"); // reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6");
// reqDto.setSeriesId("111111"); //{"code":"1","message":"11053,db查询系列信息失败","success":false}
//第二个系列 //第二个系列
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_31ff9f7d4c33c98518e095fec6cecdab8d337751602cf6e651eb7d131cff5b61"); reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_31ff9f7d4c33c98518e095fec6cecdab8d337751602cf6e651eb7d131cff5b61");
ZxlnftResponseDto<Nft032SeriesRespDto> resp = zxlnftSdkUtil.nft032Series(reqDto); ZxlnftResponseDto<Nft032SeriesRespDto> resp = zxlnftSdkUtil.nft032Series(reqDto);
System.out.println(resp.toJson()); System.out.println(resp.toJson());
...@@ -520,11 +519,11 @@ public class TestZxlnftSdkUtil { ...@@ -520,11 +519,11 @@ public class TestZxlnftSdkUtil {
reqDto.setDisplayUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg"); reqDto.setDisplayUrl("https://zhixinliantest-1302317679.cos.ap-guangzhou.myqcloud.com/nft/4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef/ZXLNFTIMAGE202202241512003609141721.jpg");
reqDto.setDesc("NFT描述信息"); reqDto.setDesc("NFT描述信息");
reqDto.setFlag("文创"); reqDto.setFlag("文创");
reqDto.setPublishCount(6l); reqDto.setPublishCount(1l);
//无限制零系列 //无限制零系列
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_8a827e181b695fb8d9b081d3855d2895ced1d003ee186622a005cec37ea77e59"); // reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_8a827e181b695fb8d9b081d3855d2895ced1d003ee186622a005cec37ea77e59");
// //系列001 // //系列001
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6"); reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_ca49b5ebadd5f73ab057fe869bf897cbcc0f31e0b89db71cc3ec78bca2d16ed6");
// //系列002 // //系列002
// reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_31ff9f7d4c33c98518e095fec6cecdab8d337751602cf6e651eb7d131cff5b61"); // reqDto.setSeriesId("4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef_31ff9f7d4c33c98518e095fec6cecdab8d337751602cf6e651eb7d131cff5b61");
reqDto.setSeriesBeginIndex(6); reqDto.setSeriesBeginIndex(6);
...@@ -546,26 +545,26 @@ public class TestZxlnftSdkUtil { ...@@ -546,26 +545,26 @@ public class TestZxlnftSdkUtil {
// reqDto.setTaskId("5d23ed47-dcb2-4672-99eb-060c04727a20_nft-publish_3"); // reqDto.setTaskId("5d23ed47-dcb2-4672-99eb-060c04727a20_nft-publish_3");
// reqDto.setTaskId("15ba80bb-a5f9-41db-b708-20bf4df34c14_nft-publish_3"); // reqDto.setTaskId("15ba80bb-a5f9-41db-b708-20bf4df34c14_nft-publish_3");
// reqDto.setTaskId("1b8b94c0-e9d1-4885-97a5-ae1b82302e17_nft-publish_3"); // reqDto.setTaskId("1b8b94c0-e9d1-4885-97a5-ae1b82302e17_nft-publish_3");
//无限制系列发行 1 // //无限制系列发行 1
reqDto.setTaskId("5a53f3ea-64a5-45a2-828b-196887990696_nft-publish_3"); // reqDto.setTaskId("5a53f3ea-64a5-45a2-828b-196887990696_nft-publish_3");
//无限制系列发行 2 // //无限制系列发行 2
reqDto.setTaskId("f87f687f-0b3c-46fa-b23b-d1bbf6c2594f_nft-publish_3"); // reqDto.setTaskId("f87f687f-0b3c-46fa-b23b-d1bbf6c2594f_nft-publish_3");
//北京草莓无限制系列发行 4 // //北京草莓无限制系列发行 4
reqDto.setTaskId("ee26ee9c-7005-48ca-bbc0-3e367c641dce_nft-publish_3"); // reqDto.setTaskId("ee26ee9c-7005-48ca-bbc0-3e367c641dce_nft-publish_3");
//上海草莓无限制系列发行 4 发行失败 已经存在 // //上海草莓无限制系列发行 4 发行失败 已经存在
reqDto.setTaskId("76087122-b417-49ce-bed6-54a106375293_nft-publish_3"); // reqDto.setTaskId("76087122-b417-49ce-bed6-54a106375293_nft-publish_3");
//上海草莓无限制系列发行 5 // //上海草莓无限制系列发行 5
reqDto.setTaskId("4d208028-36af-463b-b8ce-d1ca784df7b7_nft-publish_3"); // reqDto.setTaskId("4d208028-36af-463b-b8ce-d1ca784df7b7_nft-publish_3");
//上海草莓无限制系列发行 6 共5个 // //上海草莓无限制系列发行 6 共5个
reqDto.setTaskId("7bb78a44-aebe-460e-9624-7914cfc6854b_nft-publish_3"); // reqDto.setTaskId("7bb78a44-aebe-460e-9624-7914cfc6854b_nft-publish_3");
//上海草莓无限制系列发行 11 共5个 // //上海草莓无限制系列发行 11 共5个
reqDto.setTaskId("eee6ca98-e497-43bd-969d-cdc599d0f2bd_nft-publish_3"); // reqDto.setTaskId("eee6ca98-e497-43bd-969d-cdc599d0f2bd_nft-publish_3");
//系列001 发行ID1 共5个 // //系列001 发行ID1 共5个
reqDto.setTaskId("45ebcf2a-5d71-44fc-a7f3-f88f3c92cfe6_nft-publish_3"); // reqDto.setTaskId("45ebcf2a-5d71-44fc-a7f3-f88f3c92cfe6_nft-publish_3");
//系列001 发行ID6 共6个 // //系列001 发行ID6 共6个
reqDto.setTaskId("2f1eae08-6b52-42ff-ac69-78cca7bf6913_nft-publish_3"); // reqDto.setTaskId("2f1eae08-6b52-42ff-ac69-78cca7bf6913_nft-publish_3");
reqDto.setTaskId("4efaab86-deb3-436f-9aca-de59033ec79c_nft-publish_3"); // reqDto.setTaskId("4efaab86-deb3-436f-9aca-de59033ec79c_nft-publish_3");
reqDto.setTaskId("878dddd8-0e10-4e0b-99d0-0f2221ea3a48_nft-publish_3"); // reqDto.setTaskId("878dddd8-0e10-4e0b-99d0-0f2221ea3a48_nft-publish_3");
ZxlnftResponseDto<Nft035PublishResultRespDto> resp = zxlnftSdkUtil.nft035PublishResult(reqDto); ZxlnftResponseDto<Nft035PublishResultRespDto> resp = zxlnftSdkUtil.nft035PublishResult(reqDto);
System.out.println(resp.toJson()); System.out.println(resp.toJson());
} }
...@@ -710,7 +709,6 @@ public class TestZxlnftSdkUtil { ...@@ -710,7 +709,6 @@ public class TestZxlnftSdkUtil {
Nft044BuyResultReqDto reqDto = Nft044BuyResultReqDto.getNew(); Nft044BuyResultReqDto reqDto = Nft044BuyResultReqDto.getNew();
reqDto.setTaskId("035137e8-f1ac-4784-a2e4-2a830878bb47_buy-nft_2"); reqDto.setTaskId("035137e8-f1ac-4784-a2e4-2a830878bb47_buy-nft_2");
reqDto.setTaskId("e9a1f1f4-76ba-4469-8c51-ab3306954040_buy-nft_2"); reqDto.setTaskId("e9a1f1f4-76ba-4469-8c51-ab3306954040_buy-nft_2");
reqDto.setTaskId("d46b6ea1-a2f4-4461-b33f-daaa3a0c9d04_buy-nft_2");
ZxlnftResponseDto<Nft044BuyResultRespDto> resp = zxlnftSdkUtil.nft044BuyResult(reqDto); ZxlnftResponseDto<Nft044BuyResultRespDto> resp = zxlnftSdkUtil.nft044BuyResult(reqDto);
System.out.println(resp.toJson()); System.out.println(resp.toJson());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment