@Aspect
public class AopTest {
@Around(value = "@annotation(MyAnnotation)")
public void testAnnotion(ProceedingJoinPoint joinPoint){
try {
ThreadLocal<String> threadLocal = new ThreadLocal<>();
Object proceed = joinPoint.proceed();
} catch (Throwable throwable) {
throwable.printStackTrace();
} finally {
}
}
}
匹配所有加過@MyAnnotation 注解的方法進行攔截增強