记得上下班打卡 | 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
89bc42f0
Commit
89bc42f0
authored
Jun 17, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:dev|test +接口耗时;
添加入场人证件号后台正则校验逻辑删除;
parent
e093c971
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
23 deletions
+37
-23
AdamEntersParam.java
.../java/com/liquidnet/service/adam/dto/AdamEntersParam.java
+1
-1
GlobalAuthorityInterceptor.java
...quidnet/common/web/filter/GlobalAuthorityInterceptor.java
+18
-0
liquidnet-service-adam.yml
...et-bus-config/liquidnet-config/liquidnet-service-adam.yml
+0
-4
liquidnet-service-kylin.yml
...t-bus-config/liquidnet-config/liquidnet-service-kylin.yml
+0
-4
db_ln_adam_initialdata.sql
...quidnet-service-adam-impl/docu/db_ln_adam_initialdata.sql
+15
-13
AdamWebMvcConfig.java
...a/com/liquidnet/service/adam/config/AdamWebMvcConfig.java
+3
-1
No files found.
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/AdamEntersParam.java
View file @
89bc42f0
...
@@ -23,6 +23,6 @@ public class AdamEntersParam implements java.io.Serializable {
...
@@ -23,6 +23,6 @@ public class AdamEntersParam implements java.io.Serializable {
@NotNull
@Min
(
1
)
@Max
(
5
)
@NotNull
@Min
(
1
)
@Max
(
5
)
private
Integer
type
;
private
Integer
type
;
@ApiModelProperty
(
position
=
14
,
required
=
true
,
value
=
"入场人证件号[11]"
,
example
=
"110101110001010111"
)
@ApiModelProperty
(
position
=
14
,
required
=
true
,
value
=
"入场人证件号[11]"
,
example
=
"110101110001010111"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
CHINESE_ID_CARD
,
message
=
"身份证号格式有误"
)
//
@Pattern(regexp = LnsRegex.Valid.CHINESE_ID_CARD, message = "身份证号格式有误")
private
String
idCard
;
private
String
idCard
;
}
}
liquidnet-bus-common/liquidnet-common-web/src/main/java/com/liquidnet/common/web/filter/GlobalAuthorityInterceptor.java
View file @
89bc42f0
...
@@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.AntPathMatcher
;
import
org.springframework.util.AntPathMatcher
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.DigestUtils
;
...
@@ -37,10 +38,16 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
...
@@ -37,10 +38,16 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
private
static
final
String
TOKEN_KICK
=
"40002"
;
private
static
final
String
TOKEN_KICK
=
"40002"
;
private
static
final
String
TOKEN_INVALID
=
"40003"
;
private
static
final
String
TOKEN_INVALID
=
"40003"
;
private
static
final
String
START_TIME
=
"_startTime"
;
private
static
final
String
ENV_PROD
=
"prod"
;
private
static
final
String
ENV_ACTIVE
=
"spring.profiles.active"
;
private
static
final
String
KYLIN_STATION_JWT_VALID
=
"/station/**"
;
private
static
final
String
KYLIN_STATION_JWT_VALID
=
"/station/**"
;
private
final
static
AntPathMatcher
antPathMatcher
=
new
AntPathMatcher
();
private
final
static
AntPathMatcher
antPathMatcher
=
new
AntPathMatcher
();
@Autowired
Environment
env
;
@Autowired
@Autowired
JwtValidator
jwtValidator
;
JwtValidator
jwtValidator
;
@Autowired
@Autowired
...
@@ -48,6 +55,8 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
...
@@ -48,6 +55,8 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
request
.
setAttribute
(
START_TIME
,
System
.
currentTimeMillis
());
String
authorization
=
request
.
getHeader
(
CurrentUtil
.
uToken
),
uri
=
request
.
getRequestURI
(),
String
authorization
=
request
.
getHeader
(
CurrentUtil
.
uToken
),
uri
=
request
.
getRequestURI
(),
responseCode
=
null
,
token
=
null
,
currentUid
=
null
;
responseCode
=
null
,
token
=
null
,
currentUid
=
null
;
...
@@ -91,6 +100,15 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
...
@@ -91,6 +100,15 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
return
false
;
return
false
;
}
}
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
if
(!
StringUtils
.
equalsIgnoreCase
(
env
.
getProperty
(
ENV_ACTIVE
),
ENV_PROD
))
{
Long
endTime
=
System
.
currentTimeMillis
();
Long
startTime
=
(
Long
)
request
.
getAttribute
(
"_startTime"
);
log
.
info
(
"[{}]耗时:{}s"
,
request
.
getRequestURI
(),
((
endTime
-
startTime
)
*
1.000
)
/
1000
);
}
}
private
void
responseHandler
(
HttpServletResponse
response
,
String
responseCode
)
throws
IOException
{
private
void
responseHandler
(
HttpServletResponse
response
,
String
responseCode
)
throws
IOException
{
ResponseDto
<
Object
>
responseDto
=
ResponseDto
.
failure
(
ErrorMapping
.
get
(
responseCode
));
ResponseDto
<
Object
>
responseDto
=
ResponseDto
.
failure
(
ErrorMapping
.
get
(
responseCode
));
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-adam.yml
View file @
89bc42f0
...
@@ -137,10 +137,6 @@ spring:
...
@@ -137,10 +137,6 @@ spring:
# -----------------------------------------------------------
# -----------------------------------------------------------
global-auth
:
global-auth
:
exclude-url-pattern
:
exclude-url-pattern
:
-
${liquidnet.info.context}/doc.html
-
${liquidnet.info.context}/webjars/**
-
${liquidnet.info.context}/swagger-resources/**
-
${liquidnet.info.context}/v2/api-docs*
-
${liquidnet.info.context}/login/*
-
${liquidnet.info.context}/login/*
-
${liquidnet.info.context}/send
-
${liquidnet.info.context}/send
-
${liquidnet.info.context}/member/info
-
${liquidnet.info.context}/member/info
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-kylin.yml
View file @
89bc42f0
...
@@ -138,10 +138,6 @@ spring:
...
@@ -138,10 +138,6 @@ spring:
# -----------------------------------------------------------
# -----------------------------------------------------------
global-auth
:
global-auth
:
exclude-url-pattern
:
exclude-url-pattern
:
-
${liquidnet.info.context}/doc.html
-
${liquidnet.info.context}/webjars/**
-
${liquidnet.info.context}/swagger-resources/**
-
${liquidnet.info.context}/v2/api-docs*
-
${liquidnet.info.context}/station/login
-
${liquidnet.info.context}/station/login
-
${liquidnet.info.context}/station/login/sms
-
${liquidnet.info.context}/station/login/sms
# -
# -
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/docu/db_ln_adam_initialdata.sql
View file @
89bc42f0
...
@@ -81,6 +81,8 @@ create table adam_user_info
...
@@ -81,6 +81,8 @@ create table adam_user_info
qr_code
varchar
(
255
)
comment
'身份二维码'
,
qr_code
varchar
(
255
)
comment
'身份二维码'
,
qr_pic
varchar
(
255
)
comment
'身份二维码'
,
qr_pic
varchar
(
255
)
comment
'身份二维码'
,
tag_me
json
comment
'音乐标签'
,
tag_me
json
comment
'音乐标签'
,
rong_cloud_token
varchar
(
64
),
rong_cloud_tag
tinyint
,
comment
text
comment
text
)
engine
=
InnoDB
comment
'用户信息'
;
)
engine
=
InnoDB
comment
'用户信息'
;
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/config/AdamWebMvcConfig.java
View file @
89bc42f0
...
@@ -13,7 +13,9 @@ public class AdamWebMvcConfig extends WebMvcConfig {
...
@@ -13,7 +13,9 @@ public class AdamWebMvcConfig extends WebMvcConfig {
@Override
@Override
protected
void
addInterceptors
(
InterceptorRegistry
registry
)
{
protected
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
globalAuthorityInterceptor
).
addPathPatterns
(
"/**"
);
registry
.
addInterceptor
(
globalAuthorityInterceptor
)
.
addPathPatterns
(
"/**"
)
.
excludePathPatterns
(
"/*/v2/api-docs*"
,
"/*/swagger-resources/**"
,
"/*/webjars/**"
,
"/doc.html"
);
super
.
addInterceptors
(
registry
);
super
.
addInterceptors
(
registry
);
}
}
}
}
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