refactor: 使用常量优化部分配置属性名

This commit is contained in:
2024-01-02 22:14:00 +08:00
parent 1f3687df6f
commit 20250681da
15 changed files with 109 additions and 15 deletions

View File

@@ -26,6 +26,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
import top.charles7c.continew.starter.core.constant.StringConstants;
import java.util.Map;
@@ -42,7 +43,7 @@ import java.util.Map;
@AutoConfiguration
@RequiredArgsConstructor
@EnableConfigurationProperties(LocalStorageProperties.class)
@ConditionalOnProperty(name = "continew-starter.storage.local.enabled", havingValue = "true")
@ConditionalOnProperty(prefix = PropertiesConstants.STORAGE_LOCAL, name = PropertiesConstants.ENABLED, havingValue = "true")
public class LocalStorageAutoConfiguration implements WebMvcConfigurer {
private final LocalStorageProperties properties;

View File

@@ -19,6 +19,7 @@ package top.charles7c.continew.starter.storage.local.autoconfigure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.unit.DataSize;
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
import java.util.HashMap;
import java.util.Map;
@@ -30,7 +31,7 @@ import java.util.Map;
* @since 1.1.0
*/
@Data
@ConfigurationProperties(prefix = "continew-starter.storage.local")
@ConfigurationProperties(PropertiesConstants.STORAGE_LOCAL)
public class LocalStorageProperties {
/**