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