前情回顾: Spring MVC AOP通过注解方式拦截Controller等实现日志管理
1、添加spring boot引用
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-aop
2、在spring boot的Application启动类中使用@EnableAspectJAutoProxy注解,添加对Aspectj支持 3、与前情回顾编写类似的OperationLogger、SysLogAspect 4、在需要使用的方法上添加 @OperationLogger注解,搞定
个人微信公众号:
作者:jiankunking 出处:http://blog.csdn.net/jiankunking