mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 20:57:23 +08:00
chore: 优化属性前缀命名
This commit is contained in:
@@ -19,7 +19,6 @@ package top.continew.starter.apidoc.autoconfigure;
|
|||||||
import io.swagger.v3.oas.models.Components;
|
import io.swagger.v3.oas.models.Components;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||||
import top.continew.starter.core.constant.PropertiesConstants;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API 文档扩展配置属性
|
* API 文档扩展配置属性
|
||||||
@@ -27,7 +26,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
|||||||
* @author Charles7c
|
* @author Charles7c
|
||||||
* @since 1.0.1
|
* @since 1.0.1
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = PropertiesConstants.SPRINGDOC)
|
@ConfigurationProperties("springdoc")
|
||||||
public class SpringDocExtensionProperties {
|
public class SpringDocExtensionProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -26,7 +26,7 @@ import top.continew.starter.auth.satoken.autoconfigure.dao.SaTokenDaoProperties;
|
|||||||
* @author Charles7c
|
* @author Charles7c
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = "sa-token.extension")
|
@ConfigurationProperties("sa-token.extension")
|
||||||
public class SaTokenExtensionProperties {
|
public class SaTokenExtensionProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -24,7 +24,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
* @author Charles7c
|
* @author Charles7c
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = "project")
|
@ConfigurationProperties("project")
|
||||||
public class ProjectProperties {
|
public class ProjectProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -24,7 +24,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
* @author Charles7c
|
* @author Charles7c
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = "spring.task")
|
@ConfigurationProperties("spring.task")
|
||||||
public class ThreadPoolExtensionProperties {
|
public class ThreadPoolExtensionProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -34,16 +34,6 @@ public class PropertiesConstants {
|
|||||||
*/
|
*/
|
||||||
public static final String ENABLED = "enabled";
|
public static final String ENABLED = "enabled";
|
||||||
|
|
||||||
/**
|
|
||||||
* Spring Doc 配置
|
|
||||||
*/
|
|
||||||
public static final String SPRINGDOC = "springdoc";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Spring Doc Swagger UI 配置
|
|
||||||
*/
|
|
||||||
public static final String SPRINGDOC_SWAGGER_UI = SPRINGDOC + StringConstants.DOT + "swagger-ui";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安全配置
|
* 安全配置
|
||||||
*/
|
*/
|
||||||
@@ -52,12 +42,17 @@ public class PropertiesConstants {
|
|||||||
/**
|
/**
|
||||||
* 密码编解码配置
|
* 密码编解码配置
|
||||||
*/
|
*/
|
||||||
public static final String PASSWORD = SECURITY + StringConstants.DOT + "password";
|
public static final String SECURITY_PASSWORD = SECURITY + StringConstants.DOT + "password";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加/解密配置
|
* 加/解密配置
|
||||||
*/
|
*/
|
||||||
public static final String CRYPTO = SECURITY + StringConstants.DOT + "crypto";
|
public static final String SECURITY_CRYPTO = SECURITY + StringConstants.DOT + "crypto";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 限流器配置
|
||||||
|
*/
|
||||||
|
public static final String SECURITY_LIMITER = SECURITY + StringConstants.DOT + "limiter";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Web 配置
|
* Web 配置
|
||||||
@@ -67,17 +62,22 @@ public class PropertiesConstants {
|
|||||||
/**
|
/**
|
||||||
* 跨域配置
|
* 跨域配置
|
||||||
*/
|
*/
|
||||||
public static final String CORS = WEB + StringConstants.DOT + "cors";
|
public static final String WEB_CORS = WEB + StringConstants.DOT + "cors";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 链路配置
|
* 链路配置
|
||||||
*/
|
*/
|
||||||
public static final String TRACE = WEB + StringConstants.DOT + "trace";
|
public static final String WEB_TRACE = WEB + StringConstants.DOT + "trace";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XSS 配置
|
* XSS 配置
|
||||||
*/
|
*/
|
||||||
public static final String XSS = WEB + StringConstants.DOT + "xss";
|
public static final String WEB_XSS = WEB + StringConstants.DOT + "xss";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化配置
|
||||||
|
*/
|
||||||
|
public static final String WEB_I18N = WEB + StringConstants.DOT + "i18n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日志配置
|
* 日志配置
|
||||||
@@ -119,11 +119,6 @@ public class PropertiesConstants {
|
|||||||
*/
|
*/
|
||||||
public static final String MESSAGING_WEBSOCKET = MESSAGING + StringConstants.DOT + "websocket";
|
public static final String MESSAGING_WEBSOCKET = MESSAGING + StringConstants.DOT + "websocket";
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际化配置
|
|
||||||
*/
|
|
||||||
public static final String I18N = WEB + StringConstants.DOT + "i18n";
|
|
||||||
|
|
||||||
private PropertiesConstants() {
|
private PropertiesConstants() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
* @author Charles7c
|
* @author Charles7c
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = "mybatis-flex.extension")
|
@ConfigurationProperties("mybatis-flex.extension")
|
||||||
public class MyBatisFlexExtensionProperties {
|
public class MyBatisFlexExtensionProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -27,7 +27,7 @@ import top.continew.starter.data.mybatis.plus.autoconfigure.idgenerator.MyBatisP
|
|||||||
* @author Charles7c
|
* @author Charles7c
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = "mybatis-plus.extension")
|
@ConfigurationProperties("mybatis-plus.extension")
|
||||||
public class MyBatisPlusExtensionProperties {
|
public class MyBatisPlusExtensionProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -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, matchIfMissing = true)
|
@ConditionalOnProperty(prefix = PropertiesConstants.SECURITY_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);
|
||||||
|
@@ -25,7 +25,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
|||||||
* @author Charles7c
|
* @author Charles7c
|
||||||
* @since 1.4.0
|
* @since 1.4.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(PropertiesConstants.CRYPTO)
|
@ConfigurationProperties(PropertiesConstants.SECURITY_CRYPTO)
|
||||||
public class CryptoProperties {
|
public class CryptoProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -65,7 +65,7 @@ public abstract class AbstractMyBatisInterceptor implements Interceptor {
|
|||||||
*/
|
*/
|
||||||
public Map<String, FieldEncrypt> getEncryptParams(String mappedStatementId, Integer parameterIndex) {
|
public Map<String, FieldEncrypt> getEncryptParams(String mappedStatementId, Integer parameterIndex) {
|
||||||
return ENCRYPT_PARAM_CACHE
|
return ENCRYPT_PARAM_CACHE
|
||||||
.computeIfAbsent(mappedStatementId, m -> getEncryptParamsNoCached(mappedStatementId, parameterIndex));
|
.computeIfAbsent(mappedStatementId, key -> getEncryptParamsNoCached(mappedStatementId, parameterIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -53,7 +53,7 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@EnableConfigurationProperties(PasswordEncoderProperties.class)
|
@EnableConfigurationProperties(PasswordEncoderProperties.class)
|
||||||
@ConditionalOnProperty(prefix = PropertiesConstants.PASSWORD, name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
@ConditionalOnProperty(prefix = PropertiesConstants.SECURITY_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);
|
||||||
|
@@ -25,7 +25,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
|||||||
* @author Jasmine
|
* @author Jasmine
|
||||||
* @since 1.3.0
|
* @since 1.3.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(PropertiesConstants.PASSWORD)
|
@ConfigurationProperties(PropertiesConstants.SECURITY_PASSWORD)
|
||||||
public class PasswordEncoderProperties {
|
public class PasswordEncoderProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -40,7 +40,7 @@ import top.continew.starter.core.constant.StringConstants;
|
|||||||
@Lazy
|
@Lazy
|
||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@ConditionalOnWebApplication
|
@ConditionalOnWebApplication
|
||||||
@ConditionalOnProperty(prefix = PropertiesConstants.CORS, name = PropertiesConstants.ENABLED, havingValue = "true")
|
@ConditionalOnProperty(prefix = PropertiesConstants.WEB_CORS, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||||
@EnableConfigurationProperties(CorsProperties.class)
|
@EnableConfigurationProperties(CorsProperties.class)
|
||||||
public class CorsAutoConfiguration {
|
public class CorsAutoConfiguration {
|
||||||
private static final Logger log = LoggerFactory.getLogger(CorsAutoConfiguration.class);
|
private static final Logger log = LoggerFactory.getLogger(CorsAutoConfiguration.class);
|
||||||
|
@@ -30,7 +30,7 @@ import java.util.List;
|
|||||||
* @author Charles7c
|
* @author Charles7c
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(PropertiesConstants.CORS)
|
@ConfigurationProperties(PropertiesConstants.WEB_CORS)
|
||||||
public class CorsProperties {
|
public class CorsProperties {
|
||||||
|
|
||||||
private static final List<String> ALL = Collections.singletonList(StringConstants.ASTERISK);
|
private static final List<String> ALL = Collections.singletonList(StringConstants.ASTERISK);
|
||||||
|
@@ -20,12 +20,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
import top.continew.starter.core.constant.PropertiesConstants;
|
import top.continew.starter.core.constant.PropertiesConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际化 配置属性
|
* 国际化配置属性
|
||||||
*
|
*
|
||||||
* @author Jasmine
|
* @author Jasmine
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = PropertiesConstants.I18N)
|
@ConfigurationProperties(PropertiesConstants.WEB_I18N)
|
||||||
public class I18nProperties {
|
public class I18nProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -43,7 +43,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
|||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@ConditionalOnWebApplication
|
@ConditionalOnWebApplication
|
||||||
@EnableConfigurationProperties(TraceProperties.class)
|
@EnableConfigurationProperties(TraceProperties.class)
|
||||||
@ConditionalOnProperty(prefix = PropertiesConstants.TRACE, name = PropertiesConstants.ENABLED, havingValue = "true")
|
@ConditionalOnProperty(prefix = PropertiesConstants.WEB_TRACE, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||||
public class TraceAutoConfiguration {
|
public class TraceAutoConfiguration {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(TraceAutoConfiguration.class);
|
private static final Logger log = LoggerFactory.getLogger(TraceAutoConfiguration.class);
|
||||||
|
@@ -26,7 +26,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
|||||||
* @author Charles7c
|
* @author Charles7c
|
||||||
* @since 1.3.0
|
* @since 1.3.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(PropertiesConstants.TRACE)
|
@ConfigurationProperties(PropertiesConstants.WEB_TRACE)
|
||||||
public class TraceProperties {
|
public class TraceProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -33,7 +33,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
|||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@ConditionalOnWebApplication
|
@ConditionalOnWebApplication
|
||||||
@EnableConfigurationProperties(XssProperties.class)
|
@EnableConfigurationProperties(XssProperties.class)
|
||||||
@ConditionalOnProperty(prefix = PropertiesConstants.XSS, name = PropertiesConstants.ENABLED, havingValue = "true")
|
@ConditionalOnProperty(prefix = PropertiesConstants.WEB_XSS, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||||
public class XssAutoConfiguration {
|
public class XssAutoConfiguration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -29,7 +29,7 @@ import java.util.List;
|
|||||||
* @author whhya
|
* @author whhya
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(PropertiesConstants.XSS)
|
@ConfigurationProperties(PropertiesConstants.WEB_XSS)
|
||||||
public class XssProperties {
|
public class XssProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user