From 9438770c5d62175bb0a21362e72377fd8b8954e7 Mon Sep 17 00:00:00 2001 From: smallchill Date: Thu, 9 Jan 2025 10:43:41 +0800 Subject: [PATCH] =?UTF-8?q?:tada:=204.4.1.RELEASE=20=E4=BF=AE=E5=A4=8Dmyba?= =?UTF-8?q?tis-plus=E8=87=AA=E5=AE=9A=E4=B9=89=E6=97=A5=E5=BF=97=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- .../core/mp/config/MybatisPlusConfiguration.java | 14 ++++++++------ .../SqlLogInterceptor.java} | 4 ++-- pom.xml | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) rename blade-starter-mybatis/src/main/java/org/springblade/core/mp/{logger/SqlLogFilter.java => plugins/SqlLogInterceptor.java} (97%) diff --git a/README.md b/README.md index 2b43e55..dc88793 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- Downloads + Downloads Build Status Build Status Coverage Status diff --git a/blade-starter-mybatis/src/main/java/org/springblade/core/mp/config/MybatisPlusConfiguration.java b/blade-starter-mybatis/src/main/java/org/springblade/core/mp/config/MybatisPlusConfiguration.java index f208bd1..ca3776c 100644 --- a/blade-starter-mybatis/src/main/java/org/springblade/core/mp/config/MybatisPlusConfiguration.java +++ b/blade-starter-mybatis/src/main/java/org/springblade/core/mp/config/MybatisPlusConfiguration.java @@ -27,7 +27,7 @@ import org.apache.ibatis.logging.Log; import org.apache.ibatis.logging.nologging.NoLoggingImpl; import org.mybatis.spring.annotation.MapperScan; import org.springblade.core.mp.intercept.QueryInterceptor; -import org.springblade.core.mp.logger.SqlLogFilter; +import org.springblade.core.mp.plugins.SqlLogInterceptor; import org.springblade.core.mp.plugins.BladePaginationInterceptor; import org.springblade.core.mp.props.MybatisPlusProperties; import org.springblade.core.secure.utils.SecureUtil; @@ -105,8 +105,8 @@ public class MybatisPlusConfiguration { */ @Bean @ConditionalOnProperty(value = "blade.mybatis-plus.sql-log", matchIfMissing = true) - public SqlLogFilter sqlLogFilter(MybatisPlusProperties properties) { - return new SqlLogFilter(properties); + public SqlLogInterceptor sqlLogInterceptor(MybatisPlusProperties properties) { + return new SqlLogInterceptor(properties); } /** @@ -117,9 +117,11 @@ public class MybatisPlusConfiguration { public MybatisPlusPropertiesCustomizer mybatisPlusPropertiesCustomizer() { return properties -> { CoreConfiguration configuration = properties.getConfiguration(); - Class logImpl = configuration.getLogImpl(); - if (logImpl == null) { - configuration.setLogImpl(NoLoggingImpl.class); + if (configuration != null) { + Class logImpl = configuration.getLogImpl(); + if (logImpl == null) { + configuration.setLogImpl(NoLoggingImpl.class); + } } }; } diff --git a/blade-starter-mybatis/src/main/java/org/springblade/core/mp/logger/SqlLogFilter.java b/blade-starter-mybatis/src/main/java/org/springblade/core/mp/plugins/SqlLogInterceptor.java similarity index 97% rename from blade-starter-mybatis/src/main/java/org/springblade/core/mp/logger/SqlLogFilter.java rename to blade-starter-mybatis/src/main/java/org/springblade/core/mp/plugins/SqlLogInterceptor.java index 323b44f..342cbd7 100644 --- a/blade-starter-mybatis/src/main/java/org/springblade/core/mp/logger/SqlLogFilter.java +++ b/blade-starter-mybatis/src/main/java/org/springblade/core/mp/plugins/SqlLogInterceptor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springblade.core.mp.logger; +package org.springblade.core.mp.plugins; import com.alibaba.druid.DbType; import com.alibaba.druid.filter.FilterChain; @@ -45,7 +45,7 @@ import java.util.List; */ @Slf4j @RequiredArgsConstructor -public class SqlLogFilter extends FilterEventAdapter { +public class SqlLogInterceptor extends FilterEventAdapter { private static final SQLUtils.FormatOption FORMAT_OPTION = new SQLUtils.FormatOption(false, false); private final MybatisPlusProperties properties; diff --git a/pom.xml b/pom.xml index dd60812..2f25c56 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ - 4.4.0 + 4.4.1 org.springblade.blade.tool 17