记得上下班打卡 | 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
8987c844
Commit
8987c844
authored
May 14, 2022
by
zhanggb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:nft账号开通+认证失败缓存校验;
parent
d4aa10f8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
8 deletions
+38
-8
GoblinNFTUserController.java
...et/service/goblin/controller/GoblinNFTUserController.java
+13
-5
GoblinNftUserServiceImpl.java
...service/goblin/service/impl/GoblinNftUserServiceImpl.java
+1
-2
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+23
-1
errors.properties
...-service-goblin-impl/src/main/resources/errors.properties
+1
-0
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinNFTUserController.java
View file @
8987c844
...
...
@@ -43,8 +43,8 @@ public class GoblinNFTUserController {
@PostMapping
(
value
=
"open/account"
)
public
ResponseDto
<
GoblinUserNftAccInfoVo
>
openAccount
(
@Pattern
(
regexp
=
"\\b(NFT_ZX)\\b"
,
message
=
"业务码无效"
)
@RequestParam
String
bizCode
,
@RequestParam
(
required
=
true
)
String
name
,
@RequestParam
(
required
=
true
)
String
idCard
)
{
@RequestParam
String
name
,
@RequestParam
String
idCard
)
{
if
(!
java
.
util
.
regex
.
Pattern
.
matches
(
LnsRegex
.
Valid
.
CN_HANZI
,
name
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140013"
));
}
...
...
@@ -54,10 +54,18 @@ public class GoblinNFTUserController {
if
(
IDCardUtil
.
getAge
(
idCard
)
<
18
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140010"
));
}
try
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
String
mobile
=
(
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
);
try
{
if
(
goblinRedisUtils
.
isCertmetaJunk
(
1
,
idCard
,
name
,
mobile
))
{
// 实名认证失败缓存命中
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140016"
));
}
GoblinUserNftAccInfoVo
openAccountInfo
=
goblinRedisUtils
.
getOpenAccountInfo
(
currentUid
);
if
(
null
!=
openAccountInfo
)
{
// 已申请开通或开通处理中
return
ResponseDto
.
success
(
openAccountInfo
);
}
return
goblinNftUserService
.
openNftAccount
(
currentUid
,
bizCode
,
name
,
idCard
,
mobile
);
}
catch
(
Exception
e
)
{
if
(
e
instanceof
LiquidnetServiceException
)
{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinNftUserServiceImpl.java
View file @
8987c844
...
...
@@ -33,8 +33,7 @@ public class GoblinNftUserServiceImpl implements IGoblinNftUserService {
@Override
public
ResponseDto
<
GoblinUserNftAccInfoVo
>
openNftAccount
(
String
uid
,
String
bizCode
,
String
name
,
String
idCard
,
String
mobile
)
{
GoblinUserNftAccInfoVo
openAccountInfo
=
goblinRedisUtils
.
getOpenAccountInfo
(
uid
);
if
(
null
!=
openAccountInfo
)
return
ResponseDto
.
success
(
openAccountInfo
);
GoblinUserNftAccInfoVo
openAccountInfo
;
switch
(
bizCode
)
{
case
"NFT_ZX"
:
GalaxyUserRegisterReqDto
userRegisterReqDto
=
GalaxyUserRegisterReqDto
.
getNew
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
8987c844
...
...
@@ -8,7 +8,6 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import
com.liquidnet.commons.lang.util.RandomUtil
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.constant.NftAccStatusEnum
;
import
com.liquidnet.service.goblin.dto.GoblinStoreMarketDto
;
import
com.liquidnet.service.goblin.dto.GoblinUserNftAccInfoVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo
;
...
...
@@ -1913,6 +1912,29 @@ public class GoblinRedisUtils {
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | NFT三要素认证缓存的<ID_TYPE+ID_NO, "ID_NAME,MOBILE"> */
public
boolean
setCertmetaJunk
(
int
idType
,
String
idNo
,
String
idName
,
String
mobile
)
{
return
redisUtil
.
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_CERTMETA_JUNK
+
idType
+
idNo
,
idName
.
concat
(
","
).
concat
(
mobile
),
604800
);
}
public
boolean
isCertmetaJunk
(
int
idType
,
String
idNo
,
String
idName
,
String
mobile
)
{
String
val
=
(
String
)
redisUtil
.
get
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_CERTMETA_JUNK
+
idType
+
idNo
);
return
!
StringUtils
.
isEmpty
(
val
)
&&
val
.
equals
(
idName
.
concat
(
","
).
concat
(
mobile
));
}
public
boolean
setCertmeta
(
int
idType
,
String
idNo
,
String
idName
,
String
mobile
)
{
return
redisUtil
.
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_CERTMETA
+
idType
+
idNo
,
idName
.
concat
(
","
).
concat
(
mobile
));
}
public
int
isCertmeta
(
int
idType
,
String
idNo
,
String
idName
,
String
mobile
)
{
String
o
=
(
String
)
redisUtil
.
get
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_CERTMETA
+
idType
+
idNo
);
if
(
StringUtils
.
isEmpty
(
o
))
{
return
-
1
;
}
return
o
.
equals
(
idName
.
concat
(
","
).
concat
(
mobile
))
?
1
:
0
;
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/resources/errors.properties
View file @
8987c844
...
...
@@ -16,6 +16,7 @@
140013
=
\u
8EAB
\u
4EFD
\u
8BC1
\u
59D3
\u
540D
\u
4E0D
\u5408\u
89C4
140014
=
\u
8EAB
\u
4EFD
\u
8BC1
\u
53F7
\u7801\u
4E0D
\u5408\u
89C4
140015
=
\u
8D26
\u
53F7
\u
5F00
\u
901A
\u5931\u
8D25
\u
FF0C
\u
8BF7
\u8054\u
7CFB
\u
5BA2
\u
670D
140016
=
\u
8BC1
\u
4EF6
\u
4FE1
\u
606F
\u6216\u
624B
\u
673A
\u
53F7
\u
4E0D
\u
4E00
\u
81F4
...
...
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