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

Commit c777f12c authored by anjiabin's avatar anjiabin

提交galaxy系列表结构

parent c8eb354b
...@@ -10,9 +10,10 @@ package com.liquidnet.service.galaxy.constant; ...@@ -10,9 +10,10 @@ package com.liquidnet.service.galaxy.constant;
* @date 2022/3/8 11:25 * @date 2022/3/8 11:25
*/ */
public class GalaxyConstant { public class GalaxyConstant {
public static final String REDIS_KET_GALAXY_USER="galaxy:user:"; public static final String REDIS_KEY_GALAXY_USER="galaxy:user:";
public static final String REDIS_KET_GALAXY_SERIES="galaxy:series:"; public static final String REDIS_KEY_GALAXY_SERIES="galaxy:series:";
public static final String REDIS_KET_GALAXY_TRADE="galaxy:trade:order:"; 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 SERIES_NAME_PREFIX="NOW_ZXL_";// 系列存储目录名称和系列声明 public static final String SERIES_NAME_PREFIX="NOW_ZXL_";// 系列存储目录名称和系列声明
} }
...@@ -26,6 +26,10 @@ public class GalaxySeriesInfoBo implements Serializable,Cloneable { ...@@ -26,6 +26,10 @@ public class GalaxySeriesInfoBo implements Serializable,Cloneable {
* 本地系列唯一名称(前缀+skuid) * 本地系列唯一名称(前缀+skuid)
*/ */
private String seriesName; private String seriesName;
/**
* 本地系列唯一编码(前缀+skuid)
*/
private String seriesCode;
/** /**
* 区块链上系列ID(系列声明后获取,NFT发行购买用到) * 区块链上系列ID(系列声明后获取,NFT发行购买用到)
*/ */
......
package com.liquidnet.service.galaxy.dto.bo;
import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxySeriesNftUploadBo
* @Package com.liquidnet.service.galaxy.dto.bo
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/28 13:25
*/
@Data
public class GalaxySeriesNftUploadBo implements Serializable,Cloneable {
/**
* 本地系列唯一标识id
*/
private String skuId;
/**
* nft素材原始地址
*/
private String originalNftUrl;
/**
* nft显示素材原始地址
*/
private String originalDisplayUrl;
/**
* nft素材地址
*/
private String nftUrl;
/**
* 预览图url,不超过1024个字符。(至信链浏览器展示预览图尺寸为290*290,请上传比例为1:1的图片)
*/
private String displayUrl;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxySeriesNftUploadBo obj = new GalaxySeriesNftUploadBo();
public static GalaxySeriesNftUploadBo getNew() {
try {
return (GalaxySeriesNftUploadBo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxySeriesNftUploadBo();
}
}
}
package com.liquidnet.service.galaxy.dto.bo; package com.liquidnet.service.galaxy.dto.bo;
import com.liquidnet.commons.lang.util.BASE64Util;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.io.UnsupportedEncodingException;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
...@@ -30,25 +28,25 @@ public class GalaxyUserInfoBo implements Serializable,Cloneable{ ...@@ -30,25 +28,25 @@ public class GalaxyUserInfoBo implements Serializable,Cloneable{
private String userPriKey; private String userPriKey;
private String routerType; private String routerType;
private String blockChainAddress; private String blockChainAddress;
public String getUserPubKey() { // public String getUserPubKey() {
String pubKey = null; // String pubKey = null;
try { // try {
pubKey = BASE64Util.decode(userPubKey); // pubKey = BASE64Util.decode(userPubKey);
} catch (UnsupportedEncodingException e) { // } catch (UnsupportedEncodingException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
return pubKey; // return pubKey;
} // }
//
public String getUserPriKey() { // public String getUserPriKey() {
String priKey = null; // String priKey = null;
try { // try {
priKey = BASE64Util.decode(userPriKey); // priKey = BASE64Util.decode(userPriKey);
} catch (UnsupportedEncodingException e) { // } catch (UnsupportedEncodingException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
return priKey; // return priKey;
} // }
......
package com.liquidnet.service.galaxy.dto.vo.mongo;
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 GalaxySeriesNftInfoVo implements Serializable,Cloneable {
/**
* 本地系列唯一标识id
*/
private String skuId;
/**
* 本地系列唯一名称(前缀+skuid)
*/
private String seriesName;
/**
* 区块链上系列ID(系列声明后获取,NFT发行购买用到)
*/
private String seriesId;
/**
* 系列发行总量
*/
private Long totalCount;
/**
* 系列已发行个数
*/
private Long crtCount;
/**
* nft素材原始地址
*/
private String originalNftUrl;
/**
* nft显示素材原始地址
*/
private String originalDisplayUrl;
/**
* 系列声明任务ID
*/
private String seriesClaimTaskId;
/**
* 系列声明状态
*/
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;
/**
* 系列显示封面
*/
private String coverUrl;
/**
* 系列描述信息,不超过500个字符
*/
private String seriesDesc;
/**
* 系列声明中nftHash
*/
private String nftHash;
/**
* 路由类型
*/
private String routerType;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxySeriesNftInfoVo obj = new GalaxySeriesNftInfoVo();
public static GalaxySeriesNftInfoVo getNew() {
try {
return (GalaxySeriesNftInfoVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxySeriesNftInfoVo();
}
}
}
package com.liquidnet.service.galaxy.dto.vo.mongo;
import com.liquidnet.commons.lang.util.JsonUtils;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxySeriesNftUploadBo
* @Package com.liquidnet.service.galaxy.dto.bo
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/28 13:25
*/
@Data
public class GalaxySeriesNftUploadVo implements Serializable,Cloneable {
/**
* 本地系列唯一标识id
*/
private String skuId;
/**
* nft素材原始地址
*/
private String originalNftUrl;
/**
* nft显示素材原始地址
*/
private String originalDisplayUrl;
/**
* nft素材地址
*/
private String nftUrl;
/**
* 预览图url,不超过1024个字符。(至信链浏览器展示预览图尺寸为290*290,请上传比例为1:1的图片)
*/
private String displayUrl;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
@Override
public String toString(){
return JsonUtils.toJson(this);
}
private static final GalaxySeriesNftUploadVo obj = new GalaxySeriesNftUploadVo();
public static GalaxySeriesNftUploadVo getNew() {
try {
return (GalaxySeriesNftUploadVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GalaxySeriesNftUploadVo();
}
}
}
...@@ -121,6 +121,10 @@ public class IDGenerator { ...@@ -121,6 +121,10 @@ public class IDGenerator {
return "RED" + nextTimeId(); return "RED" + nextTimeId();
} }
public static String getSeriesCode() {
return "SN" + nextTimeId();
}
/** /**
* 根据 订单号生成qrCode * 根据 订单号生成qrCode
* *
......
use dev_ln_scene; use dev_ln_scene;
#创建集合 #创建集合
db.createCollection("GalaxyUserInfoBo"); db.createCollection("GalaxyUserInfoVo");
db.createCollection("GalaxySeriesInfoBo"); db.createCollection("GalaxySeriesInfoVo");
db.createCollection("GalaxySeriesNftInfoVo");
db.createCollection("GalaxySeriesNftUploadVo");
db.createCollection("GalaxyNftOrderVo");
db.createCollection("GalaxyNftTradeVo");
#创建索引 #创建索引
db.GalaxyUserInfoBo.createIndex({userId:"hashed"}); db.GalaxyUserInfoBo.createIndex({userId:"hashed"});
db.GalaxySeriesInfoBo.createIndex({skuId:"hashed"}); db.GalaxySeriesInfoBo.createIndex({skuId:"hashed"});
db.GalaxySeriesInfoBo.createIndex({skuId:"hashed"});
db.GalaxySeriesInfoBo.createIndex({skuId:"hashed"});
db.GalaxySeriesInfoBo.createIndex({skuId:"hashed"});
#创建分片 #创建分片
sh.enableSharding("dev_ln_scene"); sh.enableSharding("dev_ln_scene");
......
...@@ -19,6 +19,7 @@ import com.liquidnet.service.galaxy.constant.GalaxyConstant; ...@@ -19,6 +19,7 @@ import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import com.liquidnet.service.galaxy.constant.GalaxyEnum; import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum; import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo; import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftUploadBo;
import com.liquidnet.service.galaxy.dto.param.*; import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.router.strategy.biz.GalaxyCommonBiz; import com.liquidnet.service.galaxy.router.strategy.biz.GalaxyCommonBiz;
import com.liquidnet.service.galaxy.router.strategy.biz.GalaxyEnumBiz; import com.liquidnet.service.galaxy.router.strategy.biz.GalaxyEnumBiz;
...@@ -80,8 +81,8 @@ public class ZxinArtworkBiz { ...@@ -80,8 +81,8 @@ public class ZxinArtworkBiz {
* 系列缓存初始化 * 系列缓存初始化
*/ */
//获取任务ID //获取任务ID
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(reqDto.getRouterType(),reqDto.getSkuId()); GalaxySeriesNftUploadBo seriesNftUploadBo = dataUtils.getSeriesNftUploadBo(reqDto.getRouterType(),reqDto.getSkuId());
if(StringUtil.isNotNull(seriesInfoBo)){ if(StringUtil.isNotNull(seriesNftUploadBo)){
return ResponseDto.failure("素材已经上传过!"); return ResponseDto.failure("素材已经上传过!");
} }
...@@ -98,12 +99,12 @@ public class ZxinArtworkBiz { ...@@ -98,12 +99,12 @@ public class ZxinArtworkBiz {
galaxyNftUploadRespDto.setDisplayUrl(this.getFullFilePath(seriesName,originalDisplayUrl)); galaxyNftUploadRespDto.setDisplayUrl(this.getFullFilePath(seriesName,originalDisplayUrl));
galaxyNftUploadRespDto.setOriginalDisplayUrl(reqDto.getOriginalDisplayUrl()); galaxyNftUploadRespDto.setOriginalDisplayUrl(reqDto.getOriginalDisplayUrl());
seriesNftUploadBo.setSkuId(reqDto.getSkuId());
seriesInfoBo = this.buildSeriesInfoBo(false,reqDto.getSkuId(),seriesName,null,null,0l seriesNftUploadBo.setOriginalNftUrl(originalNftUrl);
,originalNftUrl,originalDisplayUrl,null,GalaxyEnum.SeriesClaimStatusEnum.SERIES_INIT.getCode() seriesNftUploadBo.setOriginalDisplayUrl(originalDisplayUrl);
,null,null,null,null,null,null,null,null,null); seriesNftUploadBo.setNftUrl(galaxyNftUploadRespDto.getNftUrl());
seriesNftUploadBo.setDisplayUrl(galaxyNftUploadRespDto.getDisplayUrl());
dataUtils.setSeriesInfoBo(reqDto.getRouterType(),reqDto.getSkuId(),seriesInfoBo); dataUtils.setSeriesNftUploadBo(reqDto.getRouterType(),reqDto.getSkuId(),seriesNftUploadBo);
return ResponseDto.success(galaxyNftUploadRespDto); return ResponseDto.success(galaxyNftUploadRespDto);
......
# ------------------------用户注册信息---------------------------- # ------------------------用户注册信息----------------------------
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 (sku_id, series_name, series_id, total_count, crt_count, original_nft_url,original_display_url, series_claim_task_id, series_claim_status, author, nft_name,nft_url, display_url, nft_desc, nft_flag, sell_count, cover_url, series_desc, nft_hash,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_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_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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------数字藏品交易信息---------------------------- # ------------------------数字藏品交易信息----------------------------
......
...@@ -36,7 +36,7 @@ public class TestRedisUtil { ...@@ -36,7 +36,7 @@ public class TestRedisUtil {
GalaxyUserInfoBo userInfoBo = GalaxyUserInfoBo.getNew(); GalaxyUserInfoBo userInfoBo = GalaxyUserInfoBo.getNew();
userInfoBo.setUserId(userId); userInfoBo.setUserId(userId);
String key = GalaxyConstant.REDIS_KET_GALAXY_USER.concat(GalaxyEnum.RouterTypeEnum.ZXINCHAIN.getCode()).concat(":") + userId; String key = GalaxyConstant.REDIS_KEY_GALAXY_USER.concat(GalaxyEnum.RouterTypeEnum.ZXINCHAIN.getCode()).concat(":") + userId;
redisUtil.getRedisGalaxyUtil().set(key,userInfoBo,keyExpireTime); redisUtil.getRedisGalaxyUtil().set(key,userInfoBo,keyExpireTime);
} }
} }
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