mirror of
https://github.com/201206030/novel-cloud.git
synced 2025-04-27 01:40:50 +00:00
配置swagger仅在dev环境下有效
This commit is contained in:
parent
45b4ce7b18
commit
b143b7c634
@ -2,6 +2,7 @@ package com.java2nb.novel.common.config;
|
|||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
import springfox.documentation.builders.ApiInfoBuilder;
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
import springfox.documentation.builders.ParameterBuilder;
|
import springfox.documentation.builders.ParameterBuilder;
|
||||||
import springfox.documentation.builders.PathSelectors;
|
import springfox.documentation.builders.PathSelectors;
|
||||||
@ -20,13 +21,14 @@ import static com.google.common.collect.Lists.newArrayList;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger2API文档的配置
|
* Swagger2API文档的配置
|
||||||
*
|
* 仅仅在dev环境下该配置才生效
|
||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2020/5/27
|
* @since 2020/5/27
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
|
@Profile("dev")
|
||||||
public class Swagger2Config {
|
public class Swagger2Config {
|
||||||
@Bean
|
@Bean
|
||||||
public Docket createRestApi() {
|
public Docket createRestApi() {
|
||||||
|
9
novel-common/src/main/resources/bootstrap-prod.yml
Normal file
9
novel-common/src/main/resources/bootstrap-prod.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
config:
|
||||||
|
server-addr: 47.106.243.172:8848
|
||||||
|
file-extension: yml
|
||||||
|
group: ${spring.application.name}
|
||||||
|
namespace: 96daa244-1a43-438a-a2cd-15e543dab50e
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user