1.SpringBoot cannot start after defining aop
2. This is my code:
package com.rong360.crawler.meituan.aop;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/ *
- intercepts requests from each controller interface and stores logs.
* /
@ Aspect
@ Component
public class MtReturnInterceptor {
Logger logger = LoggerFactory.getLogger(MtReturnInterceptor.class);
@Pointcut("execution(public * com.rong360.crawler.meituan.controller.*(..))")
private void controllerAspect() {
}
@AfterReturning(returning = "ret", pointcut = "controllerAspect()")
public void doAfterReturning(Object ret) throws Throwable {
//
System.out.println(" : " + ret);
}
}