|
|
@@ -0,0 +1,51 @@
|
|
|
+package platform.config;
|
|
|
+
|
|
|
+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;
|
|
|
+
|
|
|
+@Configuration
|
|
|
+@EnableSwagger2//开启Swagger2的自动配置
|
|
|
+@Profile({"aliyun", "test"})
|
|
|
+public class SwaggerConfig {
|
|
|
+// @Bean
|
|
|
+// public Docket peopleDeptApi() {
|
|
|
+// return new Docket(DocumentationType.SWAGGER_2)
|
|
|
+// .apiInfo(apiInfo("人才库", "人才库-人员,部门接口文档", "1.0"))
|
|
|
+// .select()
|
|
|
+// .apis(RequestHandlerSelectors.basePackage("com.allqj.platform_base_organization.base.controller"))
|
|
|
+// .paths(PathSelectors.any())
|
|
|
+// .build()
|
|
|
+// .groupName("人员,部门API");
|
|
|
+// }
|
|
|
+// @Bean
|
|
|
+// public Docket brokerApi() {
|
|
|
+// return new Docket(DocumentationType.SWAGGER_2)
|
|
|
+// .apiInfo(apiInfo("人才库", "人才库-经纪人接口文档", "1.0"))
|
|
|
+// .select()
|
|
|
+// .apis(RequestHandlerSelectors.basePackage("com.allqj.platform_base_organization.broker.controller"))
|
|
|
+// .paths(PathSelectors.any())
|
|
|
+// .build()
|
|
|
+// .groupName("经纪人API");
|
|
|
+// }
|
|
|
+ @Bean
|
|
|
+ public Docket dictionaryApi() {
|
|
|
+ return new Docket(DocumentationType.SWAGGER_2)
|
|
|
+ .apiInfo(apiInfo("人才库", "人才库-字典接口文档", "1.0"))
|
|
|
+ .select()
|
|
|
+ .apis(RequestHandlerSelectors.basePackage("platform.modules"))
|
|
|
+ .paths(PathSelectors.any())
|
|
|
+ .build()
|
|
|
+ .groupName("字典API");
|
|
|
+ }
|
|
|
+ private ApiInfo apiInfo(String title, String description, String version) {
|
|
|
+ return new ApiInfoBuilder().title(title).description(description).version(version).build();
|
|
|
+ }
|
|
|
+}
|