废话不多说,直接上代码:
新建一个类,打上注解
@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){
//这里写需要实现的代码
}}