|
@ -1,5 +1,6 @@ |
|
|
package com.genersoft.iot.vmp.conf; |
|
|
package com.genersoft.iot.vmp.conf; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.context.annotation.Bean; |
|
|
import org.springframework.context.annotation.Bean; |
|
|
import org.springframework.context.annotation.Configuration; |
|
|
import org.springframework.context.annotation.Configuration; |
|
|
import springfox.documentation.builders.ApiInfoBuilder; |
|
|
import springfox.documentation.builders.ApiInfoBuilder; |
|
@ -13,49 +14,70 @@ import springfox.documentation.spring.web.plugins.Docket; |
|
|
@Configuration |
|
|
@Configuration |
|
|
public class Swagger3Config { |
|
|
public class Swagger3Config { |
|
|
|
|
|
|
|
|
|
|
|
@Value("${swagger-ui.enabled}") |
|
|
|
|
|
private boolean enable; |
|
|
|
|
|
|
|
|
@Bean |
|
|
@Bean |
|
|
public Docket createRestApi() { |
|
|
public Docket createRestApi() { |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
.apiInfo(apiInfo()) |
|
|
.apiInfo(apiInfo()) |
|
|
.groupName("全部") |
|
|
.groupName("1. 全部") |
|
|
.select() |
|
|
.select() |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager")) |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager")) |
|
|
.paths(PathSelectors.any()) |
|
|
.paths(PathSelectors.any()) |
|
|
.build() |
|
|
.build() |
|
|
.pathMapping("/"); |
|
|
.pathMapping("/") |
|
|
|
|
|
.enable(enable); |
|
|
} |
|
|
} |
|
|
@Bean |
|
|
@Bean |
|
|
public Docket createRestGBApi() { |
|
|
public Docket createRestGBApi() { |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
.apiInfo(apiInfo()) |
|
|
.apiInfo(apiInfo()) |
|
|
.groupName("国标") |
|
|
.groupName("2. 国标28181") |
|
|
.select() |
|
|
.select() |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.gb28181")) |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.gb28181")) |
|
|
.paths(PathSelectors.any()) |
|
|
.paths(PathSelectors.any()) |
|
|
.build() |
|
|
.build() |
|
|
.pathMapping("/"); |
|
|
.pathMapping("/") |
|
|
|
|
|
.enable(enable); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
|
public Docket createRestONVIFApi() { |
|
|
|
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
|
|
|
.apiInfo(apiInfo()) |
|
|
|
|
|
.groupName("3. ONVIF") |
|
|
|
|
|
.select() |
|
|
|
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.onvif")) |
|
|
|
|
|
.paths(PathSelectors.any()) |
|
|
|
|
|
.build() |
|
|
|
|
|
.pathMapping("/") |
|
|
|
|
|
.enable(enable); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean |
|
|
@Bean |
|
|
public Docket createRestStreamProxyApi() { |
|
|
public Docket createRestStreamProxyApi() { |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
.apiInfo(apiInfo()) |
|
|
.apiInfo(apiInfo()) |
|
|
.groupName("拉流转发") |
|
|
.groupName("4. 拉流转发") |
|
|
.select() |
|
|
.select() |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.streamProxy")) |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.streamProxy")) |
|
|
.paths(PathSelectors.any()) |
|
|
.paths(PathSelectors.any()) |
|
|
.build() |
|
|
.build() |
|
|
.pathMapping("/"); |
|
|
.pathMapping("/") |
|
|
|
|
|
.enable(enable); |
|
|
} |
|
|
} |
|
|
@Bean |
|
|
@Bean |
|
|
public Docket createRestStreamPushApi() { |
|
|
public Docket createRestStreamPushApi() { |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
.apiInfo(apiInfo()) |
|
|
.apiInfo(apiInfo()) |
|
|
.groupName("推流管理") |
|
|
.groupName("5. 推流管理") |
|
|
.select() |
|
|
.select() |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.streamPush")) |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.streamPush")) |
|
|
.paths(PathSelectors.any()) |
|
|
.paths(PathSelectors.any()) |
|
|
.build() |
|
|
.build() |
|
|
.pathMapping("/"); |
|
|
.pathMapping("/") |
|
|
|
|
|
.enable(enable); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -63,23 +85,25 @@ public class Swagger3Config { |
|
|
public Docket createServerApi() { |
|
|
public Docket createServerApi() { |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
.apiInfo(apiInfo()) |
|
|
.apiInfo(apiInfo()) |
|
|
.groupName("服务管理") |
|
|
.groupName("6. 服务管理") |
|
|
.select() |
|
|
.select() |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.server")) |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.server")) |
|
|
.paths(PathSelectors.any()) |
|
|
.paths(PathSelectors.any()) |
|
|
.build() |
|
|
.build() |
|
|
.pathMapping("/"); |
|
|
.pathMapping("/") |
|
|
|
|
|
.enable(enable); |
|
|
} |
|
|
} |
|
|
@Bean |
|
|
@Bean |
|
|
public Docket createUserApi() { |
|
|
public Docket createUserApi() { |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
.apiInfo(apiInfo()) |
|
|
.apiInfo(apiInfo()) |
|
|
.groupName("用户管理") |
|
|
.groupName("7. 用户管理") |
|
|
.select() |
|
|
.select() |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.user")) |
|
|
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.user")) |
|
|
.paths(PathSelectors.any()) |
|
|
.paths(PathSelectors.any()) |
|
|
.build() |
|
|
.build() |
|
|
.pathMapping("/"); |
|
|
.pathMapping("/") |
|
|
|
|
|
.enable(enable); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private ApiInfo apiInfo() { |
|
|
private ApiInfo apiInfo() { |
|
|