记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
c777f12c
Commit
c777f12c
authored
Mar 28, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交galaxy系列表结构
parent
c8eb354b
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
403 additions
and
71 deletions
+403
-71
GalaxyConstant.java
...com/liquidnet/service/galaxy/constant/GalaxyConstant.java
+4
-3
GalaxySeriesInfoBo.java
...m/liquidnet/service/galaxy/dto/bo/GalaxySeriesInfoBo.java
+4
-0
GalaxySeriesNftUploadBo.java
...uidnet/service/galaxy/dto/bo/GalaxySeriesNftUploadBo.java
+66
-0
GalaxyUserInfoBo.java
...com/liquidnet/service/galaxy/dto/bo/GalaxyUserInfoBo.java
+19
-21
GalaxySeriesNftInfoVo.java
...et/service/galaxy/dto/vo/mongo/GalaxySeriesNftInfoVo.java
+140
-0
GalaxySeriesNftUploadVo.java
.../service/galaxy/dto/vo/mongo/GalaxySeriesNftUploadVo.java
+66
-0
IDGenerator.java
...ain/java/com/liquidnet/commons/lang/util/IDGenerator.java
+4
-0
mongo_db_ddl-dev.sql
...y/liquidnet-service-galaxy-impl/docu/mongo_db_ddl-dev.sql
+9
-2
ZxinArtworkBiz.java
...uidnet/service/galaxy/router/zxin/biz/ZxinArtworkBiz.java
+9
-8
DataUtils.java
...in/java/com/liquidnet/service/galaxy/utils/DataUtils.java
+78
-35
sqlmap.properties
...-service-galaxy-impl/src/main/resources/sqlmap.properties
+3
-1
TestRedisUtil.java
...test/java/com/liquidnet/service/galaxy/TestRedisUtil.java
+1
-1
No files found.
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/constant/GalaxyConstant.java
View file @
c777f12c
...
...
@@ -10,9 +10,10 @@ package com.liquidnet.service.galaxy.constant;
* @date 2022/3/8 11:25
*/
public
class
GalaxyConstant
{
public
static
final
String
REDIS_KET_GALAXY_USER
=
"galaxy:user:"
;
public
static
final
String
REDIS_KET_GALAXY_SERIES
=
"galaxy:series:"
;
public
static
final
String
REDIS_KET_GALAXY_TRADE
=
"galaxy:trade:order:"
;
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_NFT
=
"galaxy:series:nft:"
;
public
static
final
String
REDIS_KEY_GALAXY_TRADE
=
"galaxy:trade:order:"
;
public
static
final
String
SERIES_NAME_PREFIX
=
"NOW_ZXL_"
;
// 系列存储目录名称和系列声明
}
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/bo/GalaxySeriesInfoBo.java
View file @
c777f12c
...
...
@@ -26,6 +26,10 @@ public class GalaxySeriesInfoBo implements Serializable,Cloneable {
* 本地系列唯一名称(前缀+skuid)
*/
private
String
seriesName
;
/**
* 本地系列唯一编码(前缀+skuid)
*/
private
String
seriesCode
;
/**
* 区块链上系列ID(系列声明后获取,NFT发行购买用到)
*/
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/bo/GalaxySeriesNftUploadBo.java
0 → 100644
View file @
c777f12c
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
();
}
}
}
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/bo/GalaxyUserInfoBo.java
View file @
c777f12c
package
com
.
liquidnet
.
service
.
galaxy
.
dto
.
bo
;
import
com.liquidnet.commons.lang.util.BASE64Util
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.UnsupportedEncodingException
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
...
...
@@ -30,25 +28,25 @@ public class GalaxyUserInfoBo implements Serializable,Cloneable{
private
String
userPriKey
;
private
String
routerType
;
private
String
blockChainAddress
;
public
String
getUserPubKey
()
{
String
pubKey
=
null
;
try
{
pubKey
=
BASE64Util
.
decode
(
userPubKey
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
return
pubKey
;
}
public
String
getUserPriKey
()
{
String
priKey
=
null
;
try
{
priKey
=
BASE64Util
.
decode
(
userPriKey
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
return
priKey
;
}
//
public String getUserPubKey() {
//
String pubKey = null;
//
try {
//
pubKey = BASE64Util.decode(userPubKey);
//
} catch (UnsupportedEncodingException e) {
//
e.printStackTrace();
//
}
//
return pubKey;
//
}
//
//
public String getUserPriKey() {
//
String priKey = null;
//
try {
//
priKey = BASE64Util.decode(userPriKey);
//
} catch (UnsupportedEncodingException e) {
//
e.printStackTrace();
//
}
//
return priKey;
//
}
...
...
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/vo/mongo/GalaxySeriesNftInfoVo.java
0 → 100644
View file @
c777f12c
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
();
}
}
}
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/dto/vo/mongo/GalaxySeriesNftUploadVo.java
0 → 100644
View file @
c777f12c
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
();
}
}
}
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/IDGenerator.java
View file @
c777f12c
...
...
@@ -121,6 +121,10 @@ public class IDGenerator {
return
"RED"
+
nextTimeId
();
}
public
static
String
getSeriesCode
()
{
return
"SN"
+
nextTimeId
();
}
/**
* 根据 订单号生成qrCode
*
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/docu/mongo_db_ddl-dev.sql
View file @
c777f12c
use
dev_ln_scene
;
#
创建集合
db
.
createCollection
(
"GalaxyUserInfoBo"
);
db
.
createCollection
(
"GalaxySeriesInfoBo"
);
db
.
createCollection
(
"GalaxyUserInfoVo"
);
db
.
createCollection
(
"GalaxySeriesInfoVo"
);
db
.
createCollection
(
"GalaxySeriesNftInfoVo"
);
db
.
createCollection
(
"GalaxySeriesNftUploadVo"
);
db
.
createCollection
(
"GalaxyNftOrderVo"
);
db
.
createCollection
(
"GalaxyNftTradeVo"
);
#
创建索引
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"
}
);
#
创建分片
sh
.
enableSharding
(
"dev_ln_scene"
);
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinArtworkBiz.java
View file @
c777f12c
...
...
@@ -19,6 +19,7 @@ import com.liquidnet.service.galaxy.constant.GalaxyConstant;
import
com.liquidnet.service.galaxy.constant.GalaxyEnum
;
import
com.liquidnet.service.galaxy.constant.GalaxyErrorEnum
;
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.router.strategy.biz.GalaxyCommonBiz
;
import
com.liquidnet.service.galaxy.router.strategy.biz.GalaxyEnumBiz
;
...
...
@@ -80,8 +81,8 @@ public class ZxinArtworkBiz {
* 系列缓存初始化
*/
//获取任务ID
GalaxySeries
InfoBo
seriesInfoBo
=
dataUtils
.
getSeriesInfo
Bo
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
());
if
(
StringUtil
.
isNotNull
(
series
Info
Bo
)){
GalaxySeries
NftUploadBo
seriesNftUploadBo
=
dataUtils
.
getSeriesNftUpload
Bo
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
());
if
(
StringUtil
.
isNotNull
(
series
NftUpload
Bo
)){
return
ResponseDto
.
failure
(
"素材已经上传过!"
);
}
...
...
@@ -98,12 +99,12 @@ public class ZxinArtworkBiz {
galaxyNftUploadRespDto
.
setDisplayUrl
(
this
.
getFullFilePath
(
seriesName
,
originalDisplayUrl
));
galaxyNftUploadRespDto
.
setOriginalDisplayUrl
(
reqDto
.
getOriginalDisplayUrl
());
series
InfoBo
=
this
.
buildSeriesInfoBo
(
false
,
reqDto
.
getSkuId
(),
seriesName
,
null
,
null
,
0
l
,
originalNftUrl
,
originalDisplayUrl
,
null
,
GalaxyEnum
.
SeriesClaimStatusEnum
.
SERIES_INIT
.
getCode
()
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
);
dataUtils
.
setSeries
InfoBo
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
(),
seriesInfo
Bo
);
seriesNftUploadBo
.
setSkuId
(
reqDto
.
getSkuId
());
series
NftUploadBo
.
setOriginalNftUrl
(
originalNftUrl
);
seriesNftUploadBo
.
setOriginalDisplayUrl
(
originalDisplayUrl
);
seriesNftUploadBo
.
setNftUrl
(
galaxyNftUploadRespDto
.
getNftUrl
()
);
seriesNftUploadBo
.
setDisplayUrl
(
galaxyNftUploadRespDto
.
getDisplayUrl
());
dataUtils
.
setSeries
NftUploadBo
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
(),
seriesNftUpload
Bo
);
return
ResponseDto
.
success
(
galaxyNftUploadRespDto
);
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/utils/DataUtils.java
View file @
c777f12c
package
com
.
liquidnet
.
service
.
galaxy
.
utils
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.galaxy.constant.GalaxyConstant
;
import
com.liquidnet.service.galaxy.constant.GalaxyEnum
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxySeriesInfoBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftUploadBo
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo
;
import
com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftOrderVo
;
import
com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftTradeVo
;
import
com.liquidnet.service.galaxy.dto.vo.mongo.GalaxySeriesInfoVo
;
import
com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyUserInfoVo
;
import
com.liquidnet.service.galaxy.dto.vo.mongo.*
;
import
com.mongodb.client.result.UpdateResult
;
import
lombok.extern.slf4j.Slf4j
;
import
org.bson.Document
;
...
...
@@ -42,9 +38,9 @@ public class DataUtils {
private
long
keyExpireTime
=
3600
*
24
*
30
;
public
void
setGalaxyUserInfo
(
String
routeType
,
String
userId
,
GalaxyUserInfoBo
userInfoBo
)
{
public
void
setGalaxyUserInfo
(
String
route
r
Type
,
String
userId
,
GalaxyUserInfoBo
userInfoBo
)
{
String
userType
=
GalaxyEnum
.
RegisterTypeEnum
.
COMPANY
.
getCode
();
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_USER
.
concat
(
route
Type
).
concat
(
":"
)
+
userId
,
userInfoBo
,
keyExpireTime
);
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_USER
.
concat
(
router
Type
).
concat
(
":"
)
+
userId
,
userInfoBo
,
keyExpireTime
);
//入库mongo
GalaxyUserInfoVo
userInfoVo
=
GalaxyUserInfoVo
.
getNew
();
BeanUtil
.
copy
(
userInfoBo
,
userInfoVo
);
...
...
@@ -69,8 +65,8 @@ public class DataUtils {
}
}
public
GalaxyUserInfoBo
getGalaxyUserInfo
(
String
routeType
,
String
userId
)
{
Object
obj
=
redisUtil
.
get
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_USER
.
concat
(
route
Type
).
concat
(
":"
)
+
userId
);
public
GalaxyUserInfoBo
getGalaxyUserInfo
(
String
route
r
Type
,
String
userId
)
{
Object
obj
=
redisUtil
.
get
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_USER
.
concat
(
router
Type
).
concat
(
":"
)
+
userId
);
if
(
obj
!=
null
){
return
(
GalaxyUserInfoBo
)
obj
;
}
else
{
...
...
@@ -78,13 +74,44 @@ public class DataUtils {
if
(
userInfoBo
==
null
)
{
return
null
;
}
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_USER
.
concat
(
route
Type
).
concat
(
":"
)
+
userId
,
userInfoBo
);
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_USER
.
concat
(
router
Type
).
concat
(
":"
)
+
userId
,
userInfoBo
);
return
userInfoBo
;
}
}
public
void
setSeriesInfoBo
(
String
routeType
,
String
skuId
,
GalaxySeriesInfoBo
seriesInfoBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KET_GALAXY_SERIES
.
concat
(
routeType
).
concat
(
":"
)
+
skuId
,
seriesInfoBo
,
keyExpireTime
);
public
void
setSeriesNftUploadBo
(
String
routerType
,
String
skuId
,
GalaxySeriesNftUploadBo
seriesNftUploadBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KEY_GALAXY_SERIES_NFT
.
concat
(
routerType
).
concat
(
":"
)
+
skuId
,
seriesNftUploadBo
,
keyExpireTime
);
//mongo入库
GalaxySeriesNftUploadVo
seriesNftUploadVo
=
GalaxySeriesNftUploadVo
.
getNew
();
BeanUtil
.
copy
(
seriesNftUploadBo
,
seriesNftUploadVo
);
seriesNftUploadVo
.
setCreatedAt
(
LocalDateTime
.
now
());
mongoTemplate
.
save
(
seriesNftUploadVo
,
GalaxySeriesNftUploadVo
.
class
.
getSimpleName
());
}
public
GalaxySeriesNftUploadBo
getSeriesNftUploadBo
(
String
routerType
,
String
skuId
)
{
Object
obj
=
redisUtil
.
get
(
GalaxyConstant
.
REDIS_KEY_GALAXY_SERIES_NFT
.
concat
(
routerType
).
concat
(
":"
)
+
skuId
);
if
(
obj
!=
null
){
return
(
GalaxySeriesNftUploadBo
)
obj
;
}
else
{
//设置查询参数
Criteria
criteria
=
Criteria
.
where
(
"routerType"
).
is
(
routerType
);
String
userId
=
CurrentUtil
.
getCurrentUid
();
if
(
StringUtil
.
isNotEmpty
(
skuId
)){
criteria
=
criteria
.
and
(
"skuId"
).
is
(
skuId
);
}
GalaxySeriesNftUploadBo
seriesNftUploadBo
=
mongoTemplate
.
findOne
(
Query
.
query
(
criteria
),
GalaxySeriesNftUploadBo
.
class
,
GalaxySeriesNftUploadBo
.
class
.
getSimpleName
());
if
(
seriesNftUploadBo
==
null
)
{
return
null
;
}
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KEY_GALAXY_SERIES_NFT
.
concat
(
routerType
).
concat
(
":"
)
+
skuId
,
seriesNftUploadBo
);
return
seriesNftUploadBo
;
}
}
public
void
setSeriesInfoBo
(
String
routerType
,
String
skuId
,
GalaxySeriesInfoBo
seriesInfoBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KEY_GALAXY_SERIES
.
concat
(
routerType
).
concat
(
":"
)
+
skuId
,
seriesInfoBo
,
keyExpireTime
);
//mongo入库
GalaxySeriesInfoVo
seriesInfoVo
=
GalaxySeriesInfoVo
.
getNew
();
...
...
@@ -92,15 +119,31 @@ public class DataUtils {
seriesInfoVo
.
setCreatedAt
(
LocalDateTime
.
now
());
mongoTemplate
.
save
(
seriesInfoVo
,
GalaxySeriesInfoVo
.
class
.
getSimpleName
());
// insert into galaxy_series_info (mid, 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)
// 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)
String
seriesInfoId
=
IDGenerator
.
get32UUID
();
String
seriesCode
=
IDGenerator
.
getSeriesCode
();
Integer
nftCount
=
1
;
//默认为一个系列包含一个NFT
try
{
queueUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"galaxy_series_info.insert"
),
new
Object
[]{
skuId
,
seriesInfoBo
.
getSeriesName
(),
seriesInfoBo
.
getSeriesId
(),
seriesInfoBo
.
getTotalCount
(),
seriesInfoBo
.
getCrtCount
()
new
Object
[]{
seriesInfoId
,
seriesInfoBo
.
getSeriesName
(),
seriesCode
,
null
,
seriesInfoBo
.
getTotalCount
()
,
seriesInfoBo
.
getCrtCount
(),
seriesInfoBo
.
getSeriesClaimTaskId
(),
seriesInfoBo
.
getSeriesClaimStatus
(),
seriesInfoBo
.
getCoverUrl
(),
seriesInfoBo
.
getSeriesDesc
()
,
nftCount
,
seriesInfoBo
.
getRouterType
(),
LocalDateTime
.
now
(),
null
}
,
MQConst
.
GalaxyQueue
.
SQL_SERIES_INFO
.
getKey
()
);
// insert into galaxy_series_nft_info (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)
queueUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"galaxy_series_nft_info.insert"
),
new
Object
[]{
IDGenerator
.
get32UUID
(),
seriesInfoId
,
skuId
,
seriesInfoBo
.
getSeriesName
(),
seriesCode
,
seriesInfoBo
.
getSeriesId
(),
seriesInfoBo
.
getTotalCount
(),
seriesInfoBo
.
getCrtCount
()
,
seriesInfoBo
.
getOriginalNftUrl
(),
seriesInfoBo
.
getOriginalDisplayUrl
(),
seriesInfoBo
.
getSeriesClaimTaskId
(),
seriesInfoBo
.
getSeriesClaimStatus
(),
seriesInfoBo
.
getAuthor
()
,
seriesInfoBo
.
getNftName
(),
seriesInfoBo
.
getNftUrl
(),
seriesInfoBo
.
getDisplayUrl
(),
seriesInfoBo
.
getNftDesc
(),
seriesInfoBo
.
getNftFlag
()
,
seriesInfoBo
.
getSellCount
(),
seriesInfoBo
.
getCoverUrl
(),
seriesInfoBo
.
getSeriesDesc
(),
seriesInfoBo
.
getNftHash
(),
seriesInfoBo
.
getRouterType
()
...
...
@@ -114,8 +157,8 @@ public class DataUtils {
}
}
public
GalaxySeriesInfoBo
getSeriesInfoBo
(
String
routeType
,
String
skuId
)
{
Object
obj
=
redisUtil
.
get
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_SERIES
.
concat
(
route
Type
).
concat
(
":"
)
+
skuId
);
public
GalaxySeriesInfoBo
getSeriesInfoBo
(
String
route
r
Type
,
String
skuId
)
{
Object
obj
=
redisUtil
.
get
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_SERIES
.
concat
(
router
Type
).
concat
(
":"
)
+
skuId
);
if
(
obj
!=
null
){
return
(
GalaxySeriesInfoBo
)
obj
;
}
else
{
...
...
@@ -123,13 +166,13 @@ public class DataUtils {
if
(
seriesInfoBo
==
null
)
{
return
null
;
}
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_SERIES
.
concat
(
route
Type
).
concat
(
":"
)
+
skuId
,
seriesInfoBo
);
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_SERIES
.
concat
(
router
Type
).
concat
(
":"
)
+
skuId
,
seriesInfoBo
);
return
seriesInfoBo
;
}
}
public
void
updateSeriesClaimStatus
(
String
routeType
,
String
skuId
,
GalaxySeriesInfoBo
seriesInfoBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_SERIES
.
concat
(
route
Type
).
concat
(
":"
)
+
skuId
,
seriesInfoBo
,
keyExpireTime
);
public
void
updateSeriesClaimStatus
(
String
route
r
Type
,
String
skuId
,
GalaxySeriesInfoBo
seriesInfoBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_SERIES
.
concat
(
router
Type
).
concat
(
":"
)
+
skuId
,
seriesInfoBo
,
keyExpireTime
);
Query
query
=
Query
.
query
(
Criteria
.
where
(
"skuId"
).
is
(
seriesInfoBo
.
getSkuId
()));
Update
update
=
Update
.
fromDocument
(
Document
.
parse
(
JsonUtils
.
toJson
(
seriesInfoBo
)));
...
...
@@ -140,9 +183,9 @@ public class DataUtils {
log
.
info
(
"updateSeriesClaimStatus result:{}"
,
result
.
toString
());
}
public
void
setNftOrderBo
(
String
routeType
,
String
nftOrderPayId
,
GalaxyNftOrderBo
nftOrderBo
)
{
public
void
setNftOrderBo
(
String
route
r
Type
,
String
nftOrderPayId
,
GalaxyNftOrderBo
nftOrderBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_TRADE
.
concat
(
route
Type
).
concat
(
":"
)
+
nftOrderPayId
,
nftOrderBo
,
keyExpireTime
);
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_TRADE
.
concat
(
router
Type
).
concat
(
":"
)
+
nftOrderPayId
,
nftOrderBo
,
keyExpireTime
);
/**
* 入库mongo
*/
...
...
@@ -168,8 +211,8 @@ public class DataUtils {
}
}
public
GalaxyNftOrderBo
getNftOrderBo
(
String
routeType
,
String
nftOrderPayId
)
{
Object
obj
=
redisUtil
.
get
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_TRADE
.
concat
(
route
Type
).
concat
(
":"
)
+
nftOrderPayId
);
public
GalaxyNftOrderBo
getNftOrderBo
(
String
route
r
Type
,
String
nftOrderPayId
)
{
Object
obj
=
redisUtil
.
get
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_TRADE
.
concat
(
router
Type
).
concat
(
":"
)
+
nftOrderPayId
);
if
(
obj
!=
null
){
return
(
GalaxyNftOrderBo
)
obj
;
}
else
{
...
...
@@ -179,13 +222,13 @@ public class DataUtils {
}
GalaxyNftOrderBo
nftOrderBo
=
GalaxyNftOrderBo
.
getNew
();
BeanUtil
.
copy
(
nftOrderVo
,
nftOrderBo
);
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_TRADE
.
concat
(
route
Type
).
concat
(
":"
)
+
nftOrderPayId
,
nftOrderBo
);
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_TRADE
.
concat
(
router
Type
).
concat
(
":"
)
+
nftOrderPayId
,
nftOrderBo
);
return
nftOrderBo
;
}
}
public
void
updateNftOrderInfo
(
String
routeType
,
String
nftOrderPayId
,
GalaxyNftOrderBo
nftOrderBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_TRADE
.
concat
(
route
Type
).
concat
(
":"
)
+
nftOrderPayId
,
nftOrderBo
,
keyExpireTime
);
public
void
updateNftOrderInfo
(
String
route
r
Type
,
String
nftOrderPayId
,
GalaxyNftOrderBo
nftOrderBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_TRADE
.
concat
(
router
Type
).
concat
(
":"
)
+
nftOrderPayId
,
nftOrderBo
,
keyExpireTime
);
Query
query
=
Query
.
query
(
Criteria
.
where
(
"nftOrderPayId"
).
is
(
nftOrderBo
.
getNftOrderPayId
()));
Update
update
=
Update
.
fromDocument
(
Document
.
parse
(
JsonUtils
.
toJson
(
nftOrderBo
)));
...
...
@@ -207,8 +250,8 @@ public class DataUtils {
}
}
public
void
updateNftOrderBuyTaskId
(
String
routeType
,
String
nftOrderPayId
,
GalaxyNftOrderBo
nftOrderBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
T_GALAXY_TRADE
.
concat
(
route
Type
).
concat
(
":"
)
+
nftOrderPayId
,
nftOrderBo
,
keyExpireTime
);
public
void
updateNftOrderBuyTaskId
(
String
route
r
Type
,
String
nftOrderPayId
,
GalaxyNftOrderBo
nftOrderBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KE
Y_GALAXY_TRADE
.
concat
(
router
Type
).
concat
(
":"
)
+
nftOrderPayId
,
nftOrderBo
,
keyExpireTime
);
Query
query
=
Query
.
query
(
Criteria
.
where
(
"nftOrderPayId"
).
is
(
nftOrderPayId
));
Update
update
=
Update
.
fromDocument
(
Document
.
parse
(
JsonUtils
.
toJson
(
nftOrderBo
)));
...
...
@@ -230,7 +273,7 @@ public class DataUtils {
}
}
public
void
setNftTradeInfo
(
String
routeType
,
GalaxyNftTradeVo
nftTradeVo
)
{
public
void
setNftTradeInfo
(
String
route
r
Type
,
GalaxyNftTradeVo
nftTradeVo
)
{
/**
* 入库mongo
*/
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/resources/sqlmap.properties
View file @
c777f12c
# ------------------------用户注册信息----------------------------
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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------数字藏品交易信息----------------------------
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/test/java/com/liquidnet/service/galaxy/TestRedisUtil.java
View file @
c777f12c
...
...
@@ -36,7 +36,7 @@ public class TestRedisUtil {
GalaxyUserInfoBo
userInfoBo
=
GalaxyUserInfoBo
.
getNew
();
userInfoBo
.
setUserId
(
userId
);
String
key
=
GalaxyConstant
.
REDIS_KE
T
_GALAXY_USER
.
concat
(
GalaxyEnum
.
RouterTypeEnum
.
ZXINCHAIN
.
getCode
()).
concat
(
":"
)
+
userId
;
String
key
=
GalaxyConstant
.
REDIS_KE
Y
_GALAXY_USER
.
concat
(
GalaxyEnum
.
RouterTypeEnum
.
ZXINCHAIN
.
getCode
()).
concat
(
":"
)
+
userId
;
redisUtil
.
getRedisGalaxyUtil
().
set
(
key
,
userInfoBo
,
keyExpireTime
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment