@Pointcut("execution(* com.example.service.*.*(..))") public void serviceMethods() {} @Before("serviceMethods()") public void beforeServiceMethod(JoinPoint joinPoint) { System.out.println("Before executing service method: " + joinPoint.getSignature().getName()); } @Aspect public class LoggingAspect { @Before("serviceMethods()") public void beforeServiceMethod(JoinPoint joinPoint) { System.out.println("Before executing service method: " + joinPoint.getSignature().getName()); } }


上一篇:
下一篇:
切换中文