@Aspect
@Component
public class AnnotationPointCut {
@Autowired
private HttpServletRequest request;
@Around("execution(* 你想监控的包的路径(如:com.xxx.xxx.xxx.xxx)..*(..))")
public Object around(ProceedingJoinPoint point) throws Throwable {
System.out.println(point.getSignature().getName());
System.out.println(request.getRemoteAddr());
return point.proceed(); //必须要写,不然不会执行自身的方法体
}
}
使用AOP监控是那个IP访问接口的
最新推荐文章于 2024-06-13 15:45:17 发布