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