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

Commit b57d37cd authored by anjiabin's avatar anjiabin

提交galaxy系列表结构

parent c777f12c
...@@ -12,6 +12,7 @@ package com.liquidnet.service.galaxy.constant; ...@@ -12,6 +12,7 @@ package com.liquidnet.service.galaxy.constant;
public class GalaxyConstant { public class GalaxyConstant {
public static final String REDIS_KEY_GALAXY_USER="galaxy:user:"; public static final String REDIS_KEY_GALAXY_USER="galaxy:user:";
public static final String REDIS_KEY_GALAXY_SERIES="galaxy:series:"; public static final String REDIS_KEY_GALAXY_SERIES="galaxy:series:";
public static final String REDIS_KEY_GALAXY_SERIES_NFT_UPLOAD="galaxy:series:nft:upload";
public static final String REDIS_KEY_GALAXY_SERIES_NFT="galaxy:series:nft:"; public static final String REDIS_KEY_GALAXY_SERIES_NFT="galaxy:series:nft:";
public static final String REDIS_KEY_GALAXY_TRADE="galaxy:trade:order:"; public static final String REDIS_KEY_GALAXY_TRADE="galaxy:trade:order:";
......
...@@ -4,7 +4,6 @@ import com.liquidnet.commons.lang.util.JsonUtils; ...@@ -4,7 +4,6 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
...@@ -18,16 +17,12 @@ import java.time.LocalDateTime; ...@@ -18,16 +17,12 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
public class GalaxySeriesInfoBo implements Serializable,Cloneable { public class GalaxySeriesInfoBo implements Serializable,Cloneable {
/**
* 本地系列唯一标识id
*/
private String skuId;
/** /**
* 本地系列唯一名称(前缀+skuid) * 本地系列唯一名称(前缀+skuid)
*/ */
private String seriesName; private String seriesName;
/** /**
* 本地系列唯一编码(前缀+skuid) * 本地系列唯一编码
*/ */
private String seriesCode; private String seriesCode;
/** /**
...@@ -42,14 +37,6 @@ public class GalaxySeriesInfoBo implements Serializable,Cloneable { ...@@ -42,14 +37,6 @@ public class GalaxySeriesInfoBo implements Serializable,Cloneable {
* 系列已发行个数 * 系列已发行个数
*/ */
private Long crtCount; private Long crtCount;
/**
* nft素材原始地址
*/
private String originalNftUrl;
/**
* nft显示素材原始地址
*/
private String originalDisplayUrl;
/** /**
* 系列声明任务ID * 系列声明任务ID
*/ */
...@@ -58,49 +45,6 @@ public class GalaxySeriesInfoBo implements Serializable,Cloneable { ...@@ -58,49 +45,6 @@ public class GalaxySeriesInfoBo implements Serializable,Cloneable {
* 系列声明状态 * 系列声明状态
*/ */
private String seriesClaimStatus; private String seriesClaimStatus;
/**
* 系列声明时间
*/
private String seriesClaimTime;
//======================================
//=============以下都为购买信息=============
//======================================
/**
* 作者名,中文+英文(数字或符号为非法输入) 不超过30个字符
*/
private String author;
/**
* nft名字(sku名称),中英文数字均可,不超过256个字符
*/
private String nftName;
/**
* nft素材地址
*/
private String nftUrl;
/**
* 预览图url,不超过1024个字符。(至信链浏览器展示预览图尺寸为290*290,请上传比例为1:1的图片)
*/
private String displayUrl;
/**
* nft简介,500个字符以内
*/
private String nftDesc;
/**
* 标签,【文创】,游戏,动漫,30个字符以内
* 非必填
*/
private String nftFlag;
/**
* 可售状态下有意义,表示售卖多少积分
*/
private BigDecimal sellCount;
/** /**
* 系列显示封面 * 系列显示封面
...@@ -112,14 +56,21 @@ public class GalaxySeriesInfoBo implements Serializable,Cloneable { ...@@ -112,14 +56,21 @@ public class GalaxySeriesInfoBo implements Serializable,Cloneable {
*/ */
private String seriesDesc; private String seriesDesc;
/**
* 系列声明时间
*/
private String seriesClaimTime;
/** /**
* 系列声明中nftHash * 系列声明中nftHash
*/ */
private String nftHash; private Integer nftCount;
/** /**
* 路由类型 * 路由类型
*/ */
private String routerType; private String routerType;
/** /**
* 创建时间 * 创建时间
*/ */
......
package com.liquidnet.service.galaxy.dto.bo;
import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxySeriesInfoBo
* @Package com.liquidnet.service.galaxy.dto.bo
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 15:03
*/
@Data
public class GalaxySeriesNftInfoBo implements Serializable,Cloneable {
/**
* 本地系列唯一标识id
*/
private String skuId;
/**
* 本地系列唯一名称(前缀+skuid)
*/
private String seriesName;
/**
* 本地系列唯一编号(前缀+skuid)
*/
private String seriesCode;
/**
* 区块链上系列ID(系列声明后获取,NFT发行购买用到)
*/
private String seriesId;
/**
* 系列发行总量
*/
private Long nftTotalCount;
/**
* 系列已发行个数
*/
private Long nftCrtCount;
/**
* 系列nft发行开始索引
*/
private String nftIdBegin;
/**
* nft素材原始地址
*/
private String originalNftUrl;
/**
* nft显示素材原始地址
*/
private String originalDisplayUrl;
//======================================
//=============以下都为购买信息=============
//======================================
/**
* 作者名,中文+英文(数字或符号为非法输入) 不超过30个字符
*/
private String author;
/**
* nft名字(sku名称),中英文数字均可,不超过256个字符
*/
private String nftName;
/**
* nft素材地址
*/
private String nftUrl;
/**
* 预览图url,不超过1024个字符。(至信链浏览器展示预览图尺寸为290*290,请上传比例为1:1的图片)
*/
private String displayUrl;
/**
* nft简介,500个字符以内
*/
private String nftDesc;
/**
* 标签,【文创】,游戏,动漫,30个字符以内
* 非必填
*/
private String nftFlag;
/**
* 可售状态下有意义,表示售卖多少积分
*/
private BigDecimal sellCount;
/**
* 系列声明中nftHash
*/
private String nftHash;
/**
* 路由类型
*/
private String routerType;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxySeriesNftInfoBo obj = new GalaxySeriesNftInfoBo();
public static GalaxySeriesNftInfoBo getNew() {
try {
return (GalaxySeriesNftInfoBo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxySeriesNftInfoBo();
}
}
}
...@@ -4,7 +4,6 @@ import com.liquidnet.commons.lang.util.JsonUtils; ...@@ -4,7 +4,6 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
...@@ -21,11 +20,15 @@ public class GalaxySeriesInfoVo implements Serializable,Cloneable { ...@@ -21,11 +20,15 @@ public class GalaxySeriesInfoVo implements Serializable,Cloneable {
/** /**
* 本地系列唯一标识id * 本地系列唯一标识id
*/ */
private String skuId; private String seriesInfoId;
/** /**
* 本地系列唯一名称(前缀+skuid) * 本地系列唯一名称(前缀+skuid)
*/ */
private String seriesName; private String seriesName;
/**
* 本地系列唯一编码
*/
private String seriesCode;
/** /**
* 区块链上系列ID(系列声明后获取,NFT发行购买用到) * 区块链上系列ID(系列声明后获取,NFT发行购买用到)
*/ */
...@@ -38,14 +41,6 @@ public class GalaxySeriesInfoVo implements Serializable,Cloneable { ...@@ -38,14 +41,6 @@ public class GalaxySeriesInfoVo implements Serializable,Cloneable {
* 系列已发行个数 * 系列已发行个数
*/ */
private Long crtCount; private Long crtCount;
/**
* nft素材原始地址
*/
private String originalNftUrl;
/**
* nft显示素材原始地址
*/
private String originalDisplayUrl;
/** /**
* 系列声明任务ID * 系列声明任务ID
*/ */
...@@ -55,45 +50,6 @@ public class GalaxySeriesInfoVo implements Serializable,Cloneable { ...@@ -55,45 +50,6 @@ public class GalaxySeriesInfoVo implements Serializable,Cloneable {
*/ */
private String seriesClaimStatus; private String seriesClaimStatus;
//======================================
//=============以下都为购买信息=============
//======================================
/**
* 作者名,中文+英文(数字或符号为非法输入) 不超过30个字符
*/
private String author;
/**
* nft名字(sku名称),中英文数字均可,不超过256个字符
*/
private String nftName;
/**
* nft素材地址
*/
private String nftUrl;
/**
* 预览图url,不超过1024个字符。(至信链浏览器展示预览图尺寸为290*290,请上传比例为1:1的图片)
*/
private String displayUrl;
/**
* nft简介,500个字符以内
*/
private String nftDesc;
/**
* 标签,【文创】,游戏,动漫,30个字符以内
* 非必填
*/
private String nftFlag;
/**
* 可售状态下有意义,表示售卖多少积分
*/
private BigDecimal sellCount;
/** /**
* 系列显示封面 * 系列显示封面
*/ */
...@@ -107,7 +63,7 @@ public class GalaxySeriesInfoVo implements Serializable,Cloneable { ...@@ -107,7 +63,7 @@ public class GalaxySeriesInfoVo implements Serializable,Cloneable {
/** /**
* 系列声明中nftHash * 系列声明中nftHash
*/ */
private String nftHash; private Integer nftCount;
/** /**
* 路由类型 * 路由类型
......
...@@ -18,6 +18,14 @@ import java.time.LocalDateTime; ...@@ -18,6 +18,14 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
public class GalaxySeriesNftInfoVo implements Serializable,Cloneable { public class GalaxySeriesNftInfoVo implements Serializable,Cloneable {
/**
* 本地系列唯一标识id
*/
private String seriesNftInfoId;
/**
* 本地系列唯一标识id
*/
private String seriesInfoId;
/** /**
* 本地系列唯一标识id * 本地系列唯一标识id
*/ */
...@@ -26,6 +34,10 @@ public class GalaxySeriesNftInfoVo implements Serializable,Cloneable { ...@@ -26,6 +34,10 @@ public class GalaxySeriesNftInfoVo implements Serializable,Cloneable {
* 本地系列唯一名称(前缀+skuid) * 本地系列唯一名称(前缀+skuid)
*/ */
private String seriesName; private String seriesName;
/**
* 本地系列唯一编号(前缀+skuid)
*/
private String seriesCode;
/** /**
* 区块链上系列ID(系列声明后获取,NFT发行购买用到) * 区块链上系列ID(系列声明后获取,NFT发行购买用到)
*/ */
...@@ -33,11 +45,15 @@ public class GalaxySeriesNftInfoVo implements Serializable,Cloneable { ...@@ -33,11 +45,15 @@ public class GalaxySeriesNftInfoVo implements Serializable,Cloneable {
/** /**
* 系列发行总量 * 系列发行总量
*/ */
private Long totalCount; private Long nftTotalCount;
/** /**
* 系列已发行个数 * 系列已发行个数
*/ */
private Long crtCount; private Long nftCrtCount;
/**
* 系列nft发行开始索引
*/
private String nftIdBegin;
/** /**
* nft素材原始地址 * nft素材原始地址
*/ */
...@@ -46,14 +62,6 @@ public class GalaxySeriesNftInfoVo implements Serializable,Cloneable { ...@@ -46,14 +62,6 @@ public class GalaxySeriesNftInfoVo implements Serializable,Cloneable {
* nft显示素材原始地址 * nft显示素材原始地址
*/ */
private String originalDisplayUrl; private String originalDisplayUrl;
/**
* 系列声明任务ID
*/
private String seriesClaimTaskId;
/**
* 系列声明状态
*/
private String seriesClaimStatus;
//====================================== //======================================
//=============以下都为购买信息============= //=============以下都为购买信息=============
...@@ -94,16 +102,6 @@ public class GalaxySeriesNftInfoVo implements Serializable,Cloneable { ...@@ -94,16 +102,6 @@ public class GalaxySeriesNftInfoVo implements Serializable,Cloneable {
*/ */
private BigDecimal sellCount; private BigDecimal sellCount;
/**
* 系列显示封面
*/
private String coverUrl;
/**
* 系列描述信息,不超过500个字符
*/
private String seriesDesc;
/** /**
* 系列声明中nftHash * 系列声明中nftHash
*/ */
......
...@@ -9,11 +9,12 @@ db.createCollection("GalaxyNftTradeVo"); ...@@ -9,11 +9,12 @@ db.createCollection("GalaxyNftTradeVo");
#创建索引 #创建索引
db.GalaxyUserInfoBo.createIndex({userId:"hashed"}); db.GalaxyUserInfoVo.createIndex({userId:"hashed"});
db.GalaxySeriesInfoBo.createIndex({skuId:"hashed"}); db.GalaxySeriesInfoVo.createIndex({seriesCode:"hashed"});
db.GalaxySeriesInfoBo.createIndex({skuId:"hashed"}); db.GalaxySeriesNftInfoVo.createIndex({skuId:"hashed"});
db.GalaxySeriesInfoBo.createIndex({skuId:"hashed"}); db.GalaxySeriesNftUploadVo.createIndex({skuId:"hashed"});
db.GalaxySeriesInfoBo.createIndex({skuId:"hashed"}); db.GalaxyNftOrderVo.createIndex({nftOrderPayId:"hashed"});
db.GalaxyNftTradeVo.createIndex({nftId:"hashed"});
#创建分片 #创建分片
sh.enableSharding("dev_ln_scene"); sh.enableSharding("dev_ln_scene");
......
...@@ -13,7 +13,7 @@ import com.liquidnet.commons.lang.util.StringUtil; ...@@ -13,7 +13,7 @@ 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.GalaxyErrorEnum; import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum;
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.GalaxySeriesNftInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo; import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
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;
...@@ -69,24 +69,24 @@ public class ZxinPublishBiz { ...@@ -69,24 +69,24 @@ public class ZxinPublishBiz {
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId()); GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId());
//获取sku信息 //获取sku信息
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(reqDto.getRouterType(),reqDto.getSkuId()); GalaxySeriesNftInfoBo seriesNftInfoBo = dataUtils.getSeriesNftInfoBo(reqDto.getRouterType(),reqDto.getSkuId());
String author = seriesInfoBo.getAuthor(); String author = seriesNftInfoBo.getAuthor();
String nftName = seriesInfoBo.getNftName(); String nftName = seriesNftInfoBo.getNftName();
String nftUrl = seriesInfoBo.getNftUrl(); String nftUrl = seriesNftInfoBo.getNftUrl();
String displayUrl = seriesInfoBo.getDisplayUrl(); String displayUrl = seriesNftInfoBo.getDisplayUrl();
String nftDesc = seriesInfoBo.getNftDesc(); String nftDesc = seriesNftInfoBo.getNftDesc();
String nftFlag = seriesInfoBo.getNftFlag(); String nftFlag = seriesNftInfoBo.getNftFlag();
//发行个数 //发行个数
Long publishCount = 1L; Long publishCount = 1L;
//开始索引 //开始索引
Integer seriesBeginIndex = 0; Integer seriesBeginIndex = 0;
Long sellCount = Long.valueOf(seriesInfoBo.getSellCount().multiply(BigDecimal.valueOf(100l)).longValue()); //积分 Long sellCount = Long.valueOf(seriesNftInfoBo.getSellCount().multiply(BigDecimal.valueOf(100l)).longValue()); //积分
/** /**
* 根据sku获取系列Id * 根据sku获取系列Id
*/ */
String seriesId = seriesInfoBo.getSeriesId(); String seriesId = seriesNftInfoBo.getSeriesId();
//返回参数nftId //返回参数nftId
String nftId = null; String nftId = null;
String taskId = null; String taskId = null;
...@@ -140,11 +140,11 @@ public class ZxinPublishBiz { ...@@ -140,11 +140,11 @@ public class ZxinPublishBiz {
nftOrderBo = GalaxyNftOrderBo.getNew(); nftOrderBo = GalaxyNftOrderBo.getNew();
nftOrderBo.setUserId(userInfoBo.getUserId()); nftOrderBo.setUserId(userInfoBo.getUserId());
nftOrderBo.setSkuId(reqDto.getSkuId()); nftOrderBo.setSkuId(reqDto.getSkuId());
nftOrderBo.setSeriesName(seriesInfoBo.getSeriesName()); nftOrderBo.setSeriesName(seriesNftInfoBo.getSeriesName());
nftOrderBo.setSeriesId(seriesInfoBo.getSeriesId()); nftOrderBo.setSeriesId(seriesNftInfoBo.getSeriesId());
nftOrderBo.setNftOrderPayId(reqDto.getNftOrderPayId()); nftOrderBo.setNftOrderPayId(reqDto.getNftOrderPayId());
nftOrderBo.setNftId(nftId); nftOrderBo.setNftId(nftId);
nftOrderBo.setNftPrice(seriesInfoBo.getSellCount().longValue()); nftOrderBo.setNftPrice(seriesNftInfoBo.getSellCount().longValue());
nftOrderBo.setFromAddress(""); nftOrderBo.setFromAddress("");
nftOrderBo.setToAddress(""); nftOrderBo.setToAddress("");
nftOrderBo.setNftPublishTaskId(taskId); nftOrderBo.setNftPublishTaskId(taskId);
...@@ -199,24 +199,24 @@ public class ZxinPublishBiz { ...@@ -199,24 +199,24 @@ public class ZxinPublishBiz {
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId()); GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId());
//获取sku信息 //获取sku信息
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(reqDto.getRouterType(),reqDto.getSkuId()); GalaxySeriesNftInfoBo seriesNftInfoBo = dataUtils.getSeriesNftInfoBo(reqDto.getRouterType(),reqDto.getSkuId());
String author = seriesInfoBo.getAuthor(); String author = seriesNftInfoBo.getAuthor();
String nftName = seriesInfoBo.getNftName(); String nftName = seriesNftInfoBo.getNftName();
String nftUrl = seriesInfoBo.getNftUrl(); String nftUrl = seriesNftInfoBo.getNftUrl();
String displayUrl = seriesInfoBo.getDisplayUrl(); String displayUrl = seriesNftInfoBo.getDisplayUrl();
String nftDesc = seriesInfoBo.getNftDesc(); String nftDesc = seriesNftInfoBo.getNftDesc();
String nftFlag = seriesInfoBo.getNftFlag(); String nftFlag = seriesNftInfoBo.getNftFlag();
//发行个数 //发行个数
Long publishCount = 1L; Long publishCount = 1L;
//开始索引 //开始索引
Integer seriesBeginIndex = 0; Integer seriesBeginIndex = 0;
Long sellCount = Long.valueOf(seriesInfoBo.getSellCount().multiply(BigDecimal.valueOf(100l)).longValue()); //积分 Long sellCount = Long.valueOf(seriesNftInfoBo.getSellCount().multiply(BigDecimal.valueOf(100l)).longValue()); //积分
/** /**
* 根据sku获取系列Id * 根据sku获取系列Id
*/ */
String seriesId = seriesInfoBo.getSeriesId(); String seriesId = seriesNftInfoBo.getSeriesId();
//返回参数nftId //返回参数nftId
String nftId = null; String nftId = null;
String taskId = null; String taskId = null;
...@@ -310,11 +310,11 @@ public class ZxinPublishBiz { ...@@ -310,11 +310,11 @@ public class ZxinPublishBiz {
nftOrderBo = GalaxyNftOrderBo.getNew(); nftOrderBo = GalaxyNftOrderBo.getNew();
nftOrderBo.setUserId(userInfoBo.getUserId()); nftOrderBo.setUserId(userInfoBo.getUserId());
nftOrderBo.setSkuId(reqDto.getSkuId()); nftOrderBo.setSkuId(reqDto.getSkuId());
nftOrderBo.setSeriesName(seriesInfoBo.getSeriesName()); nftOrderBo.setSeriesName(seriesNftInfoBo.getSeriesName());
nftOrderBo.setSeriesId(seriesInfoBo.getSeriesId()); nftOrderBo.setSeriesId(seriesNftInfoBo.getSeriesId());
nftOrderBo.setNftOrderPayId(reqDto.getNftOrderPayId()); nftOrderBo.setNftOrderPayId(reqDto.getNftOrderPayId());
nftOrderBo.setNftId(nftId); nftOrderBo.setNftId(nftId);
nftOrderBo.setNftPrice(seriesInfoBo.getSellCount().longValue()); nftOrderBo.setNftPrice(seriesNftInfoBo.getSellCount().longValue());
nftOrderBo.setFromAddress(""); nftOrderBo.setFromAddress("");
nftOrderBo.setToAddress(""); nftOrderBo.setToAddress("");
dataUtils.setNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId(),nftOrderBo); dataUtils.setNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId(),nftOrderBo);
......
...@@ -11,7 +11,7 @@ import com.liquidnet.commons.lang.util.*; ...@@ -11,7 +11,7 @@ import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum; import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum;
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.GalaxySeriesNftInfoBo;
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.*;
import com.liquidnet.service.galaxy.router.strategy.biz.GalaxyEnumBiz; import com.liquidnet.service.galaxy.router.strategy.biz.GalaxyEnumBiz;
...@@ -62,7 +62,7 @@ public class ZxinTradeBiz { ...@@ -62,7 +62,7 @@ public class ZxinTradeBiz {
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(nftBuyReqDto.getRouterType(),nftBuyReqDto.getUserId()); GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(nftBuyReqDto.getRouterType(),nftBuyReqDto.getUserId());
//获取sku信息 //获取sku信息
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(nftBuyReqDto.getRouterType(),nftBuyReqDto.getSkuId()); GalaxySeriesNftInfoBo seriesNftInfoBo = dataUtils.getSeriesNftInfoBo(nftBuyReqDto.getRouterType(),nftBuyReqDto.getSkuId());
//返回参数nftId //返回参数nftId
...@@ -73,7 +73,7 @@ public class ZxinTradeBiz { ...@@ -73,7 +73,7 @@ public class ZxinTradeBiz {
if(StringUtil.isNotEmpty(nftId)){ if(StringUtil.isNotEmpty(nftId)){
//执行购买逻辑 //执行购买逻辑
GalaxyNftBuyRespDto nftBuyRespDto = this.nftBuyBusiness(nftBuyReqDto.getRouterType(),nftId,userInfoBo,seriesInfoBo,nftOrderBo); GalaxyNftBuyRespDto nftBuyRespDto = this.nftBuyBusiness(nftBuyReqDto.getRouterType(),nftId,userInfoBo,seriesNftInfoBo,nftOrderBo);
return ResponseDto.success(nftBuyRespDto); return ResponseDto.success(nftBuyRespDto);
}else{ }else{
return ResponseDto.failure(GalaxyErrorEnum.NFT_BUY_FAIL.getCode(), GalaxyErrorEnum.NFT_BUY_FAIL.getMessage()); return ResponseDto.failure(GalaxyErrorEnum.NFT_BUY_FAIL.getCode(), GalaxyErrorEnum.NFT_BUY_FAIL.getMessage());
...@@ -92,25 +92,25 @@ public class ZxinTradeBiz { ...@@ -92,25 +92,25 @@ public class ZxinTradeBiz {
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId()); GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId());
//获取sku信息 //获取sku信息
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(reqDto.getRouterType(),reqDto.getSkuId()); GalaxySeriesNftInfoBo seriesNftInfoBo = dataUtils.getSeriesNftInfoBo(reqDto.getRouterType(),reqDto.getSkuId());
String author = seriesInfoBo.getAuthor(); String author = seriesNftInfoBo.getAuthor();
String nftName = seriesInfoBo.getNftName(); String nftName = seriesNftInfoBo.getNftName();
String nftUrl = seriesInfoBo.getNftUrl(); String nftUrl = seriesNftInfoBo.getNftUrl();
String displayUrl = seriesInfoBo.getDisplayUrl(); String displayUrl = seriesNftInfoBo.getDisplayUrl();
String nftDesc = seriesInfoBo.getNftDesc(); String nftDesc = seriesNftInfoBo.getNftDesc();
String nftFlag = seriesInfoBo.getNftFlag(); String nftFlag = seriesNftInfoBo.getNftFlag();
//发行个数 //发行个数
Long publishCount = 1L; Long publishCount = 1L;
//开始索引 //开始索引
Integer seriesBeginIndex = 0; Integer seriesBeginIndex = 0;
//发行金额 //发行金额
Long sellCount = Long.valueOf(seriesInfoBo.getSellCount().multiply(BigDecimal.valueOf(100l)).longValue()); //积分 Long sellCount = Long.valueOf(seriesNftInfoBo.getSellCount().multiply(BigDecimal.valueOf(100l)).longValue()); //积分
/** /**
* 根据sku获取系列Id * 根据sku获取系列Id
*/ */
String seriesId = seriesInfoBo.getSkuId(); String seriesId = seriesNftInfoBo.getSkuId();
//返回参数nftId //返回参数nftId
String nftId = null; String nftId = null;
...@@ -218,7 +218,7 @@ public class ZxinTradeBiz { ...@@ -218,7 +218,7 @@ public class ZxinTradeBiz {
if(StringUtil.isNotEmpty(nftId)){ if(StringUtil.isNotEmpty(nftId)){
//执行购买逻辑 //执行购买逻辑
GalaxyNftPublishAndBuyRespDto nftPublishAndBuyRespDto = GalaxyNftPublishAndBuyRespDto.getNew(); GalaxyNftPublishAndBuyRespDto nftPublishAndBuyRespDto = GalaxyNftPublishAndBuyRespDto.getNew();
GalaxyNftBuyRespDto nftBuyRespDto = this.nftBuyBusiness(reqDto.getRouterType(),nftId,userInfoBo,seriesInfoBo,nftOrderBo); GalaxyNftBuyRespDto nftBuyRespDto = this.nftBuyBusiness(reqDto.getRouterType(),nftId,userInfoBo,seriesNftInfoBo,nftOrderBo);
BeanUtil.copy(nftBuyRespDto,nftPublishAndBuyRespDto); BeanUtil.copy(nftBuyRespDto,nftPublishAndBuyRespDto);
return ResponseDto.success(nftPublishAndBuyRespDto); return ResponseDto.success(nftPublishAndBuyRespDto);
}else{ }else{
...@@ -273,18 +273,18 @@ public class ZxinTradeBiz { ...@@ -273,18 +273,18 @@ public class ZxinTradeBiz {
return ResponseDto.success(resultQueryRespDto); return ResponseDto.success(resultQueryRespDto);
} }
private GalaxyNftBuyRespDto nftBuyBusiness(String routerType,String nftId,GalaxyUserInfoBo userInfoBo, GalaxySeriesInfoBo seriesInfoBo,GalaxyNftOrderBo nftOrderBo){ private GalaxyNftBuyRespDto nftBuyBusiness(String routerType,String nftId,GalaxyUserInfoBo userInfoBo, GalaxySeriesNftInfoBo seriesNftInfoBo,GalaxyNftOrderBo nftOrderBo){
// 3.2.2调用购买NFT接口 // 3.2.2调用购买NFT接口
Nft043BuyReqDto nft043BuyReqDto = Nft043BuyReqDto.getNew(); Nft043BuyReqDto nft043BuyReqDto = Nft043BuyReqDto.getNew();
nft043BuyReqDto.setNftId(nftId); nft043BuyReqDto.setNftId(nftId);
nft043BuyReqDto.setApplyScore(seriesInfoBo.getSellCount().intValue()); nft043BuyReqDto.setApplyScore(seriesNftInfoBo.getSellCount().intValue());
try { try {
nft043BuyReqDto.setReceiverPubKey(BASE64Util.decode(userInfoBo.getUserPubKey())); nft043BuyReqDto.setReceiverPubKey(BASE64Util.decode(userInfoBo.getUserPubKey()));
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
e.printStackTrace(); e.printStackTrace();
} }
nft043BuyReqDto.setPointReceiverAddr(userInfoBo.getBlockChainAddress()); nft043BuyReqDto.setPointReceiverAddr(userInfoBo.getBlockChainAddress());
nft043BuyReqDto.setOfferCount(seriesInfoBo.getSellCount().longValue()); nft043BuyReqDto.setOfferCount(seriesNftInfoBo.getSellCount().longValue());
nft043BuyReqDto.setOperateId(IDGenerator.get32UUID()); nft043BuyReqDto.setOperateId(IDGenerator.get32UUID());
/** /**
...@@ -329,21 +329,21 @@ public class ZxinTradeBiz { ...@@ -329,21 +329,21 @@ public class ZxinTradeBiz {
* 保持线程循环查询 * 保持线程循环查询
* @param nftId * @param nftId
* @param userInfoBo * @param userInfoBo
* @param seriesInfoBo * @param seriesNftInfoBo
* @return * @return
*/ */
private GalaxyNftBuyRespDto nftBuyBusinessBackup(String nftId,GalaxyUserInfoBo userInfoBo, GalaxySeriesInfoBo seriesInfoBo){ private GalaxyNftBuyRespDto nftBuyBusinessBackup(String nftId,GalaxyUserInfoBo userInfoBo, GalaxySeriesNftInfoBo seriesNftInfoBo){
// 3.2.2调用购买NFT接口 // 3.2.2调用购买NFT接口
Nft043BuyReqDto nft043BuyReqDto = Nft043BuyReqDto.getNew(); Nft043BuyReqDto nft043BuyReqDto = Nft043BuyReqDto.getNew();
nft043BuyReqDto.setNftId(nftId); nft043BuyReqDto.setNftId(nftId);
nft043BuyReqDto.setApplyScore(seriesInfoBo.getSellCount().intValue()); nft043BuyReqDto.setApplyScore(seriesNftInfoBo.getSellCount().intValue());
try { try {
nft043BuyReqDto.setReceiverPubKey(BASE64Util.decode(userInfoBo.getUserPubKey())); nft043BuyReqDto.setReceiverPubKey(BASE64Util.decode(userInfoBo.getUserPubKey()));
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
e.printStackTrace(); e.printStackTrace();
} }
nft043BuyReqDto.setPointReceiverAddr(userInfoBo.getBlockChainAddress()); nft043BuyReqDto.setPointReceiverAddr(userInfoBo.getBlockChainAddress());
nft043BuyReqDto.setOfferCount(seriesInfoBo.getSellCount().longValue()); nft043BuyReqDto.setOfferCount(seriesNftInfoBo.getSellCount().longValue());
nft043BuyReqDto.setOperateId(IDGenerator.get32UUID()); nft043BuyReqDto.setOperateId(IDGenerator.get32UUID());
/** /**
......
# ------------------------用户注册信息---------------------------- # ------------------------用户注册信息----------------------------
galaxy_user_info.insert=insert into galaxy_user_info (user_id, user_name, user_type, mobile, id_card_type, id_card, mnemonic, mnemonic_index,user_identification, user_pub_key, user_pri_key, block_chain_address, router_type,created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) galaxy_user_info.insert=insert into galaxy_user_info (user_id, user_name, user_type, mobile, id_card_type, id_card, mnemonic, mnemonic_index,user_identification, user_pub_key, user_pri_key, block_chain_address, router_type,created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------数字藏品系列信息---------------------------- # ------------------------数字藏品系列信息----------------------------
galaxy_series_info.insert=insert into galaxy_series_info (mid, series_info_id, series_name, series_code, series_id, total_count, crt_count,series_claim_task_id, series_claim_status, cover_url, series_desc, nft_count,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) galaxy_series_info.insert=insert into galaxy_series_info (series_info_id, series_name, series_code, series_id, total_count, crt_count,series_claim_task_id, series_claim_status, cover_url, series_desc, nft_count,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,)
# ------------------------数字藏品系列信息---------------------------- # ------------------------数字藏品系列信息----------------------------
galaxy_series_nft_info.insert=(mid, series_nft_info_id, series_info_id, sku_id, series_name, series_code,series_id, nft_total_count, nft_crt_count, original_nft_url, original_display_url,author, nft_name, nft_url, display_url, nft_desc, nft_flag, sell_count, nft_hash,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) galaxy_series_nft_info.insert=(series_nft_info_id, series_info_id, sku_id, series_name, series_code,series_id, nft_total_count, nft_crt_count, nft_id_begin ,original_nft_url, original_display_url,author, nft_name, nft_url, display_url, nft_desc, nft_flag, sell_count, nft_hash,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------数字藏品订单信息---------------------------- # ------------------------数字藏品订单信息----------------------------
galaxy_nft_order_info.insert=insert into galaxy_nft_order_info (nft_order_pay_id, user_id, sku_id, series_name, series_id, nft_id, nft_price,from_address, to_address, nft_publish_task_id, nft_buy_task_id, nft_buy_pay_task_id,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) galaxy_nft_order_info.insert=insert into galaxy_nft_order_info (nft_order_pay_id, user_id, sku_id, series_name, series_id, nft_id, nft_price,from_address, to_address, nft_publish_task_id, nft_buy_task_id, nft_buy_pay_task_id,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------数字藏品交易信息---------------------------- # ------------------------数字藏品交易信息----------------------------
......
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