mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 08:57:17 +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 org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import top.continew.starter.core.constant.PropertiesConstants;
|
||||
|
||||
/**
|
||||
* API 文档扩展配置属性
|
||||
@@ -27,7 +26,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Charles7c
|
||||
* @since 1.0.1
|
||||
*/
|
||||
@ConfigurationProperties(prefix = PropertiesConstants.SPRINGDOC)
|
||||
@ConfigurationProperties("springdoc")
|
||||
public class SpringDocExtensionProperties {
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,7 @@ import top.continew.starter.auth.satoken.autoconfigure.dao.SaTokenDaoProperties;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "sa-token.extension")
|
||||
@ConfigurationProperties("sa-token.extension")
|
||||
public class SaTokenExtensionProperties {
|
||||
|
||||
/**
|
||||
|
@@ -24,7 +24,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "project")
|
||||
@ConfigurationProperties("project")
|
||||
public class ProjectProperties {
|
||||
|
||||
/**
|
||||
|
@@ -24,7 +24,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "spring.task")
|
||||
@ConfigurationProperties("spring.task")
|
||||
public class ThreadPoolExtensionProperties {
|
||||
|
||||
/**
|
||||
|
@@ -34,16 +34,6 @@ public class PropertiesConstants {
|
||||
*/
|
||||
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 配置
|
||||
@@ -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 配置
|
||||
*/
|
||||
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 I18N = WEB + StringConstants.DOT + "i18n";
|
||||
|
||||
private PropertiesConstants() {
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "mybatis-flex.extension")
|
||||
@ConfigurationProperties("mybatis-flex.extension")
|
||||
public class MyBatisFlexExtensionProperties {
|
||||
|
||||
/**
|
||||
|
@@ -27,7 +27,7 @@ import top.continew.starter.data.mybatis.plus.autoconfigure.idgenerator.MyBatisP
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "mybatis-plus.extension")
|
||||
@ConfigurationProperties("mybatis-plus.extension")
|
||||
public class MyBatisPlusExtensionProperties {
|
||||
|
||||
/**
|
||||
|
@@ -36,7 +36,7 @@ import top.continew.starter.security.crypto.core.MyBatisEncryptInterceptor;
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@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 {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(CryptoAutoConfiguration.class);
|
||||
|
@@ -25,7 +25,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Charles7c
|
||||
* @since 1.4.0
|
||||
*/
|
||||
@ConfigurationProperties(PropertiesConstants.CRYPTO)
|
||||
@ConfigurationProperties(PropertiesConstants.SECURITY_CRYPTO)
|
||||
public class CryptoProperties {
|
||||
|
||||
/**
|
||||
|
@@ -65,7 +65,7 @@ public abstract class AbstractMyBatisInterceptor implements Interceptor {
|
||||
*/
|
||||
public Map<String, FieldEncrypt> getEncryptParams(String mappedStatementId, Integer parameterIndex) {
|
||||
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
|
||||
@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 {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PasswordEncoderAutoConfiguration.class);
|
||||
|
@@ -25,7 +25,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Jasmine
|
||||
* @since 1.3.0
|
||||
*/
|
||||
@ConfigurationProperties(PropertiesConstants.PASSWORD)
|
||||
@ConfigurationProperties(PropertiesConstants.SECURITY_PASSWORD)
|
||||
public class PasswordEncoderProperties {
|
||||
|
||||
/**
|
||||
|
@@ -40,7 +40,7 @@ import top.continew.starter.core.constant.StringConstants;
|
||||
@Lazy
|
||||
@AutoConfiguration
|
||||
@ConditionalOnWebApplication
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.CORS, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.WEB_CORS, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@EnableConfigurationProperties(CorsProperties.class)
|
||||
public class CorsAutoConfiguration {
|
||||
private static final Logger log = LoggerFactory.getLogger(CorsAutoConfiguration.class);
|
||||
|
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties(PropertiesConstants.CORS)
|
||||
@ConfigurationProperties(PropertiesConstants.WEB_CORS)
|
||||
public class CorsProperties {
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 国际化 配置属性
|
||||
* 国际化配置属性
|
||||
*
|
||||
* @author Jasmine
|
||||
* @since 2.2.0
|
||||
*/
|
||||
@ConfigurationProperties(prefix = PropertiesConstants.I18N)
|
||||
@ConfigurationProperties(PropertiesConstants.WEB_I18N)
|
||||
public class I18nProperties {
|
||||
|
||||
/**
|
||||
|
@@ -43,7 +43,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
||||
@AutoConfiguration
|
||||
@ConditionalOnWebApplication
|
||||
@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 {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TraceAutoConfiguration.class);
|
||||
|
@@ -26,7 +26,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Charles7c
|
||||
* @since 1.3.0
|
||||
*/
|
||||
@ConfigurationProperties(PropertiesConstants.TRACE)
|
||||
@ConfigurationProperties(PropertiesConstants.WEB_TRACE)
|
||||
public class TraceProperties {
|
||||
|
||||
/**
|
||||
|
@@ -33,7 +33,7 @@ import top.continew.starter.core.constant.PropertiesConstants;
|
||||
@AutoConfiguration
|
||||
@ConditionalOnWebApplication
|
||||
@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 {
|
||||
|
||||
/**
|
||||
|
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
* @author whhya
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@ConfigurationProperties(PropertiesConstants.XSS)
|
||||
@ConfigurationProperties(PropertiesConstants.WEB_XSS)
|
||||
public class XssProperties {
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user