Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
5cb80ae3
Commit
5cb80ae3
authored
Sep 27, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add aop log
parent
d3c9c6c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
1 deletion
+68
-1
AopLogger.java
...-api/src/main/java/pwc/taxtech/atms/common/AopLogger.java
+68
-0
ModelConfigurationServiceImpl.java
...tech/atms/service/impl/ModelConfigurationServiceImpl.java
+0
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/AopLogger.java
0 → 100644
View file @
5cb80ae3
package
pwc
.
taxtech
.
atms
.
common
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.After
;
import
org.aspectj.lang.annotation.AfterThrowing
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
@Component
@Aspect
public
class
AopLogger
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AopLogger
.
class
);
@Pointcut
(
"execution(public * pwc.taxtech.atms.service.*.*(..))"
)
public
void
pointCut
()
{
// 定义Pointcut 此方法不能有返回值,该方法只是一个标示
}
@Before
(
"pointCut()"
)
public
void
before
(
JoinPoint
joinPoint
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"aop before:{}"
,
joinPoint
);
}
}
@After
(
"pointCut()"
)
public
void
after
(
JoinPoint
joinPoint
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"aop after:{}"
,
joinPoint
);
}
}
@AfterThrowing
(
pointcut
=
"pointCut()"
,
throwing
=
"error"
)
public
void
afterThrowing
(
JoinPoint
joinPoint
,
Throwable
error
)
{
if
(
logger
.
isWarnEnabled
())
{
logger
.
warn
(
"aop afterThrowing:{}, exception class:{}, exception message:{} "
,
joinPoint
,
error
.
getClass
().
toString
(),
error
.
getMessage
());
}
}
// @After("pointCut()")
// public void doAfter(JoinPoint joinPoint) {
// System.out.println("AOP After Advice...");
// }
//
// @AfterReturning(pointcut = "pointCut()", returning = "returnVal")
// public void afterReturn(JoinPoint joinPoint, Object returnVal) {
// System.out.println("AOP AfterReturning Advice:" + returnVal);
// }
//
//
// @Around("pointCut()")
// public void around(ProceedingJoinPoint pjp) {
// System.out.println("AOP Aronud before...");
// try {
// pjp.proceed();
// } catch (Throwable e) {
// e.printStackTrace();
// }
// System.out.println("AOP Aronud after...");
// }
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ModelConfigurationServiceImpl.java
View file @
5cb80ae3
...
...
@@ -19,5 +19,4 @@ public class ModelConfigurationServiceImpl extends AbstractService implements Mo
map
.
put
(
"industryId"
,
industryId
);
return
modelConfigMapper
.
getModelListByIndustry
(
map
);
}
}
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