记得上下班打卡 | 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
81a198c2
Commit
81a198c2
authored
Apr 02, 2025
by
姜秀龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/master' into jxl_20240417_test
parents
13a1afb1
872f86c6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
6 deletions
+45
-6
SmileRedisConst.java
...om/liquidnet/service/goblin/constant/SmileRedisConst.java
+5
-2
IdentityUtils.java
...n/java/com/liquidnet/commons/lang/util/IdentityUtils.java
+2
-1
SmileUserController.java
...com/liquidnet/service/controller/SmileUserController.java
+12
-0
SmileRedisUtils.java
...main/java/com/liquidnet/service/util/SmileRedisUtils.java
+20
-0
Utils.java
...-impl/src/main/java/com/liquidnet/service/util/Utils.java
+6
-3
No files found.
liquidnet-bus-api/liquidnet-service-smile-api/src/main/java/com/liquidnet/service/goblin/constant/SmileRedisConst.java
View file @
81a198c2
...
@@ -6,8 +6,11 @@ public class SmileRedisConst {
...
@@ -6,8 +6,11 @@ public class SmileRedisConst {
public
static
final
String
VOLUNTEERS
=
"volunteers:"
;
public
static
final
String
VOLUNTEERS
=
"volunteers:"
;
public
static
final
String
SMILE_USER
=
PREFIX
.
concat
(
"user"
);
//用户key
public
static
final
String
SMILE_USER
=
PREFIX
.
concat
(
"user"
);
//用户key
public
static
final
String
SMILE_USER_VALIDATE
=
PREFIX
.
concat
(
"user:validate"
);
//用户key
public
static
final
String
SMILE_USER_VALIDATE
=
PREFIX
.
concat
(
"user:validate2"
);
//用户key
/**
* 用户添加/编辑小家伙实名计数(N次/天)
*/
public
static
final
String
SMILE_USER_VALIDATE_LIMIT
=
PREFIX
.
concat
(
"user:validate:limit:"
);
//用户key
public
static
final
String
SMILE_SCHOOL
=
PREFIX
.
concat
(
"school"
);
//校园key
public
static
final
String
SMILE_SCHOOL
=
PREFIX
.
concat
(
"school"
);
//校园key
public
static
final
String
SMILE_SHOW
=
PREFIX
.
concat
(
"show"
);
//演出key
public
static
final
String
SMILE_SHOW
=
PREFIX
.
concat
(
"show"
);
//演出key
...
...
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/IdentityUtils.java
View file @
81a198c2
...
@@ -9,7 +9,7 @@ import org.springframework.web.client.UnknownHttpStatusCodeException;
...
@@ -9,7 +9,7 @@ import org.springframework.web.client.UnknownHttpStatusCodeException;
public
class
IdentityUtils
{
public
class
IdentityUtils
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
IdentityUtils
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
IdentityUtils
.
class
);
private
static
final
String
aliThirdUrl
=
"https://1.api.apistore.cn/idcard3"
;
private
static
final
String
aliThirdUrl
=
"https://1.api.apistore.cn/idcard3"
;
private
static
final
String
aliThirdAppCode
=
"
cc29fa8cb494468289dec09df46922b5
"
;
private
static
final
String
aliThirdAppCode
=
"
74884b154fbc49dc9ebf2fc977086f20
"
;
private
static
final
String
ALI_MOBILE_CERT_HOST
=
"https://mobilecert.market.alicloudapi.com"
;
private
static
final
String
ALI_MOBILE_CERT_HOST
=
"https://mobilecert.market.alicloudapi.com"
;
private
static
final
String
ALI_MOBILE_CERT3_META_URI
=
"/mobile3Meta"
;
private
static
final
String
ALI_MOBILE_CERT3_META_URI
=
"/mobile3Meta"
;
...
@@ -20,6 +20,7 @@ public class IdentityUtils {
...
@@ -20,6 +20,7 @@ public class IdentityUtils {
params
.
add
(
"cardNo"
,
cardNo
);
params
.
add
(
"cardNo"
,
cardNo
);
MultiValueMap
<
String
,
String
>
header
=
new
LinkedMultiValueMap
<>();
MultiValueMap
<
String
,
String
>
header
=
new
LinkedMultiValueMap
<>();
header
.
add
(
"Authorization"
,
"APPCODE "
+
aliThirdAppCode
);
header
.
add
(
"Authorization"
,
"APPCODE "
+
aliThirdAppCode
);
log
.
info
(
"实名认证开始realName==============={}"
,
realName
);
try
{
try
{
return
HttpUtil
.
post
(
aliThirdUrl
,
params
,
header
);
return
HttpUtil
.
post
(
aliThirdUrl
,
params
,
header
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
liquidnet-bus-service/liquidnet-service-smile/liquidnet-service-smile-impl/src/main/java/com/liquidnet/service/controller/SmileUserController.java
View file @
81a198c2
...
@@ -163,6 +163,18 @@ public class SmileUserController {
...
@@ -163,6 +163,18 @@ public class SmileUserController {
if
(
StringUtil
.
isNotBlank
(
smileUserVO
.
getIdCard
())&&
StringUtil
.
isNotBlank
(
smileUserVO
.
getName
())){
if
(
StringUtil
.
isNotBlank
(
smileUserVO
.
getIdCard
())&&
StringUtil
.
isNotBlank
(
smileUserVO
.
getName
())){
String
userId
=
CurrentUtil
.
getCurrentUid
();
String
userId
=
CurrentUtil
.
getCurrentUid
();
/* String status=smileRedisUtils.getValidate(smileUserVO.getName(), smileUserVO.getIdCard());*/
/* String status=smileRedisUtils.getValidate(smileUserVO.getName(), smileUserVO.getIdCard());*/
log
.
info
(
"小家伙增加或者删除第二步实名认证开始userId={},ip={}"
,
userId
,
CurrentUtil
.
getCliIpAddr
());
//实名认证限制 每天10次
int
userValidateLimitNo
=
smileRedisUtils
.
getUserValidateLimitNo
(
userId
);
if
(
userValidateLimitNo
>=
10
){
log
.
info
(
"小家伙增加或者删除第二步实名认证已超出限制userId={},ip={}"
,
userId
,
CurrentUtil
.
getCliIpAddr
());
return
ResponseDto
.
failure
(
"小家伙今日操作已达上限!"
);
}
if
(
userValidateLimitNo
==
-
1
)
{
smileRedisUtils
.
setUserValidateLimitNo
(
userId
);
}
else
{
smileRedisUtils
.
incrValidateLimitNo
(
userId
);
}
if
(
utils
.
validate
(
smileUserVO
.
getName
(),
smileUserVO
.
getIdCard
())){
if
(
utils
.
validate
(
smileUserVO
.
getName
(),
smileUserVO
.
getIdCard
())){
smileUserVO
.
setUid
(
userId
);
smileUserVO
.
setUid
(
userId
);
SmileUserVO
smileUserVORedis
=
smileRedisUtils
.
getSmileUserVo
(
userId
);
SmileUserVO
smileUserVORedis
=
smileRedisUtils
.
getSmileUserVo
(
userId
);
...
...
liquidnet-bus-service/liquidnet-service-smile/liquidnet-service-smile-impl/src/main/java/com/liquidnet/service/util/SmileRedisUtils.java
View file @
81a198c2
...
@@ -9,6 +9,8 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -9,6 +9,8 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.time.LocalDateTime
;
import
java.time.temporal.ChronoUnit
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -47,6 +49,24 @@ public class SmileRedisUtils {
...
@@ -47,6 +49,24 @@ public class SmileRedisUtils {
redisUtil
.
set
(
SmileRedisConst
.
SMILE_USER_VALIDATE
.
concat
(
realName
+
cardNo
),
type
);
redisUtil
.
set
(
SmileRedisConst
.
SMILE_USER_VALIDATE
.
concat
(
realName
+
cardNo
),
type
);
}
}
/* - - - - - - - - - - - - -小家伙实名认证限制 - - - - - - - - - - - - - | */
public
boolean
setUserValidateLimitNo
(
String
uid
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
return
redisUtil
.
set
(
SmileRedisConst
.
SMILE_USER_VALIDATE_LIMIT
.
concat
(
uid
),
1
,
ChronoUnit
.
SECONDS
.
between
(
now
,
LocalDateTime
.
of
(
now
.
getYear
(),
now
.
getMonth
(),
now
.
getDayOfMonth
(),
23
,
59
,
59
)));
}
public
long
incrValidateLimitNo
(
String
uid
)
{
return
redisUtil
.
incr
(
SmileRedisConst
.
SMILE_USER_VALIDATE_LIMIT
.
concat
(
uid
),
1
);
}
public
int
getUserValidateLimitNo
(
String
uid
)
{
Object
o
=
redisUtil
.
get
(
SmileRedisConst
.
SMILE_USER_VALIDATE_LIMIT
.
concat
(
uid
));
return
null
==
o
?
-
1
:
(
int
)
o
;
}
/* ---------------------------------------- 销售数据 ---------------------------------------- */
/* ---------------------------------------- 销售数据 ---------------------------------------- */
public
SmileSellDataVO
getSellDataVo
(
String
userId
,
String
performanceId
)
{
public
SmileSellDataVO
getSellDataVo
(
String
userId
,
String
performanceId
)
{
return
(
SmileSellDataVO
)
redisUtil
.
get
(
SmileRedisConst
.
SELL_DATA
.
concat
(
userId
).
concat
(
performanceId
));
return
(
SmileSellDataVO
)
redisUtil
.
get
(
SmileRedisConst
.
SELL_DATA
.
concat
(
userId
).
concat
(
performanceId
));
...
...
liquidnet-bus-service/liquidnet-service-smile/liquidnet-service-smile-impl/src/main/java/com/liquidnet/service/util/Utils.java
View file @
81a198c2
...
@@ -7,6 +7,7 @@ import com.liquidnet.service.base.ErrorMapping;
...
@@ -7,6 +7,7 @@ import com.liquidnet.service.base.ErrorMapping;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
@Slf4j
@Slf4j
@Component
@Component
...
@@ -30,9 +31,11 @@ public class Utils {
...
@@ -30,9 +31,11 @@ public class Utils {
String
respStr
=
IdentityUtils
.
aliThird
(
realName
,
cardNo
),
respErrorCode
=
null
;
String
respStr
=
IdentityUtils
.
aliThird
(
realName
,
cardNo
),
respErrorCode
=
null
;
JsonNode
respJNode
=
JsonUtils
.
fromJson
(
respStr
,
JsonNode
.
class
);
JsonNode
respJNode
=
JsonUtils
.
fromJson
(
respStr
,
JsonNode
.
class
);
if
(
null
==
respJNode
||
!
"0"
.
equals
(
respErrorCode
=
String
.
valueOf
(
respJNode
.
get
(
"error_code"
))))
{
if
(
null
==
respJNode
||
!
"0"
.
equals
(
respErrorCode
=
String
.
valueOf
(
respJNode
.
get
(
"error_code"
))))
{
log
.
debug
(
"###实名认证失败[{}]"
,
respJNode
);
log
.
info
(
"###实名认证失败[{}]"
,
respJNode
);
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"10102"
);
if
(!
StringUtils
.
isEmpty
(
respErrorCode
)
&&
org
.
apache
.
commons
.
lang3
.
StringUtils
.
indexOf
(
"3000290033"
,
respErrorCode
)
<
0
)
{
smileRedisUtils
.
setValidate
(
realName
,
cardNo
,
"1"
);
// 认证服务商'30002'、'90033'为运营商导致的失败,这里不做缓存标记
smileRedisUtils
.
setValidate
(
realName
,
cardNo
,
"1"
);
}
return
false
;
return
false
;
}
}
smileRedisUtils
.
setValidate
(
realName
,
cardNo
,
"2"
);
smileRedisUtils
.
setValidate
(
realName
,
cardNo
,
"2"
);
...
...
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