Commit 58882d32 by 梁家彪

解决swagger不生效

parent b089d7e6
package com.zq.dataoperation.config;
package com.zq.dataoperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
......@@ -13,7 +13,6 @@ import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Profile("dev")
@Configuration
@EnableSwagger2
public class Swagger {
......@@ -25,7 +24,7 @@ public class Swagger {
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("admin")
// .enable(!"product".equals(profile)) //生产环境关闭
.enable(!"prod".equals(profile)) //生产环境关闭
.select()
.apis(RequestHandlerSelectors.basePackage("com.zq.dataoperation.controller"))
.paths(PathSelectors.any())
......@@ -44,7 +43,7 @@ public class Swagger {
public Docket app() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("app")
.enable(!"product".equals(profile)) //生产环境关闭
.enable(!"prod".equals(profile)) //生产环境关闭
.select()
.apis(RequestHandlerSelectors.basePackage("com.zq.dataoperation.controller.api"))
.paths(PathSelectors.any())
......@@ -58,5 +57,4 @@ public class Swagger {
.description("查看接口文档")
.build();
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment