swagger 开关
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.sqx.config;
|
package com.sqx.config;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
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.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
@@ -21,9 +22,13 @@ import static com.google.common.collect.Lists.newArrayList;
|
|||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
public class SwaggerConfig implements WebMvcConfigurer {
|
public class SwaggerConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Value("${swagger.enabled}")
|
||||||
|
private boolean enabled;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Docket createRestApi() {
|
public Docket createRestApi() {
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.enable(enabled)
|
||||||
.apiInfo(apiInfo())
|
.apiInfo(apiInfo())
|
||||||
.select()
|
.select()
|
||||||
//加了ApiOperation注解的类,才生成接口文档
|
//加了ApiOperation注解的类,才生成接口文档
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ spring:
|
|||||||
config:
|
config:
|
||||||
multi-statement-allow: true
|
multi-statement-allow: true
|
||||||
|
|
||||||
|
swagger:
|
||||||
|
enabled: true
|
||||||
pay:
|
pay:
|
||||||
h5BaseUrl: https://video-h5.hnsiyao.cn/me/detail/detail?allId=
|
h5BaseUrl: https://video-h5.hnsiyao.cn/me/detail/detail?allId=
|
||||||
orderNotifyUrl: https://video.hnsiyao.cn/sqx_fast/app/wuyou/notify
|
orderNotifyUrl: https://video.hnsiyao.cn/sqx_fast/app/wuyou/notify
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ spring:
|
|||||||
wall:
|
wall:
|
||||||
config:
|
config:
|
||||||
multi-statement-allow: true
|
multi-statement-allow: true
|
||||||
|
swagger:
|
||||||
|
enabled: false
|
||||||
pay:
|
pay:
|
||||||
h5BaseUrl: https://dj-h5.hnsiyao.cn/me/detail/detail?allId=
|
h5BaseUrl: https://dj-h5.hnsiyao.cn/me/detail/detail?allId=
|
||||||
orderNotifyUrl: https://dj-api.hnsiyao.cn/sqx_fast/app/wuyou/notify
|
orderNotifyUrl: https://dj-api.hnsiyao.cn/sqx_fast/app/wuyou/notify
|
||||||
|
|||||||
Reference in New Issue
Block a user