|
@@ -1,17 +1,17 @@
|
|
|
package cn.com.qmth.stmms.ms.log.config;
|
|
|
|
|
|
-import com.google.common.base.Predicates;
|
|
|
-import org.springframework.context.annotation.Bean;
|
|
|
-import org.springframework.context.annotation.Configuration;
|
|
|
-import springfox.documentation.builders.ParameterBuilder;
|
|
|
-import springfox.documentation.builders.PathSelectors;
|
|
|
-import springfox.documentation.builders.RequestHandlerSelectors;
|
|
|
-import springfox.documentation.schema.ModelRef;
|
|
|
-import springfox.documentation.service.ApiInfo;
|
|
|
-import springfox.documentation.service.Parameter;
|
|
|
-import springfox.documentation.spi.DocumentationType;
|
|
|
-import springfox.documentation.spring.web.plugins.Docket;
|
|
|
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|
|
+//import com.google.common.base.Predicates;
|
|
|
+//import org.springframework.context.annotation.Bean;
|
|
|
+//import org.springframework.context.annotation.Configuration;
|
|
|
+//import springfox.documentation.builders.ParameterBuilder;
|
|
|
+//import springfox.documentation.builders.PathSelectors;
|
|
|
+//import springfox.documentation.builders.RequestHandlerSelectors;
|
|
|
+//import springfox.documentation.schema.ModelRef;
|
|
|
+//import springfox.documentation.service.ApiInfo;
|
|
|
+//import springfox.documentation.service.Parameter;
|
|
|
+//import springfox.documentation.spi.DocumentationType;
|
|
|
+//import springfox.documentation.spring.web.plugins.Docket;
|
|
|
+//import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -23,44 +23,44 @@ import java.util.List;
|
|
|
* @Author: wangliang
|
|
|
* @Date: 2019/9/21
|
|
|
*/
|
|
|
-@Configuration
|
|
|
-@EnableSwagger2
|
|
|
+//@Configuration
|
|
|
+//@EnableSwagger2
|
|
|
public class SwaggerConfig {
|
|
|
|
|
|
- @Bean
|
|
|
- public Docket createRestApi() {
|
|
|
-// ParameterBuilder tokenPar1 = new ParameterBuilder();
|
|
|
- ParameterBuilder tokenPar2 = new ParameterBuilder();
|
|
|
- List<Parameter> pars = new ArrayList<>();
|
|
|
-// tokenPar1.name("key").description("key").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
|
|
|
- tokenPar2.name("token").description("token").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
|
|
|
-// pars.add(tokenPar1.build());
|
|
|
- pars.add(tokenPar2.build());
|
|
|
-
|
|
|
- return new Docket(DocumentationType.SWAGGER_2)
|
|
|
- .groupName("美术阅卷")
|
|
|
- .select()
|
|
|
- .apis(RequestHandlerSelectors.basePackage("cn.com.qmth.stmms.ms.log"))
|
|
|
-// .apis(RequestHandlerSelectors.any())
|
|
|
- .paths(PathSelectors.any())
|
|
|
- // 不显示错误的接口地址
|
|
|
- .paths(Predicates.not(PathSelectors.regex("/error.*")))// 错误路径不监控
|
|
|
- .build()
|
|
|
- .globalOperationParameters(pars)
|
|
|
- .apiInfo(apiInfo());
|
|
|
- }
|
|
|
-
|
|
|
- private ApiInfo apiInfo() {
|
|
|
- ApiInfo apiInfo = new ApiInfo(
|
|
|
- "美术阅卷 - api",
|
|
|
- "Some custom description of API.",
|
|
|
- "API TOS",
|
|
|
- "Terms of service",
|
|
|
- "myeaddress@company.com",
|
|
|
- "License of API",
|
|
|
- "API license URL");
|
|
|
- return apiInfo;
|
|
|
- }
|
|
|
+// @Bean
|
|
|
+// public Docket createRestApi() {
|
|
|
+//// ParameterBuilder tokenPar1 = new ParameterBuilder();
|
|
|
+// ParameterBuilder tokenPar2 = new ParameterBuilder();
|
|
|
+// List<Parameter> pars = new ArrayList<>();
|
|
|
+//// tokenPar1.name("key").description("key").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
|
|
|
+// tokenPar2.name("token").description("token").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
|
|
|
+//// pars.add(tokenPar1.build());
|
|
|
+// pars.add(tokenPar2.build());
|
|
|
+//
|
|
|
+// return new Docket(DocumentationType.SWAGGER_2)
|
|
|
+// .groupName("美术阅卷")
|
|
|
+// .select()
|
|
|
+// .apis(RequestHandlerSelectors.basePackage("cn.com.qmth.stmms.ms.log"))
|
|
|
+//// .apis(RequestHandlerSelectors.any())
|
|
|
+// .paths(PathSelectors.any())
|
|
|
+// // 不显示错误的接口地址
|
|
|
+// .paths(Predicates.not(PathSelectors.regex("/error.*")))// 错误路径不监控
|
|
|
+// .build()
|
|
|
+// .globalOperationParameters(pars)
|
|
|
+// .apiInfo(apiInfo());
|
|
|
+// }
|
|
|
+//
|
|
|
+// private ApiInfo apiInfo() {
|
|
|
+// ApiInfo apiInfo = new ApiInfo(
|
|
|
+// "美术阅卷 - api",
|
|
|
+// "Some custom description of API.",
|
|
|
+// "API TOS",
|
|
|
+// "Terms of service",
|
|
|
+// "myeaddress@company.com",
|
|
|
+// "License of API",
|
|
|
+// "API license URL");
|
|
|
+// return apiInfo;
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
|