mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
refactor: 封装公共配置,降低使用复杂度
This commit is contained in:
@@ -26,7 +26,10 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import top.charles7c.continew.starter.core.autoconfigure.ProjectProperties;
|
||||
import top.charles7c.continew.starter.core.handler.GeneralPropertySourceFactory;
|
||||
|
||||
|
||||
/**
|
||||
* API 文档自动配置
|
||||
@@ -37,6 +40,7 @@ import top.charles7c.continew.starter.core.autoconfigure.ProjectProperties;
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(name = "springdoc.swagger-ui.enabled", havingValue = "true")
|
||||
@PropertySource(value = "classpath:default-api-doc.yml", factory = GeneralPropertySourceFactory.class)
|
||||
public class SpringDocAutoConfiguration {
|
||||
|
||||
/**
|
||||
|
@@ -0,0 +1,16 @@
|
||||
--- ### 接口文档配置
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
tags-sorter: alpha
|
||||
operations-sorter: alpha
|
||||
show-extensions: true
|
||||
api-docs:
|
||||
enabled: ${springdoc.swagger-ui.enabled}
|
||||
path: /v3/api-docs
|
||||
## 接口文档增强配置
|
||||
knife4j:
|
||||
enable: true
|
||||
setting:
|
||||
language: zh_cn
|
||||
swagger-model-name: 实体类列表
|
Reference in New Issue
Block a user