需要使用代理对象,否则无法拦截
public interface AopProxy <T>{
@SuppressWarnings("unchecked")
default T self() {
return (T) AopContext.currentProxy();
}
}
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
public class GetDataServiceImpl implements GetDataService, AopProxy<GetDataService>{
this.self.a()
}