spring boot 多个切点共用同一个通知

 最近项目用到了 spring boot  aop 

  在 类的上方 用 @Aspect 

  在方法的上方 用 @Around 或者 before 等

  切点 在 @Around 的注解中 写进去

  例如:

  @Around("execution(* org.test.services.TestServices.test1(..))")

  多个切点共用同一个通知的话能用boolean 语句

 例如:

  @Around("execution(* org.test.services.TestServices.test1(..))

||execution(* org.test.services.TestServices.test2(..)")

 

猜你喜欢

转载自blog.csdn.net/QAQ_666666/article/details/83347614