<dependency> <groupId>com.nepxion</groupId> <artifactId>matrix-aop-starter</artifactId> <version>xxx</version> </dependency> yaml matrix: aop: interceptor: include: exclude: strategy: @Component public class LoggerInterceptor implements MethodInterceptor { @Override public Object invoke(MethodInvocation invocation) throws Throwable { log.info("User behavior log - " + invocation.getMethod().getName() + " method is called"); Object result = invocation.proceed(); log.info("User behavior log - " + invocation.getMethod().getName() + " method is finished"); return result; } } @Intercept(LoggerInterceptor.class) public interface UserService { void login(String username, String password); }


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