Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
7b7df13d
Commit
7b7df13d
authored
Jun 28, 2023
by
王亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format Localdatetime
parent
29022760
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
15 deletions
+2
-15
LogCallHttpAspect.java
...n/quantgroup/xyqb/aspect/logcaller/LogCallHttpAspect.java
+1
-7
ModifyPhoneNoController.java
...yqb/controller/modifyphoneno/ModifyPhoneNoController.java
+1
-8
No files found.
src/main/java/cn/quantgroup/xyqb/aspect/logcaller/LogCallHttpAspect.java
View file @
7b7df13d
...
...
@@ -2,14 +2,12 @@ package cn.quantgroup.xyqb.aspect.logcaller;
import
cn.quantgroup.xyqb.util.IpUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.base.Stopwatch
;
import
lombok.extern.slf4j.Slf4j
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
...
...
@@ -28,10 +26,6 @@ import java.util.concurrent.TimeUnit;
@Component
@Order
(
value
=
Ordered
.
HIGHEST_PRECEDENCE
)
public
class
LogCallHttpAspect
{
@Autowired
private
ObjectMapper
objectMapper
;
@Pointcut
(
value
=
"execution(public * cn.quantgroup.xyqb.controller..*.*(..)) "
+
"&& !execution(* cn.quantgroup.xyqb.controller.ExceptionHandlingController.*(..))"
+
"&& !execution(* cn.quantgroup.xyqb.controller.middleoffice.login.ILoginModule.*(..))"
)
// 服务层包路径导致错误,暂时不动,在合适的时候应该挪走
...
...
@@ -55,7 +49,7 @@ public class LogCallHttpAspect {
throw
e
;
}
finally
{
long
elapsed
=
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
);
String
resultStr
=
result
==
null
?
""
:
objectMapper
.
writeValueAs
String
(
result
);
String
resultStr
=
result
==
null
?
""
:
JSON
.
toJSON
String
(
result
);
resultStr
=
resultStr
.
length
()
<
500
?
resultStr
:
resultStr
.
substring
(
0
,
500
);
log
.
info
(
"[httpRequestLog],url:[{}],duration:[{}],[耗时区间]{},remoteIP:[{}],args:[{}],exception:[{}],result:[{}]"
,
request
.
getRequestURL
(),
elapsed
,
slowlyTag
(
elapsed
),
remoteIP
,
JSON
.
toJSONString
(
args
),
hasException
,
resultStr
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/modifyphoneno/ModifyPhoneNoController.java
View file @
7b7df13d
...
...
@@ -10,7 +10,6 @@ import cn.quantgroup.xyqb.entity.ModifyPhoneNo;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.service.user.IModifyPhoneNoService
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.domain.Page
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
java.text.SimpleDateFormat
;
/**
* 用户手机号修改相关api
...
...
@@ -81,14 +79,9 @@ public class ModifyPhoneNoController implements IBaseController {
@GetMapping
public
JsonResult
<?>
list
(
@Valid
ModifyPhoneNoQueryReq
modifyPhoneNoQueryReq
)
{
Page
<
ModifyPhoneNo
>
list
=
modifyPhoneNoService
.
list
(
modifyPhoneNoQueryReq
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
objectMapper
.
setDateFormat
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
));
String
s
;
try
{
Page
<
ModifyPhoneNoResp
>
result
=
list
.
map
(
ModifyPhoneNoResp:
:
from
);
s
=
objectMapper
.
writeValueAsString
(
result
);
Object
o
=
objectMapper
.
readValue
(
s
,
Object
.
class
);
return
JsonResult
.
buildSuccessResultGeneric
(
o
);
return
JsonResult
.
buildSuccessResultGeneric
(
result
);
}
catch
(
Exception
ignored
)
{
}
return
JsonResult
.
buildErrorStateResult
(
"数据错误"
,
null
);
...
...
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