@Pointcut("execution(* com.example.service.*.*(..))") public void serviceMethod() {} @Aspect @Component public class LoggingAspect { @Before("com.example.aspect.LoggingAspect.serviceMethod()") public void beforeAdvice(JoinPoint joinPoint) { } @After("com.example.aspect.LoggingAspect.serviceMethod()") public void afterAdvice(JoinPoint joinPoint) { } } @Configuration @EnableAspectJAutoProxy public class AppConfig { }


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