mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
perf: 仅在 dev 环境生成接口文档
This commit is contained in:
parent
3dc7ed59a1
commit
87fdd2e6fc
@ -1,13 +1,5 @@
|
|||||||
package io.github.xxyopen.novel;
|
package io.github.xxyopen.novel;
|
||||||
|
|
||||||
import io.github.xxyopen.novel.core.constant.SystemConfigConsts;
|
|
||||||
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
|
||||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
|
|
||||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
|
||||||
import io.swagger.v3.oas.annotations.info.Info;
|
|
||||||
import io.swagger.v3.oas.annotations.info.License;
|
|
||||||
import io.swagger.v3.oas.annotations.security.SecurityScheme;
|
|
||||||
import java.util.Map;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.CommandLineRunner;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
@ -22,8 +14,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
|
|
||||||
@OpenAPIDefinition(info = @Info(title = "novel 项目接口文档", version = "v3.2.0", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0")))
|
import java.util.Map;
|
||||||
@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = SystemConfigConsts.HTTP_AUTH_HEADER_NAME, description = "登录 token")
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@MapperScan("io.github.xxyopen.novel.dao.mapper")
|
@MapperScan("io.github.xxyopen.novel.dao.mapper")
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
package io.github.xxyopen.novel.core.config;
|
||||||
|
|
||||||
|
import io.github.xxyopen.novel.core.constant.SystemConfigConsts;
|
||||||
|
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
||||||
|
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
|
||||||
|
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
||||||
|
import io.swagger.v3.oas.annotations.info.Info;
|
||||||
|
import io.swagger.v3.oas.annotations.info.License;
|
||||||
|
import io.swagger.v3.oas.annotations.security.SecurityScheme;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OpenApi 配置类
|
||||||
|
*
|
||||||
|
* @author xiongxiaoyang
|
||||||
|
* @date 2022/9/1
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@Profile("dev")
|
||||||
|
@OpenAPIDefinition(info = @Info(title = "novel 项目接口文档", version = "v3.2.0", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0")))
|
||||||
|
@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = SystemConfigConsts.HTTP_AUTH_HEADER_NAME, description = "登录 token")
|
||||||
|
public class OpenApiConfig {
|
||||||
|
|
||||||
|
}
|
@ -184,6 +184,11 @@ management:
|
|||||||
# 关闭 elasticsearch 的健康检查
|
# 关闭 elasticsearch 的健康检查
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
--- #--------------------接口文档配置---------------------------
|
||||||
|
springdoc:
|
||||||
|
api-docs:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
--- #---------------------自定义配置----------------------------
|
--- #---------------------自定义配置----------------------------
|
||||||
novel:
|
novel:
|
||||||
# 跨域配置
|
# 跨域配置
|
||||||
@ -214,6 +219,9 @@ spring:
|
|||||||
config:
|
config:
|
||||||
activate:
|
activate:
|
||||||
on-profile: dev
|
on-profile: dev
|
||||||
|
springdoc:
|
||||||
|
api-docs:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
--- #------------------- test 特定配置--------------------------
|
--- #------------------- test 特定配置--------------------------
|
||||||
spring:
|
spring:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user