package com.ayah.aop.aspect;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class TestAspect {
@Pointcut(value = "execution(* com.ayah.aop.service.*.*(..))")
public void executionAllMethod() {
}
@Before(value = "executionAllMethod()")
public void before(JoinPoint joinPoint) {
System.out.println("Before -> " + joinPoint.getSignature().getName());
Object[] args = joinPoint.getArgs();
System.out.println("Before -> " + args[0] + " " + args[1]);
}
}