记得上下班打卡 | 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
f08f6f63
Commit
f08f6f63
authored
Apr 12, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redis key
parent
e4daae26
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
5 deletions
+99
-5
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+10
-2
GoblinNftGoodsAppController.java
...ervice/goblin/controller/GoblinNftGoodsAppController.java
+1
-1
GoblinNftGoodsAppServiceImpl.java
...ice/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
+88
-2
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
f08f6f63
...
@@ -124,13 +124,21 @@ public class GoblinRedisConst {
...
@@ -124,13 +124,21 @@ public class GoblinRedisConst {
public
static
final
String
REDIS_GOBLIN_TEMP_COUPON
=
PREFIX
.
concat
(
"temp:coupon:"
);
//详情 $key:$ucouponId
public
static
final
String
REDIS_GOBLIN_TEMP_COUPON
=
PREFIX
.
concat
(
"temp:coupon:"
);
//详情 $key:$ucouponId
/* --------------------------------NFT--------------------------------- */
/* --------------------------------NFT--------------------------------- */
public
static
final
String
REDIS_GOBLIN_NFT_ORDER_INFO
=
PREFIX
.
concat
(
"nftOrder:"
);
// nft订单详情 orderId
/*
public static final String REDIS_GOBLIN_NFT_ORDER_INFO = PREFIX.concat("nftOrder:");// nft订单详情 orderId
public static final String REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE = PREFIX.concat("nftOrder:orderCode:");// nft订单ID获取 orderCode
public static final String REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE = PREFIX.concat("nftOrder:orderCode:");// nft订单ID获取 orderCode
public static final String REDIS_GOBLIN_NFT_ORDER_USER_ID_LIST = PREFIX.concat("nftOrder:idList:user:");// nft用户订单id列表 userId
public static final String REDIS_GOBLIN_NFT_ORDER_USER_ID_LIST = PREFIX.concat("nftOrder:idList:user:");// nft用户订单id列表 userId
public static final String REDIS_GOBLIN_NFT_ORDER_REFUND_INFO = PREFIX.concat("nftOrder:refund:");// nft退款订单详情 orderId
public static final String REDIS_GOBLIN_NFT_ORDER_REFUND_INFO = PREFIX.concat("nftOrder:refund:");// nft退款订单详情 orderId
public static final String REDIS_GOBLIN_NFT_ORDER_BUG_LOCK = PREFIX.concat("nftOrder:lock:userId:");// nft购买用户锁 userId
public static final String REDIS_GOBLIN_NFT_ORDER_BUG_LOCK = PREFIX.concat("nftOrder:lock:userId:");// nft购买用户锁 userId
public static final String REDIS_GOBLIN_NFT_GOODS_LIST = PREFIX.concat("nftGoodsList");// nft商品列表
public static final String REDIS_GOBLIN_NFT_GOODS_LIST = PREFIX.concat("nftGoodsList");// nft商品列表
public
static
final
String
REDIS_GOBLIN_NFT_NUM_ACCOUNT
=
PREFIX
.
concat
(
"nftNumAccount:"
);
// nft用户数字账户是否开通 userId
public static final String REDIS_GOBLIN_NFT_NUM_ACCOUNT = PREFIX.concat("nftNumAccount:");// nft用户数字账户是否开通 userId*/
public
static
final
String
REDIS_GOBLIN_NFT_ORDER_INFO
=
PREFIX
.
concat
(
"nft:order:id:"
);
// nft订单详情 orderId
public
static
final
String
REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE
=
PREFIX
.
concat
(
"nft:order:code:"
);
// nft订单ID获取 orderCode
public
static
final
String
REDIS_GOBLIN_NFT_ORDER_USER_ID_LIST
=
PREFIX
.
concat
(
"nft:order:idList:"
);
// nft用户订单id列表 userId
public
static
final
String
REDIS_GOBLIN_NFT_ORDER_REFUND_INFO
=
PREFIX
.
concat
(
"nft:order:refund:"
);
// nft退款订单详情 orderId
public
static
final
String
REDIS_GOBLIN_NFT_ORDER_BUG_LOCK
=
PREFIX
.
concat
(
"nft:order:lock:"
);
// nft购买用户锁 userId
public
static
final
String
REDIS_GOBLIN_NFT_GOODS_LIST
=
PREFIX
.
concat
(
"nft:goodsList"
);
// nft商品列表
public
static
final
String
REDIS_GOBLIN_NFT_NUM_ACCOUNT
=
PREFIX
.
concat
(
"nft:account:"
);
// nft用户数字账户是否开通 userId
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinNftGoodsAppController.java
View file @
f08f6f63
...
@@ -53,7 +53,7 @@ public class GoblinNftGoodsAppController {
...
@@ -53,7 +53,7 @@ public class GoblinNftGoodsAppController {
}
}
@PostMapping
(
"exchange"
)
@PostMapping
(
"exchange"
)
// @ApiOperation("兑换码兑换
")
@ApiOperation
(
"redisData
"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"from"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"兑换码"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"from"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"兑换码"
,
example
=
"1"
),
})
})
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
View file @
f08f6f63
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
...
@@ -25,6 +26,7 @@ import java.time.LocalDateTime;
...
@@ -25,6 +26,7 @@ import java.time.LocalDateTime;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -40,6 +42,8 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
...
@@ -40,6 +42,8 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
@Autowired
@Autowired
GoblinMongoUtils
mongoUtils
;
GoblinMongoUtils
mongoUtils
;
@Autowired
@Autowired
RedisUtil
redisUtil
;
@Autowired
GoblinCouponService
goblinCouponService
;
GoblinCouponService
goblinCouponService
;
@Override
@Override
...
@@ -151,10 +155,92 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
...
@@ -151,10 +155,92 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
@Override
@Override
public
Boolean
exchange
(
String
code
)
{
public
Boolean
exchange
(
String
code
)
{
// 验证
/
*/
/ 验证
// 使用
// 使用
// 下单
// 下单
return
true
;
return true;*/
try
{
// int dbs = 255;
int
dbs
=
15
;
String
redisKey2
=
"goblin:nftOrder:orderCode*"
;
String
redisKey3
=
"goblin:nftOrder:idList:user*"
;
String
redisKey4
=
"goblin:nftOrder:refund*"
;
String
redisKey5
=
"goblin:nftOrder:lock:userId*"
;
String
redisKey6
=
"goblin:nftGoodsList*"
;
String
redisKey7
=
"goblin:nftNumAccount*"
;
String
redisKey1
=
"goblin:nftOrder*"
;
String
redisKey11
=
"goblin:nft:order:id:"
;
String
redisKey22
=
"goblin:nft:order:code:"
;
String
redisKey33
=
"goblin:nft:order:idList:"
;
String
redisKey44
=
"goblin:nft:order:refund:"
;
String
redisKey55
=
"goblin:nft:order:lock:"
;
String
redisKey66
=
"goblin:nft:goodsList"
;
String
redisKey77
=
"goblin:nft:account:"
;
for
(
int
i
=
0
;
i
<
dbs
;
i
++)
{
Set
<
String
>
keys2
=
redisUtil
.
getRedisTemplateByDb
(
i
).
keys
(
redisKey2
);
for
(
String
key
:
keys2
)
{
String
[]
split
=
key
.
split
(
":"
);
String
keyId
=
split
[
split
.
length
-
1
];
String
value
=
(
String
)
redisUtil
.
get
(
key
);
redisUtil
.
set
(
redisKey22
.
concat
(
keyId
),
value
);
redisUtil
.
del
(
key
);
}
Set
<
String
>
keys3
=
redisUtil
.
getRedisTemplateByDb
(
i
).
keys
(
redisKey3
);
for
(
String
key
:
keys3
)
{
String
[]
split
=
key
.
split
(
":"
);
String
keyId
=
split
[
split
.
length
-
1
];
List
<
String
>
value
=
(
List
<
String
>)
redisUtil
.
get
(
key
);
redisUtil
.
set
(
redisKey33
.
concat
(
keyId
),
value
);
redisUtil
.
del
(
key
);
}
Set
<
String
>
keys4
=
redisUtil
.
getRedisTemplateByDb
(
i
).
keys
(
redisKey4
);
for
(
String
key
:
keys4
)
{
String
[]
split
=
key
.
split
(
":"
);
String
keyId
=
split
[
split
.
length
-
1
];
GoblinNftOrderRefundVo
value
=
(
GoblinNftOrderRefundVo
)
redisUtil
.
get
(
key
);
redisUtil
.
set
(
redisKey44
.
concat
(
keyId
),
value
);
redisUtil
.
del
(
key
);
}
Set
<
String
>
keys6
=
redisUtil
.
getRedisTemplateByDb
(
i
).
keys
(
redisKey6
);
for
(
String
key
:
keys6
)
{
String
[]
split
=
key
.
split
(
":"
);
String
keyId
=
split
[
split
.
length
-
1
];
List
<
GoblinNftGoodsSkuListVo
>
value
=
(
List
<
GoblinNftGoodsSkuListVo
>)
redisUtil
.
get
(
key
);
redisUtil
.
set
(
redisKey66
.
concat
(
keyId
),
value
);
redisUtil
.
del
(
key
);
}
Set
<
String
>
keys7
=
redisUtil
.
getRedisTemplateByDb
(
i
).
keys
(
redisKey7
);
for
(
String
key
:
keys7
)
{
String
[]
split
=
key
.
split
(
":"
);
String
keyId
=
split
[
split
.
length
-
1
];
Integer
value
=
(
Integer
)
redisUtil
.
get
(
key
);
redisUtil
.
set
(
redisKey77
.
concat
(
keyId
),
value
);
redisUtil
.
del
(
key
);
}
Set
<
String
>
keys1
=
redisUtil
.
getRedisTemplateByDb
(
i
).
keys
(
redisKey1
);
for
(
String
key
:
keys1
)
{
String
[]
split
=
key
.
split
(
":"
);
String
keyId
=
split
[
split
.
length
-
1
];
GoblinNftOrderVo
value
=
(
GoblinNftOrderVo
)
redisUtil
.
get
(
key
);
redisUtil
.
set
(
redisKey11
.
concat
(
keyId
),
value
);
redisUtil
.
del
(
key
);
}
}
return
true
;
}
catch
(
Exception
e
)
{
log
.
error
(
"cityVote5Error"
,
e
);
return
false
;
}
}
}
}
}
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