当前位置: 首页>>代码示例>>Java>>正文


Java PathSelectors类代码示例

本文整理汇总了Java中springfox.documentation.builders.PathSelectors的典型用法代码示例。如果您正苦于以下问题:Java PathSelectors类的具体用法?Java PathSelectors怎么用?Java PathSelectors使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PathSelectors类属于springfox.documentation.builders包,在下文中一共展示了PathSelectors类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRestApi

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket createRestApi() {
	
    return new Docket(DocumentationType.SWAGGER_2)
    		.useDefaultResponseMessages(false)
    		.additionalModels(typeResolver.resolve(ErrorInfo.class))
    		.globalResponseMessage(RequestMethod.GET, getDefaultResponseMessage())
    		.globalResponseMessage(RequestMethod.POST, getDefaultResponseMessage())
    		.globalResponseMessage(RequestMethod.PUT, getDefaultResponseMessage())
    		.globalResponseMessage(RequestMethod.DELETE, getDefaultResponseMessage())
            .directModelSubstitute(Timestamp.class, Date.class)
            .tags(new Tag("默认标签", "定义全局默认标签"),getTags())
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.plumdo.form"))
            .paths(PathSelectors.any())
            .build();
}
 
开发者ID:wengwh,项目名称:plumdo-work,代码行数:19,代码来源:Swagger2Configuration.java

示例2: api

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(new ApiInfo(
                    "Smarti",
                    "the smart in assistify",
                    apiVersion,
                    null,
                    new Contact(
                            apiContactName,
                            apiContactUrl,
                            "[email protected]"
                    ),
                    "Apache 2.0",
                    "https://www.apache.org/licenses/LICENSE-2.0",
                    Collections.emptyList()
            ))
            .select()
                .apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
                .paths(PathSelectors.any())
                .build()
            .securitySchemes(Arrays.asList(authToken(), basicAuth()))
            .securityContexts(Arrays.asList(publicContext(), defaultContext()))
            .ignoredParameterTypes(AuthContext.class)
            .directModelSubstitute(ObjectId.class, String.class);
}
 
开发者ID:redlink-gmbh,项目名称:smarti,代码行数:27,代码来源:SwaggerConfiguration.java

示例3: createRestApi

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket createRestApi() {
    ParameterBuilder tokenPar = new ParameterBuilder();
    List<Parameter> parameters = new ArrayList<>();
    tokenPar.name("xmall-Token")
            .description("token")
            .defaultValue("admin")
            .modelRef(new ModelRef("string"))
            .parameterType("header")
            .required(false)
            .build();
    parameters.add(tokenPar.build());
    Docket docket = new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .useDefaultResponseMessages(false)
            .globalOperationParameters(parameters)
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.jeiker.mall.controller"))
            .paths(PathSelectors.any())
            .build();
    return docket;
}
 
开发者ID:jeikerxiao,项目名称:X-mall,代码行数:23,代码来源:Swagger2Config.java

示例4: paths

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
private Predicate<String> paths(Swagger2Properties swagger2Properties) {

        List<Predicate<String>> basePaths = new ArrayList<>();

        if (swagger2Properties.getBasePath().isEmpty()) {
            basePaths.add(PathSelectors.any());
        }
        for (String basePath : swagger2Properties.getBasePath()) {
            basePaths.add(PathSelectors.ant(basePath));
        }

        List<Predicate<String>> excludePaths = new ArrayList<>();
        for (String excludePath : swagger2Properties.getExcludePath()) {
            excludePaths.add(PathSelectors.ant(excludePath));
        }

        return Predicates.and(
            Predicates.not(
                Predicates.or(excludePaths)
            ),
            Predicates.or(basePaths)
        );
    }
 
开发者ID:xhusky,项目名称:swagger2-spring-boot-starter,代码行数:24,代码来源:Swagger2AutoConfiguration.java

示例5: api

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket api() {
  return new Docket(DocumentationType.SWAGGER_2)//
      .select()//
      .apis(RequestHandlerSelectors.any())//
      .paths(Predicates.not(PathSelectors.regex("/error")))//
      .build()//
      .apiInfo(metadata())//
      .useDefaultResponseMessages(false)//
      .securitySchemes(new ArrayList<>(Arrays.asList(new ApiKey("Bearer %token", "Authorization", "Header"))))//
      .tags(new Tag("users", "Operations about users"))//
      .tags(new Tag("ping", "Just a ping"))//
      .genericModelSubstitutes(Optional.class);

}
 
开发者ID:murraco,项目名称:spring-boot-jwt,代码行数:16,代码来源:SwaggerConfig.java

示例6: api

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
public Docket api() {
	return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
												  .select()
												  .apis(RequestHandlerSelectors.any())

												  .paths(PathSelectors.any())
												  .build()
												  .pathMapping("/")
												  .directModelSubstitute(LocalDate.class, String.class)
												  .genericModelSubstitutes(ResponseEntity.class)
												  .alternateTypeRules(AlternateTypeRules.newRule(typeResolver.resolve(
														  DeferredResult.class,
														  typeResolver.resolve(ResponseEntity.class,
																			   WildcardType.class)),
																								 typeResolver.resolve(
																										 WildcardType.class)))
												  .useDefaultResponseMessages(false);
}
 
开发者ID:melthaw,项目名称:spring-backend-boilerplate,代码行数:19,代码来源:SpringfoxConfiguration.java

示例7: practiceApi

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket practiceApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.sdcuike.practice"))
            .paths(PathSelectors.any())
            .build()
            .pathMapping("/")
            .genericModelSubstitutes(ResponseEntity.class)
            .alternateTypeRules(
                    newRule(typeResolver.resolve(DeferredResult.class,
                            typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
                            typeResolver.resolve(WildcardType.class)))
            .useDefaultResponseMessages(false)
            .globalResponseMessage(RequestMethod.GET,
                    newArrayList(new ResponseMessageBuilder()
                            .code(500)
                            .message("500 message")
                            .responseModel(new ModelRef("Error"))
                            .build()))
            .enableUrlTemplating(true)
            .tags(new Tag("Pet Service", "All apis relating to pets"));
}
 
开发者ID:sdcuike,项目名称:spring-boot-oauth2-demo,代码行数:25,代码来源:SpringfoxConfig.java

示例8: createRestApi

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket createRestApi() {
	
    return new Docket(DocumentationType.SWAGGER_2)
    		.useDefaultResponseMessages(false)
    		.globalResponseMessage(RequestMethod.GET, getDefaultResponseMessage())
    		.globalResponseMessage(RequestMethod.POST, getDefaultResponseMessage())
    		.globalResponseMessage(RequestMethod.PUT, getDefaultResponseMessage())
    		.globalResponseMessage(RequestMethod.DELETE, getDefaultResponseMessage())
            .directModelSubstitute(Timestamp.class, Date.class)
            .tags(new Tag("默认标签", "定义全局默认标签"),getTags())
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.plumdo.form"))
            .paths(PathSelectors.any())
            .build();
}
 
开发者ID:wengwh,项目名称:plumdo-work,代码行数:18,代码来源:Swagger2Configuration.java

示例9: api

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket api() {
	return new Docket(DocumentationType.SWAGGER_2)
			.useDefaultResponseMessages(false)
			.apiInfo(apiInfo())
			.select()
			.apis(RequestHandlerSelectors.any())
			.paths(Predicates.not(PathSelectors.regex("/error.*")))
			.build();
}
 
开发者ID:Code4SocialGood,项目名称:C4SG-Obsolete,代码行数:11,代码来源:SwaggerConfig.java

示例10: api

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            //                .apis(RequestHandlerSelectors.any()) // show all service, including spring-boot default.
            .apis(RequestHandlerSelectors.basePackage("com.mkdika.spring5restapi.web.api")) // show specific class path only                 
            .paths(PathSelectors.any())
            .build()
            .apiInfo(metaInfo());
}
 
开发者ID:mkdika,项目名称:spring5-rest-api,代码行数:11,代码来源:SwaggerConfig.java

示例11: createRestApi

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket createRestApi() {
	return new Docket(DocumentationType.SWAGGER_2)
	        .apiInfo(apiInfo())
	        .select()
	        .apis(RequestHandlerSelectors.basePackage("tk.ainiyue.danyuan"))
	        .paths(PathSelectors.any())
	        .build();
}
 
开发者ID:514840279,项目名称:danyuan-application,代码行数:10,代码来源:Swagger2.java

示例12: apiDocket

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket apiDocket() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("org.java10.plum.controllers"))
            .paths(PathSelectors.any())
            .build();
}
 
开发者ID:fku233,项目名称:Plum,代码行数:10,代码来源:Swagger2Config.java

示例13: api

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.bbva.arq.devops.ae.mirrorgate.api"))
            .paths(PathSelectors.any())
            .build();
}
 
开发者ID:BBVA,项目名称:mirrorgate,代码行数:9,代码来源:OpenApiConfig.java

示例14: createRestApi

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket createRestApi() {
    Docket docket = new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.jeiker.demo.controller"))
            .paths(PathSelectors.any())
            .build();
    return docket;
}
 
开发者ID:jeikerxiao,项目名称:SpringBootStudy,代码行数:11,代码来源:Swagger2Config.java

示例15: createRestApi

import springfox.documentation.builders.PathSelectors; //导入依赖的package包/类
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage(basePackage))
            .paths(PathSelectors.any())
            .build();
}
 
开发者ID:xubinux,项目名称:xbin-store,代码行数:10,代码来源:Swagger2.java


注:本文中的springfox.documentation.builders.PathSelectors类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。