通过开关 控制 关闭swagger ui
解决方案 »
- ldap 循环添加节点时报socket closed,这个怎么办?
- struts 配置问题 为什么配置失败
- jpa写法:where in ()语句
- 能否通过数据库连接Connection等到登陆的用户名
- 如果谁能帮我解决提出的问题, 我的分数全给他.
- JBX 下Tomcat启动报错!谢谢!!
- 关于jndi和EJB的一个小问题
- 做个调查,有多少人使用JBuilder做真实的项目开发的?
- Apache Tomcat8不能启动服务 错误代码1
- java smack + ejabberd 连接成功,登录失败,怎么解决
- poi word2007转html 里面的各种统计图怎么转换?
- myeclipse maven run as clean install都没有反应
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;/**
* api自动生产
*
* @seelink http://blog.csdn.net/catoop/article/details/50668896
* Created by wangkun23 on 2017/7/18.
*/
@Configuration
@EnableSwagger2
@EnableAutoConfiguration
@Profile({"dev", "local"})//在生产环境不开启
public class Swagger2Config { @Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.jinyinwu.wechat.assist.api"))
.paths(PathSelectors.any())
.build();
} private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("中房联微信助手系统")
.description("中房联微信助手系统,提供给下户,面签,权证,核档处理")
.contact("[email protected]")
.version("1.0")
.build();
}}