mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
refactor: 优化部分代码
1.修复 Sonar 扫描问题 2.使用常量替代部分魔法值
This commit is contained in:
@@ -38,6 +38,7 @@ 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.autoconfigure.project.ProjectProperties;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
import top.charles7c.continew.starter.core.util.GeneralPropertySourceFactory;
|
||||
|
||||
import java.util.List;
|
||||
@@ -53,7 +54,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Slf4j
|
||||
@EnableWebMvc
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(name = "springdoc.swagger-ui.enabled", havingValue = "true")
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.SPRINGDOC_SWAGGER_UI, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@EnableConfigurationProperties(SpringDocExtensionProperties.class)
|
||||
@PropertySource(value = "classpath:default-api-doc.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class SpringDocAutoConfiguration implements WebMvcConfigurer {
|
||||
|
@@ -20,6 +20,7 @@ import io.swagger.v3.oas.models.Components;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
|
||||
/**
|
||||
* API 文档扩展配置属性
|
||||
@@ -28,7 +29,7 @@ import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
* @since 1.0.1
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "springdoc")
|
||||
@ConfigurationProperties(prefix = PropertiesConstants.SPRINGDOC)
|
||||
public class SpringDocExtensionProperties {
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user