Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
extend
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
park
extend
Commits
c373e2e2
Commit
c373e2e2
authored
Jun 24, 2020
by
lixian7
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'test'
Dev See merge request
!7
parents
40bdbbdc
ebf155a6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
14 deletions
+24
-14
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
+13
-1
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/H5Controller.java
+2
-2
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/intercept/EncryptResponseBodyAdvice.java
+3
-3
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
+2
-3
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/core/Result/Result.java
+2
-2
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/core/Result/ResultGenerator.java
+1
-1
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/ViolationCache.java
+1
-2
No files found.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
View file @
c373e2e2
...
@@ -61,6 +61,9 @@ public class BindInfoControlller extends BaseController {
...
@@ -61,6 +61,9 @@ public class BindInfoControlller extends BaseController {
}
catch
(
DistributedLockException
e
)
{
}
catch
(
DistributedLockException
e
)
{
log
.
error
(
"分布式锁超时"
);
log
.
error
(
"分布式锁超时"
);
return
ResultGenerator
.
fail
(
ResultCode
.
REPEAT_SUBMIT
);
return
ResultGenerator
.
fail
(
ResultCode
.
REPEAT_SUBMIT
);
}
catch
(
Exception
e
)
{
log
.
error
(
"系统异常:{}"
,
e
);
return
ResultGenerator
.
fail
(
ResultCode
.
SYSTEM_ERROR
);
}
}
return
response
;
return
response
;
}
}
...
@@ -77,7 +80,16 @@ public class BindInfoControlller extends BaseController {
...
@@ -77,7 +80,16 @@ public class BindInfoControlller extends BaseController {
@PostMapping
(
"unbind"
)
@PostMapping
(
"unbind"
)
@BodyDecryptAnnotation
@BodyDecryptAnnotation
public
Result
unbindInfo
(
@RequestBody
@Validated
UnBindReq
req
)
{
public
Result
unbindInfo
(
@RequestBody
@Validated
UnBindReq
req
)
{
return
service
.
unbindInfo
(
req
);
Result
result
=
null
;
try
{
result
=
service
.
unbindInfo
(
req
);
}
catch
(
DistributedLockException
e
)
{
return
ResultGenerator
.
fail
(
ResultCode
.
REPEAT_SUBMIT
);
}
catch
(
Exception
e
)
{
log
.
error
(
"系统异常:{}"
,
e
);
return
ResultGenerator
.
fail
(
ResultCode
.
SYSTEM_ERROR
);
}
return
result
;
}
}
/**
/**
...
...
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/H5Controller.java
View file @
c373e2e2
...
@@ -146,7 +146,7 @@ public class H5Controller {
...
@@ -146,7 +146,7 @@ public class H5Controller {
* 发送短信验证码
* 发送短信验证码
*
*
* @param req
* @param req
* @return Res
ponse
* @return Res
ult
* @author: xsx
* @author: xsx
* @date: 2020/6/21 13:57
* @date: 2020/6/21 13:57
*/
*/
...
@@ -164,7 +164,7 @@ public class H5Controller {
...
@@ -164,7 +164,7 @@ public class H5Controller {
* 校验短信验证码
* 校验短信验证码
*
*
* @param req
* @param req
* @return Res
ponse
* @return Res
ult
* @author: xsx
* @author: xsx
* @date: 2020/6/21 13:58
* @date: 2020/6/21 13:58
*/
*/
...
...
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/intercept/EncryptResponseBodyAdvice.java
View file @
c373e2e2
...
@@ -41,7 +41,7 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice {
...
@@ -41,7 +41,7 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice {
@Override
@Override
public
Object
beforeBodyWrite
(
Object
o
,
MethodParameter
methodParameter
,
MediaType
mediaType
,
Class
aClass
,
ServerHttpRequest
serverHttpRequest
,
ServerHttpResponse
serverHttpResponse
)
{
public
Object
beforeBodyWrite
(
Object
o
,
MethodParameter
methodParameter
,
MediaType
mediaType
,
Class
aClass
,
ServerHttpRequest
serverHttpRequest
,
ServerHttpResponse
serverHttpResponse
)
{
try
{
try
{
log
.
info
(
"Res
ponse
body 明文: {}"
,
objectMapper
.
writeValueAsString
(
o
));
log
.
info
(
"Res
ult
body 明文: {}"
,
objectMapper
.
writeValueAsString
(
o
));
if
(
methodParameter
.
getMethod
().
isAnnotationPresent
(
ResponseEncryptAnnotation
.
class
)
&&
o
instanceof
Response
)
{
if
(
methodParameter
.
getMethod
().
isAnnotationPresent
(
ResponseEncryptAnnotation
.
class
)
&&
o
instanceof
Response
)
{
Response
<
Object
>
result
=
(
Response
<
Object
>)
o
;
Response
<
Object
>
result
=
(
Response
<
Object
>)
o
;
if
(
StatusCode
.
SUCCESS
.
getCode
()
==
(
result
.
getCode
())
)
{
if
(
StatusCode
.
SUCCESS
.
getCode
()
==
(
result
.
getCode
())
)
{
...
@@ -54,12 +54,12 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice {
...
@@ -54,12 +54,12 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice {
baseEncryptRes
.
setEncData
(
encryptStr
);
baseEncryptRes
.
setEncData
(
encryptStr
);
result
.
setData
(
baseEncryptRes
);
result
.
setData
(
baseEncryptRes
);
o
=
result
;
o
=
result
;
log
.
info
(
"Res
ponse
body 密文: {}"
,
objectMapper
.
writeValueAsString
(
o
));
log
.
info
(
"Res
ult
body 密文: {}"
,
objectMapper
.
writeValueAsString
(
o
));
}
}
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"Res
ponse
body 加密异常:{}"
,
e
);
log
.
error
(
"Res
ult
body 加密异常:{}"
,
e
);
}
}
return
o
;
return
o
;
}
}
...
...
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
c373e2e2
...
@@ -176,13 +176,12 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
...
@@ -176,13 +176,12 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@DistributedLock
(
key
=
"'park:extend:lock:unbind:unqId:'+#req.unqId+':userId:'+#req.userId+':timestamp:'+#req"
+
@DistributedLock
(
key
=
"'park:extend:lock:unbind:unqId:'+#req.unqId+':userId:'+#req.userId+':timestamp:'+#req"
+
".timestamp"
,
expireTime
=
3000
,
waitTime
=
2000
,
retryTimes
=
50
)
".timestamp"
,
isSpin
=
false
)
public
Result
unbindInfo
(
UnBindReq
req
)
{
public
Result
unbindInfo
(
UnBindReq
req
)
{
ParkBindInfo
bindInfo
=
bindCache
.
getById
(
req
.
getUnqId
());
ParkBindInfo
bindInfo
=
bindCache
.
getById
(
req
.
getUnqId
());
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
return
ResultGenerator
.
fail
(
ResultCode
.
BIND_INFO_UNKNOWN
);
return
ResultGenerator
.
fail
(
ResultCode
.
BIND_INFO_UNKNOWN
);
}
}
if
(!
bindCache
.
unBind
(
req
.
getUnqId
(),
req
.
getUserId
()))
{
if
(!
bindCache
.
unBind
(
req
.
getUnqId
(),
req
.
getUserId
()))
{
//手动回滚
//手动回滚
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/core/Result/Result.java
View file @
c373e2e2
...
@@ -23,12 +23,12 @@ public class Result<T> {
...
@@ -23,12 +23,12 @@ public class Result<T> {
/**
/**
* 状态码
* 状态码
*/
*/
private
long
code
;
private
long
code
=
ResultCode
.
SUCCESS
.
getCode
()
;
/**
/**
* 描述
* 描述
*/
*/
private
String
msg
;
private
String
msg
=
ResultCode
.
SUCCESS
.
getMsg
()
;
/**
/**
* 挂载数据
* 挂载数据
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/core/Result/ResultGenerator.java
View file @
c373e2e2
...
@@ -33,7 +33,7 @@ public class ResultGenerator {
...
@@ -33,7 +33,7 @@ public class ResultGenerator {
public
static
<
T
>
Result
<
T
>
fail
(
String
msg
)
{
public
static
<
T
>
Result
<
T
>
fail
(
String
msg
)
{
Result
<
T
>
result
=
new
Result
<>();
Result
<
T
>
result
=
new
Result
<>();
result
.
setSuccess
(
false
);
result
.
setSuccess
(
false
);
result
.
setCode
(
Status
Code
.
BUSINESS_ERROR
.
getCode
());
result
.
setCode
(
Result
Code
.
BUSINESS_ERROR
.
getCode
());
result
.
setMsg
(
msg
);
result
.
setMsg
(
msg
);
return
result
;
return
result
;
}
}
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/ViolationCache.java
View file @
c373e2e2
...
@@ -25,8 +25,7 @@ public class ViolationCache {
...
@@ -25,8 +25,7 @@ public class ViolationCache {
* @param req 号牌+号牌类型,时间开始-结束
* @param req 号牌+号牌类型,时间开始-结束
* @return
* @return
*/
*/
@Cacheable
(
value
=
"violations"
,
key
=
"'plateNum:'+#req.plateNum+':plateType:'+#req.plateType+':timeStart:'+#req"
+
@Cacheable
(
value
=
"violations"
,
key
=
"'plateNum:'+#req.plateNum+':plateType:'+#req.plateType"
,
unless
=
"#result==null or #result.size()==0"
)
".timeStart.toString()+':timeEnd:'+#req.timeEnd.toString()"
,
unless
=
"#result==null or #result.size()==0"
)
public
List
<
ViolationMicRes
>
getByPlateNumAndType
(
ViolationListByTimeReq
req
)
{
public
List
<
ViolationMicRes
>
getByPlateNumAndType
(
ViolationListByTimeReq
req
)
{
return
violatio
.
listByTime
(
req
).
getData
();
return
violatio
.
listByTime
(
req
).
getData
();
}
}
...
...
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