引入注解
- <dependency>
- <groupId>org.aspectjgroupId>
- <artifactId>aspectjrtartifactId>
- <version>1.9.1version>
- dependency>
- <dependency>
- <groupId>org.aspectjgroupId>
- <artifactId>aspectjweaverartifactId>
- <version>1.9.1version>
- dependency>
注解类
- import java.lang.annotation.*;
-
- @Retention(value = RetentionPolicy.RUNTIME)
- @Target(value = {ElementType.METHOD})
- @Documented
- @Inherited
- public @interface SysLog {
- //操作详情
- String value();
- //操作的对象
- String object();
- }
日志切面类
- import org.aspectj.lang.ProceedingJoinPoint;
- import org.aspectj.lang.annotation.*;
- import org.aspectj.lang.reflect.MethodSignature;
- import org.springframework.context.annotation.ComponentScan;
- import org.springframe