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

Commit 5616cdb6 authored by anjiabin's avatar anjiabin

实现zxtnft购买功能

parent 66476459
...@@ -10,7 +10,8 @@ package com.liquidnet.service.galaxy.constant; ...@@ -10,7 +10,8 @@ package com.liquidnet.service.galaxy.constant;
* @date 2022/3/8 11:25 * @date 2022/3/8 11:25
*/ */
public enum GalaxyErrorCodeEnum { public enum GalaxyErrorCodeEnum {
TRADE_PAY_WAY_ERROR("PAY0010001","错误的支付方式"); SERIES_CLAIM_ERROR("NFT0010001","NFT系列声明失败"),
SERIES_CLAIM_ERROR_FIVE_TIMES("NFT0010002","NFT系列声明失败,任务查询超过5次");
private String code; private String code;
private String message; private String message;
......
package com.liquidnet.service.galaxy.dto.param; 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> * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 * @version V1.0
...@@ -9,5 +16,33 @@ package com.liquidnet.service.galaxy.dto.param; ...@@ -9,5 +16,33 @@ package com.liquidnet.service.galaxy.dto.param;
* @Copyright: LightNet @ Copyright (c) 2021 * @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/14 11:21 * @date 2022/3/14 11:21
*/ */
public class GalaxyArtSeriesClaimRespDto { @ApiModel(value = "GalaxyArtSeriesClaimRespDto", description = "NFT系列声明返回结果")
@Data
public class GalaxyArtSeriesClaimRespDto implements Serializable,Cloneable {
@ApiModelProperty(position = 1, required = true, value = "skuId")
private String skuId;
@ApiModelProperty(position = 2, required = true, value = "素材访问地址")
private String materialAccessUrl;
@ApiModelProperty(position = 3, required = true, value = "系列在区块链上唯一ID")
private String seriesId;
@ApiModelProperty(position = 3, required = true, value = "系列在区块链上的名称")
private String seriesName;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxyArtSeriesClaimRespDto obj = new GalaxyArtSeriesClaimRespDto();
public static GalaxyArtSeriesClaimRespDto getNew() {
try {
return (GalaxyArtSeriesClaimRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxyArtSeriesClaimRespDto();
}
}
} }
\ No newline at end of file
...@@ -16,6 +16,7 @@ import com.liquidnet.commons.lang.util.IDGenerator; ...@@ -16,6 +16,7 @@ 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;
import com.liquidnet.service.galaxy.constant.GalaxyConstant; import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.constant.GalaxyErrorCodeEnum;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo; import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo;
import com.liquidnet.service.galaxy.dto.param.*; import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.utils.DataUtils; import com.liquidnet.service.galaxy.utils.DataUtils;
...@@ -191,18 +192,23 @@ public class ZxinArtworkBiz { ...@@ -191,18 +192,23 @@ public class ZxinArtworkBiz {
break; break;
}else if(nft031RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){ }else if(nft031RespDtoTemp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){
log.info("任务执行失败!taskId:{}",nft031ReqDto.getTaskId()); log.info("任务执行失败!taskId:{}",nft031ReqDto.getTaskId());
break; return ResponseDto.failure(GalaxyErrorCodeEnum.SERIES_CLAIM_ERROR.getCode(),GalaxyErrorCodeEnum.SERIES_CLAIM_ERROR.getMessage());
} }
if(count==5){
if(count==6){ log.info("=======查询共5次,跳出循环!taskId:{}",nft031ReqDto.getTaskId());
log.info("=======查询共6次,跳出循环!taskId:{}",nft031ReqDto.getTaskId()); return ResponseDto.failure(GalaxyErrorCodeEnum.SERIES_CLAIM_ERROR_FIVE_TIMES.getCode(),GalaxyErrorCodeEnum.SERIES_CLAIM_ERROR_FIVE_TIMES.getMessage());
break;
} }
} }
log.info("系列声明结果查询 seriesId :{}",seriesId); log.info("系列声明结果查询 seriesId :{}",seriesId);
} }
GalaxyArtSeriesClaimRespDto seriesClaimRespDto = GalaxyArtSeriesClaimRespDto.getNew();
seriesClaimRespDto.setSkuId(skuId);
seriesClaimRespDto.setMaterialAccessUrl(nftUrl);
seriesClaimRespDto.setSeriesId(seriesId);
seriesClaimRespDto.setSeriesName(seriesName);
GalaxySeriesInfoBo seriesInfoBo = GalaxySeriesInfoBo.getNew(); GalaxySeriesInfoBo seriesInfoBo = GalaxySeriesInfoBo.getNew();
//构造缓存数据 //构造缓存数据
if(seriesInfoBo==null){ if(seriesInfoBo==null){
...@@ -216,7 +222,7 @@ public class ZxinArtworkBiz { ...@@ -216,7 +222,7 @@ public class ZxinArtworkBiz {
seriesInfoBo.setNftUrl(nftUrl); seriesInfoBo.setNftUrl(nftUrl);
dataUtils.setSeriesInfoBo(reqDto.getRouteType(),reqDto.getSkuId(),seriesInfoBo); dataUtils.setSeriesInfoBo(reqDto.getRouteType(),reqDto.getSkuId(),seriesInfoBo);
} }
return null; return ResponseDto.success(seriesClaimRespDto);
} }
......
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