From 0cede6bf9fc89e0c5009e9721b5cea2cf73b890c Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 11 Sep 2024 21:22:19 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=AE=8C=E5=96=84=20ConditionalOnProp?= =?UTF-8?q?erty=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../justauth/autoconfigure/JustAuthAutoConfiguration.java | 2 +- .../redisson/autoconfigure/RedissonAutoConfiguration.java | 2 +- .../autoconfigure/BehaviorCaptchaAutoConfiguration.java | 2 +- .../autoconfigure/GraphicCaptchaAutoConfiguration.java | 2 +- .../core/autoconfigure/threadpool/AsyncAutoConfiguration.java | 2 +- .../autoconfigure/threadpool/ThreadPoolAutoConfiguration.java | 4 ++-- .../interceptor/autoconfigure/ConditionalOnEnabledLog.java | 2 +- .../websocket/autoconfigure/WebSocketAutoConfiguration.java | 2 +- .../crypto/autoconfigure/CryptoAutoConfiguration.java | 2 +- .../limiter/autoconfigure/RateLimiterAutoConfiguration.java | 2 +- .../autoconfigure/PasswordEncoderAutoConfiguration.java | 2 +- .../local/autoconfigure/LocalStorageAutoConfiguration.java | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/continew-starter-auth/continew-starter-auth-justauth/src/main/java/top/continew/starter/auth/justauth/autoconfigure/JustAuthAutoConfiguration.java b/continew-starter-auth/continew-starter-auth-justauth/src/main/java/top/continew/starter/auth/justauth/autoconfigure/JustAuthAutoConfiguration.java index 04ddf127..24101077 100644 --- a/continew-starter-auth/continew-starter-auth-justauth/src/main/java/top/continew/starter/auth/justauth/autoconfigure/JustAuthAutoConfiguration.java +++ b/continew-starter-auth/continew-starter-auth-justauth/src/main/java/top/continew/starter/auth/justauth/autoconfigure/JustAuthAutoConfiguration.java @@ -35,7 +35,7 @@ import top.continew.starter.core.constant.PropertiesConstants; * @since 1.0.0 */ @AutoConfiguration(before = com.xkcoding.justauth.autoconfigure.JustAuthAutoConfiguration.class) -@ConditionalOnProperty(prefix = "justauth", name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = "justauth", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class JustAuthAutoConfiguration { private static final Logger log = LoggerFactory.getLogger(JustAuthAutoConfiguration.class); diff --git a/continew-starter-cache/continew-starter-cache-redisson/src/main/java/top/continew/starter/cache/redisson/autoconfigure/RedissonAutoConfiguration.java b/continew-starter-cache/continew-starter-cache-redisson/src/main/java/top/continew/starter/cache/redisson/autoconfigure/RedissonAutoConfiguration.java index 8c1e9d48..4fcc2e98 100644 --- a/continew-starter-cache/continew-starter-cache-redisson/src/main/java/top/continew/starter/cache/redisson/autoconfigure/RedissonAutoConfiguration.java +++ b/continew-starter-cache/continew-starter-cache-redisson/src/main/java/top/continew/starter/cache/redisson/autoconfigure/RedissonAutoConfiguration.java @@ -46,7 +46,7 @@ import java.util.List; * @since 1.0.0 */ @AutoConfiguration -@ConditionalOnProperty(prefix = "spring.data.redisson", name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = "spring.data.redisson", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) @EnableConfigurationProperties(RedissonProperties.class) public class RedissonAutoConfiguration { diff --git a/continew-starter-captcha/continew-starter-captcha-behavior/src/main/java/top/continew/starter/captcha/behavior/autoconfigure/BehaviorCaptchaAutoConfiguration.java b/continew-starter-captcha/continew-starter-captcha-behavior/src/main/java/top/continew/starter/captcha/behavior/autoconfigure/BehaviorCaptchaAutoConfiguration.java index b6cc1c98..843acc1f 100644 --- a/continew-starter-captcha/continew-starter-captcha-behavior/src/main/java/top/continew/starter/captcha/behavior/autoconfigure/BehaviorCaptchaAutoConfiguration.java +++ b/continew-starter-captcha/continew-starter-captcha-behavior/src/main/java/top/continew/starter/captcha/behavior/autoconfigure/BehaviorCaptchaAutoConfiguration.java @@ -49,7 +49,7 @@ import java.util.Properties; */ @AutoConfiguration @EnableConfigurationProperties(BehaviorCaptchaProperties.class) -@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_BEHAVIOR, name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_BEHAVIOR, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class BehaviorCaptchaAutoConfiguration { private static final Logger log = LoggerFactory.getLogger(BehaviorCaptchaAutoConfiguration.class); diff --git a/continew-starter-captcha/continew-starter-captcha-graphic/src/main/java/top/continew/starter/captcha/graphic/autoconfigure/GraphicCaptchaAutoConfiguration.java b/continew-starter-captcha/continew-starter-captcha-graphic/src/main/java/top/continew/starter/captcha/graphic/autoconfigure/GraphicCaptchaAutoConfiguration.java index dc7e6f43..24ab4e73 100644 --- a/continew-starter-captcha/continew-starter-captcha-graphic/src/main/java/top/continew/starter/captcha/graphic/autoconfigure/GraphicCaptchaAutoConfiguration.java +++ b/continew-starter-captcha/continew-starter-captcha-graphic/src/main/java/top/continew/starter/captcha/graphic/autoconfigure/GraphicCaptchaAutoConfiguration.java @@ -35,7 +35,7 @@ import top.continew.starter.core.constant.PropertiesConstants; */ @AutoConfiguration @EnableConfigurationProperties(GraphicCaptchaProperties.class) -@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_GRAPHIC, name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_GRAPHIC, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class GraphicCaptchaAutoConfiguration { private static final Logger log = LoggerFactory.getLogger(GraphicCaptchaAutoConfiguration.class); diff --git a/continew-starter-core/src/main/java/top/continew/starter/core/autoconfigure/threadpool/AsyncAutoConfiguration.java b/continew-starter-core/src/main/java/top/continew/starter/core/autoconfigure/threadpool/AsyncAutoConfiguration.java index 2e1d69b9..6265eeac 100644 --- a/continew-starter-core/src/main/java/top/continew/starter/core/autoconfigure/threadpool/AsyncAutoConfiguration.java +++ b/continew-starter-core/src/main/java/top/continew/starter/core/autoconfigure/threadpool/AsyncAutoConfiguration.java @@ -42,7 +42,7 @@ import java.util.concurrent.Executor; @Lazy @AutoConfiguration @EnableAsync(proxyTargetClass = true) -@ConditionalOnProperty(prefix = "spring.task.execution.extension", name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = "spring.task.execution.extension", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class AsyncAutoConfiguration implements AsyncConfigurer { private static final Logger log = LoggerFactory.getLogger(AsyncAutoConfiguration.class); diff --git a/continew-starter-core/src/main/java/top/continew/starter/core/autoconfigure/threadpool/ThreadPoolAutoConfiguration.java b/continew-starter-core/src/main/java/top/continew/starter/core/autoconfigure/threadpool/ThreadPoolAutoConfiguration.java index 3bfa60b9..06aa3e8d 100644 --- a/continew-starter-core/src/main/java/top/continew/starter/core/autoconfigure/threadpool/ThreadPoolAutoConfiguration.java +++ b/continew-starter-core/src/main/java/top/continew/starter/core/autoconfigure/threadpool/ThreadPoolAutoConfiguration.java @@ -52,7 +52,7 @@ public class ThreadPoolAutoConfiguration { * 异步任务线程池配置 */ @Bean - @ConditionalOnProperty(prefix = "spring.task.execution.extension", name = PropertiesConstants.ENABLED, matchIfMissing = true) + @ConditionalOnProperty(prefix = "spring.task.execution.extension", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public ThreadPoolTaskExecutorCustomizer threadPoolTaskExecutorCustomizer(ThreadPoolExtensionProperties properties) { return executor -> { // 核心(最小)线程数 @@ -71,7 +71,7 @@ public class ThreadPoolAutoConfiguration { * 定时任务线程池配置 */ @EnableScheduling - @ConditionalOnProperty(prefix = "spring.task.scheduling.extension", name = PropertiesConstants.ENABLED, matchIfMissing = true) + @ConditionalOnProperty(prefix = "spring.task.scheduling.extension", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public static class TaskSchedulerConfiguration { @Bean public ThreadPoolTaskSchedulerCustomizer threadPoolTaskSchedulerCustomizer(ThreadPoolExtensionProperties properties) { diff --git a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/autoconfigure/ConditionalOnEnabledLog.java b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/autoconfigure/ConditionalOnEnabledLog.java index ea8a9873..69e738c6 100644 --- a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/autoconfigure/ConditionalOnEnabledLog.java +++ b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/autoconfigure/ConditionalOnEnabledLog.java @@ -30,6 +30,6 @@ import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD}) @Documented -@ConditionalOnProperty(prefix = PropertiesConstants.LOG, name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.LOG, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public @interface ConditionalOnEnabledLog { } \ No newline at end of file diff --git a/continew-starter-messaging/continew-starter-messaging-websocket/src/main/java/top/continew/starter/messaging/websocket/autoconfigure/WebSocketAutoConfiguration.java b/continew-starter-messaging/continew-starter-messaging-websocket/src/main/java/top/continew/starter/messaging/websocket/autoconfigure/WebSocketAutoConfiguration.java index 6c45d550..716321a2 100644 --- a/continew-starter-messaging/continew-starter-messaging-websocket/src/main/java/top/continew/starter/messaging/websocket/autoconfigure/WebSocketAutoConfiguration.java +++ b/continew-starter-messaging/continew-starter-messaging-websocket/src/main/java/top/continew/starter/messaging/websocket/autoconfigure/WebSocketAutoConfiguration.java @@ -46,7 +46,7 @@ import top.continew.starter.messaging.websocket.dao.WebSocketSessionDaoDefaultIm @AutoConfiguration @EnableWebSocket @EnableConfigurationProperties(WebSocketProperties.class) -@ConditionalOnProperty(prefix = PropertiesConstants.MESSAGING_WEBSOCKET, name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.MESSAGING_WEBSOCKET, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class WebSocketAutoConfiguration { private static final Logger log = LoggerFactory.getLogger(WebSocketAutoConfiguration.class); diff --git a/continew-starter-security/continew-starter-security-crypto/src/main/java/top/continew/starter/security/crypto/autoconfigure/CryptoAutoConfiguration.java b/continew-starter-security/continew-starter-security-crypto/src/main/java/top/continew/starter/security/crypto/autoconfigure/CryptoAutoConfiguration.java index 66d3f47c..82d3d6f0 100644 --- a/continew-starter-security/continew-starter-security-crypto/src/main/java/top/continew/starter/security/crypto/autoconfigure/CryptoAutoConfiguration.java +++ b/continew-starter-security/continew-starter-security-crypto/src/main/java/top/continew/starter/security/crypto/autoconfigure/CryptoAutoConfiguration.java @@ -36,7 +36,7 @@ import top.continew.starter.security.crypto.core.MyBatisEncryptInterceptor; */ @AutoConfiguration @EnableConfigurationProperties(CryptoProperties.class) -@ConditionalOnProperty(prefix = PropertiesConstants.SECURITY_CRYPTO, name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.SECURITY_CRYPTO, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class CryptoAutoConfiguration { private static final Logger log = LoggerFactory.getLogger(CryptoAutoConfiguration.class); diff --git a/continew-starter-security/continew-starter-security-limiter/src/main/java/top/continew/starter/security/limiter/autoconfigure/RateLimiterAutoConfiguration.java b/continew-starter-security/continew-starter-security-limiter/src/main/java/top/continew/starter/security/limiter/autoconfigure/RateLimiterAutoConfiguration.java index 87104ca9..27fb1de8 100644 --- a/continew-starter-security/continew-starter-security-limiter/src/main/java/top/continew/starter/security/limiter/autoconfigure/RateLimiterAutoConfiguration.java +++ b/continew-starter-security/continew-starter-security-limiter/src/main/java/top/continew/starter/security/limiter/autoconfigure/RateLimiterAutoConfiguration.java @@ -39,7 +39,7 @@ import top.continew.starter.security.limiter.core.RateLimiterNameGenerator; @AutoConfiguration @EnableConfigurationProperties(RateLimiterProperties.class) @ComponentScan({"top.continew.starter.security.limiter.core"}) -@ConditionalOnProperty(prefix = PropertiesConstants.SECURITY_LIMITER, name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.SECURITY_LIMITER, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class RateLimiterAutoConfiguration { private static final Logger log = LoggerFactory.getLogger(RateLimiterAutoConfiguration.class); diff --git a/continew-starter-security/continew-starter-security-password/src/main/java/top/continew/starter/security/password/autoconfigure/PasswordEncoderAutoConfiguration.java b/continew-starter-security/continew-starter-security-password/src/main/java/top/continew/starter/security/password/autoconfigure/PasswordEncoderAutoConfiguration.java index e12e0546..02d2a169 100644 --- a/continew-starter-security/continew-starter-security-password/src/main/java/top/continew/starter/security/password/autoconfigure/PasswordEncoderAutoConfiguration.java +++ b/continew-starter-security/continew-starter-security-password/src/main/java/top/continew/starter/security/password/autoconfigure/PasswordEncoderAutoConfiguration.java @@ -53,7 +53,7 @@ import java.util.Map; */ @AutoConfiguration @EnableConfigurationProperties(PasswordEncoderProperties.class) -@ConditionalOnProperty(prefix = PropertiesConstants.SECURITY_PASSWORD, name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.SECURITY_PASSWORD, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class PasswordEncoderAutoConfiguration { private static final Logger log = LoggerFactory.getLogger(PasswordEncoderAutoConfiguration.class); diff --git a/continew-starter-storage/continew-starter-storage-local/src/main/java/top/continew/starter/storage/local/autoconfigure/LocalStorageAutoConfiguration.java b/continew-starter-storage/continew-starter-storage-local/src/main/java/top/continew/starter/storage/local/autoconfigure/LocalStorageAutoConfiguration.java index 1ab16d45..38f8f66d 100644 --- a/continew-starter-storage/continew-starter-storage-local/src/main/java/top/continew/starter/storage/local/autoconfigure/LocalStorageAutoConfiguration.java +++ b/continew-starter-storage/continew-starter-storage-local/src/main/java/top/continew/starter/storage/local/autoconfigure/LocalStorageAutoConfiguration.java @@ -40,7 +40,7 @@ import java.util.Map; @EnableWebMvc @AutoConfiguration @EnableConfigurationProperties(LocalStorageProperties.class) -@ConditionalOnProperty(prefix = PropertiesConstants.STORAGE_LOCAL, name = PropertiesConstants.ENABLED, matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.STORAGE_LOCAL, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class LocalStorageAutoConfiguration implements WebMvcConfigurer { private static final Logger log = LoggerFactory.getLogger(LocalStorageAutoConfiguration.class);