关于SpringCloud AOP的实现

废话不多说,直接上代码:

新建一个类,打上注解

@Component
@Aspect
public class addBranchShopAOP{
/**
 * 指定切方法
 */
@Pointcut("execution(* easy.quick.user.controller.ShopController.addBranchShop(..))")
public void access() {
}

@Before("access()")
public void deBefore(JoinPoint joinPoint) throws Throwable {
}

@After("access()")
public void logServiceAccesster(JoinPoint joinPoint){
     //这里写需要实现的代码
}
    }

猜你喜欢

转载自blog.csdn.net/qq_31122833/article/details/79927113