mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
chore: 优化部分代码
This commit is contained in:
@@ -54,7 +54,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*/
|
||||
@EnableWebMvc
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.SPRINGDOC_SWAGGER_UI, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.SPRINGDOC_SWAGGER_UI, name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
@EnableConfigurationProperties(SpringDocExtensionProperties.class)
|
||||
@PropertySource(value = "classpath:default-api-doc.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class SpringDocAutoConfiguration implements WebMvcConfigurer {
|
||||
|
@@ -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, havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(prefix = "justauth", name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
public class JustAuthAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(JustAuthAutoConfiguration.class);
|
||||
|
@@ -46,7 +46,7 @@ import java.util.List;
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(prefix = "spring.data.redisson", name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@ConditionalOnProperty(prefix = "spring.data.redisson", name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
@EnableConfigurationProperties(RedissonProperties.class)
|
||||
public class RedissonAutoConfiguration {
|
||||
|
||||
|
@@ -34,7 +34,7 @@ public class RedissonProperties {
|
||||
/**
|
||||
* 是否启用 Redisson
|
||||
*/
|
||||
private boolean enabled = false;
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* Redis 模式
|
||||
|
@@ -35,7 +35,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(GraphicCaptchaProperties.class)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_GRAPHIC, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_GRAPHIC, name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
public class GraphicCaptchaAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GraphicCaptchaAutoConfiguration.class);
|
||||
|
@@ -30,6 +30,6 @@ import java.lang.annotation.*;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||
@Documented
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.LOG, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.LOG, name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
public @interface ConditionalOnEnabledLog {
|
||||
}
|
@@ -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, havingValue = "true")
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.MESSAGING_WEBSOCKET, name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
public class WebSocketAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(WebSocketAutoConfiguration.class);
|
||||
|
@@ -39,7 +39,7 @@ public class WebSocketProperties {
|
||||
/**
|
||||
* 是否启用 WebSocket
|
||||
*/
|
||||
private boolean enabled = false;
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
|
@@ -16,8 +16,6 @@
|
||||
|
||||
package top.continew.starter.messaging.websocket.core;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.server.ServerHttpRequest;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.http.server.ServletServerHttpRequest;
|
||||
@@ -37,7 +35,6 @@ import java.util.Map;
|
||||
*/
|
||||
public class WebSocketInterceptor extends HttpSessionHandshakeInterceptor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(WebSocketInterceptor.class);
|
||||
private final WebSocketProperties webSocketProperties;
|
||||
private final CurrentUserProvider currentUserProvider;
|
||||
|
||||
|
@@ -36,7 +36,7 @@ import top.continew.starter.security.crypto.core.MyBatisEncryptInterceptor;
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(CryptoProperties.class)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.CRYPTO, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.CRYPTO, name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
public class CryptoAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(CryptoAutoConfiguration.class);
|
||||
|
@@ -53,7 +53,7 @@ import java.util.Map;
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(PasswordEncoderProperties.class)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.PASSWORD, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.PASSWORD, name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
public class PasswordEncoderAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PasswordEncoderAutoConfiguration.class);
|
||||
|
@@ -31,7 +31,7 @@ public class PasswordEncoderProperties {
|
||||
/**
|
||||
* 是否启用密码编解码配置
|
||||
*/
|
||||
private boolean enabled = false;
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* 默认启用的编码器 ID(默认:BCryptPasswordEncoder)
|
||||
|
@@ -40,7 +40,7 @@ import java.util.Map;
|
||||
@EnableWebMvc
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(LocalStorageProperties.class)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.STORAGE_LOCAL, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.STORAGE_LOCAL, name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
public class LocalStorageAutoConfiguration implements WebMvcConfigurer {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LocalStorageAutoConfiguration.class);
|
||||
|
@@ -35,7 +35,7 @@ public class LocalStorageProperties {
|
||||
/**
|
||||
* 是否启用本地存储
|
||||
*/
|
||||
private boolean enabled = false;
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* 存储映射
|
||||
|
Reference in New Issue
Block a user