|
|
package com.sunyo.wlpt.message.bus.service.config;
|
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
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;
|
|
|
|
|
|
/**
|
|
|
* @author 子诚
|
|
|
* Description:swagger-knife4j 的配置文件
|
|
|
* 时间:2020/7/10 11:48
|
|
|
*/
|
|
|
@Configuration
|
|
|
@EnableSwagger2
|
|
|
public class SwaggerConfig {
|
|
|
@Bean
|
|
|
public Docket createRestApi() {
|
|
|
return new Docket(DocumentationType.SWAGGER_2)
|
|
|
.apiInfo(apiInfo())
|
|
|
.select()
|
|
|
.apis(RequestHandlerSelectors.basePackage("com.sunyo.wlpt.message.bus.service.controller"))
|
|
|
.paths(PathSelectors.any())
|
|
|
.build();
|
|
|
}
|
|
|
/**
|
|
|
* 默认访问地址是:http://${host}:${port}/doc.html
|
|
|
*/
|
|
|
private ApiInfo apiInfo() {
|
|
|
return new ApiInfoBuilder()
|
|
|
.title("消息平台控制中心 APIs")
|
|
|
.description("swagger-bootstrap-ui")
|
|
|
.termsOfServiceUrl("http://localhost:9030/")
|
|
|
.contact("523186180@qq.com")
|
|
|
.version("1.0.0")
|
|
|
.build();
|
|
|
}
|
|
|
} |
...
|
...
|
|