| | |
| | | package cn.flightfeather.supervision.config |
| | | |
| | | import io.swagger.annotations.Api |
| | | import org.springframework.beans.factory.annotation.Value |
| | | import org.springframework.context.annotation.Bean |
| | | import org.springframework.context.annotation.Configuration |
| | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/8/28 |
| | | * 访问地址:http://localhost:8080/swagger-ui/index.html |
| | | */ |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | class Swagger2Configuration( |
| | | @Value("\${springfox.documentation.swagger.v2.enabled}") |
| | | var swagger2Enable: Boolean |
| | | var swagger2Enable: Boolean, |
| | | ) { |
| | | |
| | | companion object { |
| | |
| | | |
| | | @Bean |
| | | fun createRestApi(): Docket = |
| | | Docket(DocumentationType.SWAGGER_2) |
| | | .enable(swagger2Enable) |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | .apis(RequestHandlerSelectors.basePackage(SWAGGER_SCAN_BASE_PACKAGE)) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | Docket(DocumentationType.SWAGGER_2) |
| | | .enable(swagger2Enable) |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | .apis(RequestHandlerSelectors.basePackage(SWAGGER_SCAN_BASE_PACKAGE)) |
| | | .apis(RequestHandlerSelectors.withClassAnnotation(Api::class.java)) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | |
| | | |
| | | private fun apiInfo() = |
| | | ApiInfoBuilder() |
| | | .title("第三方监管服务") |
| | | .description("第三方监管服务 API 接口文档") |
| | | .version(VERSION) |
| | | .build() |
| | | ApiInfoBuilder() |
| | | .title("第三方监管服务") |
| | | .description("第三方监管服务 API 接口文档") |
| | | .version(VERSION) |
| | | .build() |
| | | } |