pro.shuangxi.devTool.mybatis.MybatisDevToolAutoConfig Maven / Gradle / Ivy
package pro.shuangxi.devTool.mybatis;
import javax.servlet.http.HttpServletRequest;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import pro.shuangxi.devTool.DevToolProperties;
/**
* @author mengshx
**/
@Configuration
@ConditionalOnClass(SqlSessionFactory.class)
public class MybatisDevToolAutoConfig {
public MybatisDevToolAutoConfig() {
System.out.println("MybatisDevToolAutoConfig");
}
@Bean
@Order(Ordered.LOWEST_PRECEDENCE)
@ConditionalOnProperty(name = "dev-tool.mybatis.open-log", havingValue = "true",matchIfMissing = true)
public MyBatisSqlInterceptor myBatisSqlInterceptor(MybatisDevToolProperties properties) {
MyBatisSqlInterceptor interceptor = new MyBatisSqlInterceptor();
return interceptor;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy