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

Commit f14bd3a5 authored by anjiabin's avatar anjiabin

实现百度链转让接口

parent d1d4663a
......@@ -19,6 +19,7 @@ public class GalaxyConstant {
public static final String REDIS_KEY_GALAXY_SERIES_NFT="galaxy:series:nft:";
public static final String REDIS_KEY_GALAXY_TRADE_ORDER="galaxy:trade:order:";
public static final String REDIS_KEY_GALAXY_PUBLISH_ORDER="galaxy:publish:order:";//订单与索引绑定信息
public static final String REDIS_KEY_GALAXY_TRANSFER_NFTID = "galaxy:transfer:nftid:";//
//以下禁止删除
public static final String REDIS_KEY_GALAXY_PUBLISH_NFT="galaxy:publish:nft:"; //nft索引递增记录
......
......@@ -34,7 +34,10 @@ public enum GalaxyErrorEnum {
NFT_QUERY_FAIL_SERIES_NOT_EXIST("NFT0010022","系列信息查询不存在!"),
NFT_USER_HAS_OPEN_ACCOUNT("NFT0010023","用户已经开通过数字账户!"),
SERIES_NFT_INFO_NOT_EXIST("NFT0010024","系列NFT信息查询不存在!"),
SERIES_NFT_HASH_CREATE_FAIL("NFT0010025","系列NFT的介质hash生成失败!");
SERIES_NFT_HASH_CREATE_FAIL("NFT0010025","系列NFT的介质hash生成失败!"),
NFT_TRANSFER_FAIL("NFT0010026","NFT转让失败"),
NFT_TRANSFER_OWNER_ERROR("NFT0010027","NFT转让失败,拥有者不匹配"),
NFT_TRANSFERING_ERROR("NFT0010028","NFT正在转让中,不允许再次操作!");
private String code;
......
package com.liquidnet.service.galaxy.dto.bo;
import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data;
import java.io.Serializable;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: nft转让最新记录
* @class: GalaxyTransferNftInfoBo
* @Package com.liquidnet.service.galaxy.dto.bo
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/8/12 13:36
*/
@Data
public class GalaxyTransferNftInfoBo implements Serializable,Cloneable{
/**
* nft唯一资产碎片id
*/
private String nftId;
/**
* nft当前拥有者addr
*/
private String ownerAddr;
/**
* nft历史拥有者addr
*/
private String fromAddr;
/**
* 系列的唯一Id
*/
private String seriesId;
/**
* 路由类型
*/
private String routerType;
/**
* 创建时间
*/
private String createdAt;
/**
* 修改时间
*/
private String updatedAt;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyTransferNftInfoBo obj = new GalaxyTransferNftInfoBo();
public static GalaxyTransferNftInfoBo getNew() {
try {
return (GalaxyTransferNftInfoBo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyTransferNftInfoBo();
}
}
}
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转让结果查询
* @class: GalaxyNftTransferReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/8/4 18:42
*/
@ApiModel(value = "GalaxyNftTransferQueryReqDto", description = "NFT转让结果查询")
@Data
public class GalaxyNftTransferQueryReqDto 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;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyNftTransferQueryReqDto obj = new GalaxyNftTransferQueryReqDto();
public static GalaxyNftTransferQueryReqDto getNew() {
try {
return (GalaxyNftTransferQueryReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftTransferQueryReqDto();
}
}
}
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: NFT转让结果查询
* @class: GalaxyNftTransferQueryRespDto
* @Package com.liquidnet.service.galaxy.dto.param;
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/8/4 18:51
*/
@ApiModel(value = "GalaxyNftTransferQueryRespDto", description = "NFT转让结果查询")
@Data
public class GalaxyNftTransferQueryRespDto implements Serializable,Cloneable {
@ApiModelProperty(position = 1, required = true, value = "用户Id")
private String userId;
@ApiModelProperty(position = 1, required = true, value = "用户购买的nftId")
private String nftId;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyNftTransferQueryRespDto obj = new GalaxyNftTransferQueryRespDto();
public static GalaxyNftTransferQueryRespDto getNew() {
try {
return (GalaxyNftTransferQueryRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftTransferQueryRespDto();
}
}
}
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转让
* @class: GalaxyNftTransferReqDto
* @Package com.liquidnet.service.galaxy.dto.param
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/8/12 18:42
*/
@ApiModel(value = "GalaxyNftTransferReqDto", description = "NFT转让")
@Data
public class GalaxyNftTransferReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
/**
* 用户id
*/
@ApiModelProperty(position = 1, required = true, value = "用户ID[30]")
@NotBlank(message = "用户ID不能为空!")
@Size(min = 1, max = 30, message = "用户ID限制2-30位且不能包含特殊字符")
private String userId;
/**
* 接收用户id
*/
@ApiModelProperty(position = 1, required = true, value = "接收用户ID[30]")
@NotBlank(message = "接收用户ID不能为空!")
@Size(min = 1, max = 30, message = "用户ID限制2-30位且不能包含特殊字符")
private String receiveUserId;
/**
* nftId
*/
@ApiModelProperty(position = 1, required = true, value = "nft唯一id")
@NotBlank(message = "nft唯一id不能为空!")
private String nftId;
/**
* reqTimestamp
*/
@ApiModelProperty(position = 3, required = true, value = "请求时间戳(格式为:2022-04-07 12:12:12)")
@NotBlank(message = "请求时间戳不能为空!")
private String reqTimestamp;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyNftTransferReqDto obj = new GalaxyNftTransferReqDto();
public static GalaxyNftTransferReqDto getNew() {
try {
return (GalaxyNftTransferReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftTransferReqDto();
}
}
}
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: NFT转让返回
* @class: GalaxyNftTransferRespDto
* @Package com.liquidnet.service.galaxy.dto.param;
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/8/12 18:51
*/
@ApiModel(value = "GalaxyNftTransferRespDto", description = "NFT转让结果")
@Data
public class GalaxyNftTransferRespDto implements Serializable,Cloneable {
@ApiModelProperty(position = 1, required = true, value = "拥有者用户ID")
private String ownerUserId;
@ApiModelProperty(position = 1, required = true, value = "转让者用户ID")
private String fromUserId;
@ApiModelProperty(position = 1, required = true, value = "转让时间")
private String transferTime;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyNftTransferRespDto obj = new GalaxyNftTransferRespDto();
public static GalaxyNftTransferRespDto getNew() {
try {
return (GalaxyNftTransferRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyNftTransferRespDto();
}
}
}
......@@ -25,4 +25,8 @@ public interface IGalaxyTradeService {
ResponseDto<GalaxyNftPublishAndBuyResultQueryRespDto> nftPublishAndBuyResultQuery(GalaxyNftPublishAndBuyResultQueryReqDto reqDto);
ResponseDto<GalaxyNftPublishAndBuyRouterBatchQueryRespDto> nftPublishAndBuyResultBatchQuery(GalaxyNftPublishAndBuyRouterBatchQueryReqDto reqDto);
ResponseDto<GalaxyNftTransferRespDto> nftTransfer(GalaxyNftTransferReqDto reqDto);
ResponseDto<GalaxyNftTransferQueryRespDto> nftTransferQuery(GalaxyNftTransferQueryReqDto reqDto);
}
......@@ -72,6 +72,27 @@ public class GalaxyTradeController {
return galaxyTradeService.nftPublishAndBuyResultQuery(reqDto);
}
@ControllerLog(description = "NFT转让")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "NFT转让")
@PostMapping(value = {"/que/nftTransfer"})
public ResponseDto<GalaxyNftTransferRespDto> nftTransfer(@Valid @RequestBody GalaxyNftTransferReqDto reqDto){
return galaxyTradeService.nftTransfer(reqDto);
}
@ControllerLog(description = "NFT转让结果查询")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "NFT转让结果查询")
@PostMapping(value = {"nftTransferResultQuery"})
public ResponseDto<GalaxyNftTransferQueryRespDto> nftTransferResultQuery(@Valid @RequestBody GalaxyNftTransferQueryReqDto reqDto){
try {
Thread.sleep(2000l);
} catch (InterruptedException e) {
e.printStackTrace();
}
return galaxyTradeService.nftTransferQuery(reqDto);
}
// @ControllerLog(description = "NFT发行购买结果批量查询")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "NFT发行购买结果批量查询")
......
......@@ -51,4 +51,14 @@ public class GalaxyRouterStrategyEthTradeImpl implements IGalaxyRouterStrategyTr
public ResponseDto<GalaxyNftPublishAndBuyRouterBatchQueryRespDto> nftPublishAndBuyResultBatchQuery(GalaxyNftPublishAndBuyRouterBatchQueryReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftTransferRespDto> nftTransfer(GalaxyNftTransferReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftTransferQueryRespDto> nftTransferQuery(GalaxyNftTransferQueryReqDto reqDto) {
return null;
}
}
package com.liquidnet.service.galaxy.router.xuper.biz;
import com.liquidnet.common.exception.constant.ErrorCode;
import com.liquidnet.common.third.xuper.config.XuperConfig;
import com.liquidnet.common.third.xuper.dto.Xuper010QuerySdsReqDto;
import com.liquidnet.common.third.xuper.dto.Xuper010QuerySdsRespDto;
import com.liquidnet.common.third.xuper.dto.XuperResponseDto;
......@@ -12,7 +11,6 @@ import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz;
import com.liquidnet.service.galaxy.biz.GalaxyEnumBiz;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum;
......@@ -20,7 +18,6 @@ import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBindBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.utils.GalaxyDataUtils;
import com.liquidnet.service.galaxy.utils.QueueUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -170,4 +167,22 @@ public class XuperTradeBiz {
}
return ResponseDto.failure(GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getCode(),GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getMessage());
}
/**
* nft转让
* @param reqDto
* @return
*/
public ResponseDto<GalaxyNftTransferRespDto> nftTransfer(GalaxyNftTransferReqDto reqDto) {
return null;
}
/**
* nft转让结果查询
* @param reqDto
* @return
*/
public ResponseDto<GalaxyNftTransferQueryRespDto> nftTransferQuery(GalaxyNftTransferQueryReqDto reqDto) {
return null;
}
}
......@@ -58,4 +58,14 @@ public class GalaxyRouterStrategyXuperTradeImpl implements IGalaxyRouterStrategy
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftTransferRespDto> nftTransfer(GalaxyNftTransferReqDto reqDto) {
return xuperTradeBiz.nftTransfer(reqDto);
}
@Override
public ResponseDto<GalaxyNftTransferQueryRespDto> nftTransferQuery(GalaxyNftTransferQueryReqDto reqDto) {
return xuperTradeBiz.nftTransferQuery(reqDto);
}
}
\ No newline at end of file
......@@ -70,4 +70,14 @@ public class GalaxyRouterStrategyZxlTradeImpl implements IGalaxyRouterStrategyTr
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) {
return zxinTradeBiz.nftBuy(reqDto);
}
@Override
public ResponseDto<GalaxyNftTransferRespDto> nftTransfer(GalaxyNftTransferReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftTransferQueryRespDto> nftTransferQuery(GalaxyNftTransferQueryReqDto reqDto) {
return null;
}
}
......@@ -56,4 +56,14 @@ public class GalaxyTradeServiceImpl implements IGalaxyTradeService {
// return galaxyRouterStrategyContext.getTradeStrategy(reqDto.getRouterType()).nftPublishAndBuyResultBatchQuery(reqDto);
return null;
}
@Override
public ResponseDto<GalaxyNftTransferRespDto> nftTransfer(GalaxyNftTransferReqDto reqDto) {
return galaxyRouterStrategyContext.getTradeStrategy(reqDto.getRouterType()).nftTransfer(reqDto);
}
@Override
public ResponseDto<GalaxyNftTransferQueryRespDto> nftTransferQuery(GalaxyNftTransferQueryReqDto reqDto) {
return galaxyRouterStrategyContext.getTradeStrategy(reqDto.getRouterType()).nftTransferQuery(reqDto);
}
}
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