Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-store
Commits
db4a93a9
Commit
db4a93a9
authored
Sep 25, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打印参数
parent
28288d92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
ParamAOP.java
...e-service/src/main/java/com/gic/store/utils/ParamAOP.java
+5
-7
No files found.
gic-store-service/src/main/java/com/gic/store/utils/ParamAOP.java
View file @
db4a93a9
...
...
@@ -9,8 +9,6 @@ import org.aspectj.lang.annotation.Aspect;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.context.annotation.Configuration
;
import
java.lang.reflect.Method
;
/**
* 采集GIC系统操作日志
*
...
...
@@ -34,10 +32,10 @@ public class ParamAOP {
public
Object
around
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
try
{
// 当前方法
Method
currentMethod
=
getCurrentMethod
(
joinPoint
);
String
currentMethodName
=
getMethodName
(
joinPoint
);
// 当前方法参数列表
Object
[]
args
=
joinPoint
.
getArgs
();
logger
.
info
(
"请求方法:{}, 参数:{}"
,
currentMethod
.
getName
()
,
args
);
logger
.
info
(
"请求方法:{}, 参数:{}"
,
currentMethod
Name
,
args
);
// 执行当前方法
return
joinPoint
.
proceed
();
}
catch
(
Throwable
throwable
)
{
...
...
@@ -53,11 +51,10 @@ public class ParamAOP {
* @return
* @throws
*/
private
Method
getCurrentMethod
(
ProceedingJoinPoint
joinPoint
)
throws
NoSuchMethodException
{
private
String
getMethodName
(
ProceedingJoinPoint
joinPoint
)
throws
NoSuchMethodException
{
Signature
signature
=
joinPoint
.
getSignature
();
MethodSignature
methodSignature
=
(
MethodSignature
)
signature
;
Object
target
=
joinPoint
.
getTarget
();
return
target
.
getClass
().
getMethod
(
methodSignature
.
getName
(),
methodSignature
.
getParameterTypes
());
return
target
.
getClass
().
getName
()
+
"."
+
methodSignature
.
getName
();
}
}
\ No newline at end of file
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