Ver código fonte

测试拦截器

kouchengxing 5 anos atrás
pai
commit
2b9069015a

+ 0 - 3
dgtly-apiframework/src/main/java/com/dgtly/apiframework/config/SwitchEnSqlInterceptorConfig.java

@@ -16,7 +16,6 @@ import java.util.Properties;
 
 @Configuration
 @ConditionalOnBean({SqlSessionFactory.class})
-@AutoConfigureAfter({MybatisAutoConfiguration.class})
 public class SwitchEnSqlInterceptorConfig {
 
         @Autowired
@@ -29,14 +28,12 @@ public class SwitchEnSqlInterceptorConfig {
 
         @PostConstruct
         public void addPageInterceptor() {
-            System.out.println("进入拦截器配置SwitchEnSqlInterceptorConfig-------------------------------------------------");
             SwitchEnSqlInterceptor interceptor = new SwitchEnSqlInterceptor();
             Iterator var3 = this.sqlSessionFactoryList.iterator();
             Properties properties = new Properties();
             interceptor.setProperties( properties);
             while(var3.hasNext()) {
                 SqlSessionFactory sqlSessionFactory = (SqlSessionFactory)var3.next();
-                System.out.println("加入拦截器到配置-------------------------------------------------");
                 sqlSessionFactory.getConfiguration().addInterceptor(interceptor);
             }
 

+ 0 - 2
dgtly-apiframework/src/main/java/com/dgtly/apiframework/interceptor/SwitchEnSqlInterceptor.java

@@ -34,7 +34,6 @@ public class SwitchEnSqlInterceptor  implements Interceptor {
     }
 
     public Object intercept(Invocation invocation) throws Throwable {
-        System.out.println("进入拦截器-----------------------");
         // 获取原始sql语句
         MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
         Object parameter = invocation.getArgs()[1];
@@ -54,7 +53,6 @@ public class SwitchEnSqlInterceptor  implements Interceptor {
             for(Method method : classType.getDeclaredMethods()){
                 if(method!=null && mName.equals(method.getName()) && method.isAnnotationPresent(SwitchEn.class))
                 {
-                    System.out.println("处理sql-----------------------");
                     SwitchEn switchEn = method.getAnnotation(SwitchEn.class);
                     String[] oldfiles = switchEn.oldfiles();
                     String[] newfiles = switchEn.newfiles();