當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。