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

Commit 36b885c3 authored by anjiabin's avatar anjiabin

修改百度链用户开通

parent afff9fb6
......@@ -69,6 +69,45 @@ public class GalaxyQuerySeriesInfoRespDto implements Serializable,Cloneable {
return JsonUtils.toJson(this);
}
/**
* 以下为百度链新增字段****开始***********
*/
/**
* nft介质访问url
*/
@ApiModelProperty(position = 1, required = true, value = "nft介质访问url")
private String nftUrl;
/**
* nft缩略图icon
*/
@ApiModelProperty(position = 1, required = true, value = "nft缩略图icon")
private String nftThumbIcon;
/**
* nft缩略图url1
*/
@ApiModelProperty(position = 1, required = true, value = "nft缩略图url1")
private String nftThumbUrl1;
/**
* nft缩略图url2
*/
@ApiModelProperty(position = 1, required = true, value = "nft缩略图url2")
private String nftThumbUrl2;
/**
* nft缩略图url3
*/
@ApiModelProperty(position = 1, required = true, value = "nft缩略图url3")
private String nftThumbUrl3;
/**
* 以下为百度链新增字段****结束***********
*/
private static final GalaxyQuerySeriesInfoRespDto obj = new GalaxyQuerySeriesInfoRespDto();
public static GalaxyQuerySeriesInfoRespDto getNew() {
......
package com.liquidnet.common.third.xuper.dto;
import com.alibaba.fastjson.JSONArray;
import com.baidu.xasset.client.xasset.XassetDef;
import lombok.Data;
/**
......@@ -48,10 +47,10 @@ public class Xuper005QueryAssetRespDto {
@Data
public static class Urls {
private String icon;
private String url1;
private String url2;
private String url3;
private String icon;//60
private String url1;//140
private String url2;//360
private String url3;//850
}
private static final Xuper005QueryAssetRespDto obj = new Xuper005QueryAssetRespDto();
......
......@@ -306,10 +306,13 @@ public class ZxinUserCommonBiz {
//百度链开通数字账户
boolean isOpenXuperUserSuccess = false;
ResponseDto<GalaxyUserRegisterRespDto> xuperUserRegisterRespDto = this.isOpenXuperUserSuccess(reqDto);;
if(xuperUserRegisterRespDto.isSuccess()){
isOpenXuperUserSuccess = true;
if(isRealNameAuthSuccess && isBindBlockAddressSuccess){
ResponseDto<GalaxyUserRegisterRespDto> xuperUserRegisterRespDto = this.isOpenXuperUserSuccess(reqDto);;
if(xuperUserRegisterRespDto.isSuccess()){
isOpenXuperUserSuccess = true;
}
}
//实名成功+绑定区块链地址成功
if(isRealNameAuthSuccess && isBindBlockAddressSuccess && isOpenXuperUserSuccess){
isOpenAccount = true;
......
......@@ -2,4 +2,8 @@ alter table galaxy_series_nft_info
add publish_status varchar(10) null comment 'nft发行状态(-1初始化 0发行中 1发行成功 2发行失败)' after router_type;
alter table galaxy_series_nft_info
add publish_trade_hash varchar(200) null comment 'nft发行交易hash' after publish_status;
\ No newline at end of file
add publish_trade_hash varchar(200) null comment 'nft发行交易hash' after publish_status;
alter table galaxy_series_info modify series_name varchar(30) not null comment '本地系列唯一名称(前缀+skuid)';
alter table galaxy_series_nft_info modify series_name varchar(30) not null comment '本地系列唯一名称(前缀+skuid)';
\ No newline at end of file
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.*;
import com.liquidnet.common.third.xuper.exception.XupterException;
import com.liquidnet.common.third.xuper.util.XuperSdkUtil;
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.constant.GalaxyErrorEnum;
import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.utils.GalaxyDataUtils;
import lombok.extern.slf4j.Slf4j;
......@@ -29,25 +38,78 @@ public class XuperTradeQueryBiz {
private GalaxyDataUtils dataUtils;
public ResponseDto<GalaxyQueryNftInfoRespDto> queryNftInfo(GalaxyQueryNftInfoReqDto reqDto) {
// //获取订单信息
// GalaxyNftOrderBo nftOrderBo = dataUtils.getNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId());
// if(StringUtil.isNull(nftOrderBo)){
// return ResponseDto.failure(GalaxyErrorEnum.NFT_QUERY_FAIL_ORDER_NOT_EXIST.getCode(),GalaxyErrorEnum.NFT_QUERY_FAIL_ORDER_NOT_EXIST.getMessage());
// }
// if(StringUtil.isEmpty(nftOrderBo.getNftId())){
// return ResponseDto.failure(GalaxyErrorEnum.NFT_QUERY_FAIL_NFT_NOT_EXIST.getCode(),GalaxyErrorEnum.NFT_QUERY_FAIL_NFT_NOT_EXIST.getMessage());
// }
//
// Nft036InfoReqDto nft036InfoReqDto = Nft036InfoReqDto.getNew();
// nft036InfoReqDto.setNftId(nftOrderBo.getNftId());
// ZxlnftResponseDto<Nft036InfoRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft036Info(nft036InfoReqDto);
// //查询结果
// GalaxyQueryNftInfoRespDto queryNftInfoRespDto = GalaxyQueryNftInfoRespDto.getNew();
// if(zxlnftResponseDto.isSuccess()){
// BeanUtil.copy(zxlnftResponseDto.getData().getNftInfo(),queryNftInfoRespDto);
// return ResponseDto.success(queryNftInfoRespDto);
// }
return ResponseDto.failure();
//获取订单信息
GalaxyNftOrderBo nftOrderBo = dataUtils.getNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId());
if(StringUtil.isNull(nftOrderBo)){
return ResponseDto.failure(GalaxyErrorEnum.NFT_QUERY_FAIL_ORDER_NOT_EXIST.getCode(),GalaxyErrorEnum.NFT_QUERY_FAIL_ORDER_NOT_EXIST.getMessage());
}
if(StringUtil.isEmpty(nftOrderBo.getNftId())){
return ResponseDto.failure(GalaxyErrorEnum.NFT_QUERY_FAIL_NFT_NOT_EXIST.getCode(),GalaxyErrorEnum.NFT_QUERY_FAIL_NFT_NOT_EXIST.getMessage());
}
//获取sku信息
GalaxySeriesNftInfoBo seriesNftInfoBo = dataUtils.getSeriesNftInfoBo(reqDto.getRouterType(),nftOrderBo.getSkuId());
if(StringUtil.isNull(seriesNftInfoBo)){
return ResponseDto.failure(GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getCode(), GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getMessage());
}
//执行资产碎片授予查询
Xuper010QuerySdsReqDto xuper010QuerySdsReqDto = Xuper010QuerySdsReqDto.getNew();
// 定义返回结果对象
Xuper010QuerySdsRespDto xuper010QuerySdsRespDto = null;
long shardId = 1l;
try {
xuper010QuerySdsReqDto.setAssetId(Long.parseLong(nftOrderBo.getSeriesId()));
xuper010QuerySdsReqDto.setShardId(shardId);
XuperResponseDto<Xuper010QuerySdsRespDto> xuperResponseDto = xuperSdkUtil.xuper010QuerySds(xuper010QuerySdsReqDto);
if(xuperResponseDto.isSuccess()){
xuper010QuerySdsRespDto = xuperResponseDto.getParseData(Xuper010QuerySdsRespDto.class);
}
}catch (XupterException e) {
log.error("biz error msg "+e.getMessage(),e);
}catch (Exception e) {
log.error("sys error msg "+e.getMessage(),e);
}
log.info("xuper010QuerySds resp : "+ JsonUtils.toJson(xuper010QuerySdsRespDto));
if(String.valueOf(xuper010QuerySdsRespDto.getErrNo()).equalsIgnoreCase(ErrorCode.SUCCESS.getCode())){
Xuper010QuerySdsRespDto.ShardMeta shardMeta = xuper010QuerySdsRespDto.getMeta();
Xuper010QuerySdsRespDto.ShardAssetInfo assetInfo = shardMeta.getAssetInfo();
//返回结果
GalaxyQueryNftInfoRespDto respDto = GalaxyQueryNftInfoRespDto.getNew();
respDto.setNftId(String.valueOf(shardMeta.getAssetId()));
respDto.setOwnerAddr(shardMeta.getOwnerAddr());
respDto.setAuthor(assetInfo.getCreateAddr());
respDto.setName(assetInfo.getTitle());
respDto.setUrl(seriesNftInfoBo.getNftUrl());
respDto.setDisplayUrl(seriesNftInfoBo.getDisplayUrl());
respDto.setHash(seriesNftInfoBo.getNftHash());
respDto.setOwnerGainedTime(shardMeta.getCtime());
respDto.setDesc(assetInfo.getShortDesc());
respDto.setFlag("");
respDto.setSeriesName(seriesNftInfoBo.getSeriesName());
respDto.setSeriesId(String.valueOf(shardMeta.getAssetId()));
respDto.setSeriesTotalNum(seriesNftInfoBo.getNftTotalCount());
respDto.setMetaData("");
respDto.setPublisherAddr(assetInfo.getCreateAddr());
respDto.setPublishPlatformAddr(assetInfo.getCreateAddr());
respDto.setSeriesIndexId(Long.valueOf(shardMeta.getShardId()).intValue());
respDto.setPublishTxHash(shardMeta.getTxId());
respDto.setSellStatus(1);
respDto.setSellCount(shardMeta.getPrice());
// GalaxyNftBuyResultQueryRespDto resultQueryRespDto = GalaxyNftBuyResultQueryRespDto.getNew();
// String nowTimeStr = DateUtil.getNowTime();
// //转换任务状态
// Integer taskStatus = Integer.valueOf(GalaxyEnumBiz.getGrantStatusEnum(reqDto.getRouterType(),String.valueOf(xuper010QuerySdsRespDto.getMeta().getStatus())).getCode());
// resultQueryRespDto.setTaskStatus(taskStatus);
// resultQueryRespDto.setChainTimestamp(nowTimeStr);
// resultQueryRespDto.setPayTaskId(xuper010QuerySdsRespDto.getMeta().getTxId());
// resultQueryRespDto.setTxHash(xuper010QuerySdsRespDto.getMeta().getTxId());
return ResponseDto.success(respDto);
}else{
return ResponseDto.failure(GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getCode(),GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getMessage());
}
}
public ResponseDto<GalaxyQueryNftTradeListRespDto> queryNftTradeList(GalaxyQueryNftTradeListReqDto reqDto) {
......@@ -75,25 +137,49 @@ public class XuperTradeQueryBiz {
public ResponseDto<GalaxyQuerySeriesInfoRespDto> querySeriesInfo(GalaxyQuerySeriesInfoReqDto reqDto) {
//获取sku信息
// GalaxySeriesNftInfoBo seriesNftInfoBo = dataUtils.getSeriesNftInfoBo(reqDto.getRouterType(),reqDto.getSkuId());
// if(StringUtil.isNull(seriesNftInfoBo)){
// return ResponseDto.failure(GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getCode(), GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getMessage());
// }
//
// Nft032SeriesReqDto nft032SeriesReqDto = Nft032SeriesReqDto.getNew();
// nft032SeriesReqDto.setSeriesId(seriesNftInfoBo.getSeriesId());
// ZxlnftResponseDto<Nft032SeriesRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft032Series(nft032SeriesReqDto);
// //查询结果
// GalaxyQuerySeriesInfoRespDto querySeriesInfoRespDto = GalaxyQuerySeriesInfoRespDto.getNew();
// if(zxlnftResponseDto.isSuccess()){
// Nft032SeriesResp.SeriesInfo seriesInfo = zxlnftResponseDto.getData().getSeriesInfo();
// BeanUtil.copy(seriesInfo,querySeriesInfoRespDto);
// querySeriesInfoRespDto.setTotalCount(seriesInfo.getTotalCount().toString());
// querySeriesInfoRespDto.setSeriesBeginFromZero(Boolean.toString(seriesInfo.isSeriesBeginFromZero()));
// querySeriesInfoRespDto.setCrtCount(seriesInfo.getCrtCount().toString());
// querySeriesInfoRespDto.setCreateTimeStamp(seriesInfo.getCreateTimeStamp().toString());
// return ResponseDto.success(querySeriesInfoRespDto);
// }
GalaxySeriesNftInfoBo seriesNftInfoBo = dataUtils.getSeriesNftInfoBo(reqDto.getRouterType(),reqDto.getSkuId());
if(StringUtil.isNull(seriesNftInfoBo)){
return ResponseDto.failure(GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getCode(), GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getMessage());
}
Xuper005QueryAssetReqDto xuper005QueryAssetReqDto = Xuper005QueryAssetReqDto.getNew();
// 定义返回结果对象
Xuper005QueryAssetRespDto respDto = null;
//百度超级链使用的是资产id作为任务id
long assetId = Long.parseLong(seriesNftInfoBo.getSeriesId());
try {
xuper005QueryAssetReqDto.setAssetId(assetId);
XuperResponseDto<Xuper005QueryAssetRespDto> xuperResponseDto = xuperSdkUtil.xuper005QueryAsset(xuper005QueryAssetReqDto);
if(xuperResponseDto.isSuccess()){
respDto = xuperResponseDto.getParseData(Xuper005QueryAssetRespDto.class);
}
}catch (XupterException e) {
log.error("biz error msg "+e.getMessage(),e);
}catch (Exception e) {
log.error("sys error msg "+e.getMessage(),e);
}
log.info("seriesClaimResultQuery resp : "+ JsonUtils.toJson(respDto));
if(respDto.getErrNo() == Integer.parseInt(ErrorCode.SUCCESS.getCode())){
Xuper005QueryAssetRespDto.AssetMeta meta = respDto.getMeta();
//查询结果
GalaxyQuerySeriesInfoRespDto querySeriesInfoRespDto = GalaxyQuerySeriesInfoRespDto.getNew();
querySeriesInfoRespDto.setName(meta.getTitle());
querySeriesInfoRespDto.setSeriesId(String.valueOf(meta.getAssetId()));
querySeriesInfoRespDto.setCreatorAddr(meta.getCreateAddr());
querySeriesInfoRespDto.setCoverUrl(meta.getImgDesc().get(0).toString());
querySeriesInfoRespDto.setNftUrl(meta.getAssetUrl().get(0).toString());
querySeriesInfoRespDto.setNftThumbIcon(meta.getThumb()[0].getUrls().getIcon());
querySeriesInfoRespDto.setNftThumbUrl1(meta.getThumb()[0].getUrls().getUrl1());
querySeriesInfoRespDto.setNftThumbUrl2(meta.getThumb()[0].getUrls().getUrl2());
querySeriesInfoRespDto.setNftThumbUrl3(meta.getThumb()[0].getUrls().getUrl3());
querySeriesInfoRespDto.setDesc(meta.getShortDesc());
querySeriesInfoRespDto.setTotalCount(String.valueOf(meta.getAmount()));
querySeriesInfoRespDto.setSeriesBeginFromZero(Boolean.FALSE.toString());
querySeriesInfoRespDto.setCrtCount("-");
querySeriesInfoRespDto.setCreateTimeStamp(DateUtil.format(seriesNftInfoBo.getCreatedAt(), DateUtil.Formatter.yyyyMMddHHmmss));
return ResponseDto.success(querySeriesInfoRespDto);
}
return ResponseDto.failure();
}
......
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