springfox.documentation.service.Contact Java Examples

The following examples show how to use springfox.documentation.service.Contact. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SwaggerConfig.java    From springBoot with MIT License 6 votes vote down vote up
/**
 * 添加摘要信息(Docket)
 */
@Bean
public Docket controllerApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(new ApiInfoBuilder()
                    .title("API实时接口文档")
                    .description("用于实时查看、测试API")
                    .contact(new Contact("huanzi-qch", "https://www.cnblogs.com/huanzi-qch/", ""))
                    .version("版本号:1.0")
                    .build())
            .select()
            //API基础扫描路径
            .apis(RequestHandlerSelectors.basePackage("cn.huanzi.qch.springbootswagger2.controller"))
            .paths(PathSelectors.any())
            .build();
}
 
Example #2
Source File: CertificateSwaggerConfig.java    From XS2A-Sandbox with Apache License 2.0 6 votes vote down vote up
@Bean
public Docket apiDocket() {
    return new Docket(DocumentationType.SWAGGER_2)
               .apiInfo(new ApiInfoBuilder()
                            .title("Certificate Generator")
                            .description("Certificate Generator for Testing Purposes of PSD2 Sandbox Environment")
                            .contact(new Contact(
                                "adorsys GmbH & Co. KG",
                                "https://adorsys.de",
                                "[email protected]"))
                            .version(buildProperties.getVersion() + " " + buildProperties.get("build.number"))
                            .build())
               .groupName("Certificate Generator API")
               .select()
               .apis(RequestHandlerSelectors.basePackage("de.adorsys.psd2.sandbox.certificate"))
               .paths(PathSelectors.any())
               .build();
}
 
Example #3
Source File: OpenAPIDocumentationConfig.java    From openapi-generator with Apache License 2.0 6 votes vote down vote up
ApiInfo apiInfo() {
    final Properties properties = new Properties();
    try (InputStream stream = this.getClass().getResourceAsStream("/version.properties")) {
        if (stream != null) {
            properties.load(stream);
        }
    } catch (IOException ex) {
        // ignore
    }

    String version = properties.getProperty("version", "unknown");

    return new ApiInfoBuilder()
        .title("OpenAPI Generator Online")
        .description("This is an online openapi generator server.  You can find out more at https://github.com/OpenAPITools/openapi-generator.")
        .license("Apache 2.0")
        .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html")
        .termsOfServiceUrl("")
        .version(version)
        .contact(new Contact("","", ""))
        .build();
}
 
Example #4
Source File: ProductCompositeServiceApplication.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 6 votes vote down vote up
/**
 * Will exposed on $HOST:$PORT/swagger-ui.html
 *
 * @return
 */
@Bean
public Docket apiDocumentation() {

	return new Docket(SWAGGER_2)
		.select()
		.apis(basePackage("se.magnus.microservices.composite.product"))
		.paths(PathSelectors.any())
		.build()
			.globalResponseMessage(POST, emptyList())
			.globalResponseMessage(GET, emptyList())
			.globalResponseMessage(DELETE, emptyList())
			.apiInfo(new ApiInfo(
                   apiTitle,
                   apiDescription,
                   apiVersion,
                   apiTermsOfServiceUrl,
                   new Contact(apiContactName, apiContactUrl, apiContactEmail),
                   apiLicense,
                   apiLicenseUrl,
                   emptyList()
               ));
   }
 
Example #5
Source File: ProductCompositeServiceApplication.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 6 votes vote down vote up
/**
 * Will exposed on $HOST:$PORT/swagger-ui.html
 *
 * @return
 */
@Bean
public Docket apiDocumentation() {

	return new Docket(SWAGGER_2)
		.select()
		.apis(basePackage("se.magnus.microservices.composite.product"))
		.paths(PathSelectors.any())
		.build()
			.globalResponseMessage(POST, emptyList())
			.globalResponseMessage(GET, emptyList())
			.globalResponseMessage(DELETE, emptyList())
			.apiInfo(new ApiInfo(
                   apiTitle,
                   apiDescription,
                   apiVersion,
                   apiTermsOfServiceUrl,
                   new Contact(apiContactName, apiContactUrl, apiContactEmail),
                   apiLicense,
                   apiLicenseUrl,
                   emptyList()
               ));
   }
 
Example #6
Source File: ProductCompositeServiceApplication.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 6 votes vote down vote up
/**
 * Will exposed on $HOST:$PORT/swagger-ui.html
 *
 * @return
 */
@Bean
public Docket apiDocumentation() {

	return new Docket(SWAGGER_2)
		.select()
		.apis(basePackage("se.magnus.microservices.composite.product"))
		.paths(PathSelectors.any())
		.build()
			.globalResponseMessage(POST, emptyList())
			.globalResponseMessage(GET, emptyList())
			.globalResponseMessage(DELETE, emptyList())
			.apiInfo(new ApiInfo(
                   apiTitle,
                   apiDescription,
                   apiVersion,
                   apiTermsOfServiceUrl,
                   new Contact(apiContactName, apiContactUrl, apiContactEmail),
                   apiLicense,
                   apiLicenseUrl,
                   emptyList()
               ));
   }
 
Example #7
Source File: ProductCompositeServiceApplication.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 6 votes vote down vote up
/**
 * Will exposed on $HOST:$PORT/swagger-ui.html
 *
 * @return
 */
@Bean
public Docket apiDocumentation() {

	return new Docket(SWAGGER_2)
		.select()
		.apis(basePackage("se.magnus.microservices.composite.product"))
		.paths(PathSelectors.any())
		.build()
			.globalResponseMessage(POST, emptyList())
			.globalResponseMessage(GET, emptyList())
			.globalResponseMessage(DELETE, emptyList())
			.apiInfo(new ApiInfo(
                   apiTitle,
                   apiDescription,
                   apiVersion,
                   apiTermsOfServiceUrl,
                   new Contact(apiContactName, apiContactUrl, apiContactEmail),
                   apiLicense,
                   apiLicenseUrl,
                   emptyList()
               ));
   }
 
Example #8
Source File: ProductCompositeServiceApplication.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 6 votes vote down vote up
/**
 * Will exposed on $HOST:$PORT/swagger-ui.html
 *
 * @return
 */
@Bean
public Docket apiDocumentation() {

	return new Docket(SWAGGER_2)
		.select()
		.apis(basePackage("se.magnus.microservices.composite.product"))
		.paths(PathSelectors.any())
		.build()
			.globalResponseMessage(POST, emptyList())
			.globalResponseMessage(GET, emptyList())
			.globalResponseMessage(DELETE, emptyList())
			.apiInfo(new ApiInfo(
                   apiTitle,
                   apiDescription,
                   apiVersion,
                   apiTermsOfServiceUrl,
                   new Contact(apiContactName, apiContactUrl, apiContactEmail),
                   apiLicense,
                   apiLicenseUrl,
                   emptyList()
               ));
   }
 
Example #9
Source File: ProductCompositeServiceApplication.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 6 votes vote down vote up
/**
 * Will exposed on $HOST:$PORT/swagger-ui.html
 *
 * @return
 */
@Bean
public Docket apiDocumentation() {

	return new Docket(SWAGGER_2)
		.select()
		.apis(basePackage("se.magnus.microservices.composite.product"))
		.paths(PathSelectors.any())
		.build()
			.globalResponseMessage(POST, emptyList())
			.globalResponseMessage(GET, emptyList())
			.globalResponseMessage(DELETE, emptyList())
			.apiInfo(new ApiInfo(
                   apiTitle,
                   apiDescription,
                   apiVersion,
                   apiTermsOfServiceUrl,
                   new Contact(apiContactName, apiContactUrl, apiContactEmail),
                   apiLicense,
                   apiLicenseUrl,
                   emptyList()
               ));
   }
 
Example #10
Source File: ProductCompositeServiceApplication.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 6 votes vote down vote up
/**
 * Will exposed on $HOST:$PORT/swagger-ui.html
 *
 * @return
 */
@Bean
public Docket apiDocumentation() {

	return new Docket(SWAGGER_2)
		.select()
		.apis(basePackage("se.magnus.microservices.composite.product"))
		.paths(PathSelectors.any())
		.build()
			.globalResponseMessage(POST, emptyList())
			.globalResponseMessage(GET, emptyList())
			.globalResponseMessage(DELETE, emptyList())
			.apiInfo(new ApiInfo(
                   apiTitle,
                   apiDescription,
                   apiVersion,
                   apiTermsOfServiceUrl,
                   new Contact(apiContactName, apiContactUrl, apiContactEmail),
                   apiLicense,
                   apiLicenseUrl,
                   emptyList()
               ));
   }
 
Example #11
Source File: ProductCompositeServiceApplication.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 6 votes vote down vote up
/**
 * Will exposed on $HOST:$PORT/swagger-ui.html
 *
 * @return
 */
@Bean
public Docket apiDocumentation() {

	return new Docket(SWAGGER_2)
		.select()
		.apis(basePackage("se.magnus.microservices.composite.product"))
		.paths(PathSelectors.any())
		.build()
			.globalResponseMessage(POST, emptyList())
			.globalResponseMessage(GET, emptyList())
			.globalResponseMessage(DELETE, emptyList())
			.apiInfo(new ApiInfo(
                   apiTitle,
                   apiDescription,
                   apiVersion,
                   apiTermsOfServiceUrl,
                   new Contact(apiContactName, apiContactUrl, apiContactEmail),
                   apiLicense,
                   apiLicenseUrl,
                   emptyList()
               ));
   }
 
Example #12
Source File: SwaggerConfig.java    From wingcloud with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("wc-client-reporting")
            .description("接口文档说明")
            .contact(new Contact("浅然", "", "[email protected]"))
            .version("2.0")
            .build();
}
 
Example #13
Source File: Swagger2Config.java    From jvue-admin with MIT License 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder().title("JVUE平台服务器端APIs")
            .license("MIT License")
            .licenseUrl("https://mit-license.org/")
            .description(
                    "基础JVUE平台 RESTful 风格的接口文档,内容详细,极大的减少了前后端的沟通成本,同时确保代码与文档保持高度一致,极大的减少维护文档的时间。")
            .contact(new Contact("ccfish", "https://github.com/ccfish86/jvue-admin", "[email protected]"))
            .version("1.0.0").build();
}
 
Example #14
Source File: SwaggerConfig.java    From wangsy-january with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("商户服务")
            .description("商户管理")
            .termsOfServiceUrl("website")
            .contact(new Contact("name", "url", "email"))
            .version("v1.0")
            .build();
}
 
Example #15
Source File: SwaggerConfig.java    From wangsy-january with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("会员服务")
            .description("会员管理")
            .termsOfServiceUrl("website")
            .contact(new Contact("name", "url", "email"))
            .version("v1.0")
            .build();
}
 
Example #16
Source File: Swagger2Config.java    From spring-boot-vue-admin with Apache License 2.0 5 votes vote down vote up
private ApiInfo buildApiInfo() {
  final Contact contact = new Contact("Zoctan", "https://github.com/Zoctan", "[email protected]");

  return new ApiInfoBuilder()
      .title("APIs doc")
      .description("RESTFul APIs")
      .contact(contact)
      .version("1.0")
      .build();
}
 
Example #17
Source File: SwaggerConfigurations.java    From microservice-patterns with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfo(
      "Booking API", 
      "API. Offering cab booking service", 
      "API TOS", 
      "Terms of service", 
      new Contact("Satish Sharma", "https://github.com/hellosatish", "[email protected]"), 
      "License of API", "API license URL", Collections.emptyList());
}
 
Example #18
Source File: SwaggerConfiguration.java    From paascloud-master with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
	SwaggerProperties swagger = paascloudProperties.getSwagger();
	return new ApiInfoBuilder()
			.title(swagger.getTitle())
			.description(swagger.getDescription())
			.version(swagger.getVersion())
			.license(swagger.getLicense())
			.licenseUrl(swagger.getLicenseUrl())
			.contact(new Contact(swagger.getContactName(), swagger.getContactUrl(), swagger.getContactEmail()))
			.build();
}
 
Example #19
Source File: SwaggerConfig.java    From opscenter with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("ingrid系统接口列表")
            .description("接口")
            .termsOfServiceUrl("http://127.0.0.1:9901/swagger-ui#/")
            .contact(new Contact("APPJISHU", "https://github.com/appjishu", "[email protected]"))
            .version("1.1.0")
            .build();
}
 
Example #20
Source File: SwaggerConfig.java    From summerframework with Apache License 2.0 5 votes vote down vote up
@Bean
public Docket docket() {
    ArrayList<String> basePackage=new ArrayList<>();
    if(!StringUtils.isEmpty(swaggerBasePackage)){
        basePackage.addAll(Arrays.asList(swaggerBasePackage.split(",")));
    }else {
        // 从注解中解析basePackage
        Map<String, Object> applicationClass = applicationContext.getBeansWithAnnotation(SpringBootApplication.class);
        if(applicationClass.size()>1){
            log.warn("{} SpringBootApplication : {}",applicationClass.size(),applicationClass);
        }
        applicationClass.forEach((k,v)->{
            SpringBootApplication ann = AnnotationUtils.findAnnotation(v.getClass(), SpringBootApplication.class);
            if(ann.scanBasePackages().length==0&&ann.scanBasePackageClasses().length==0){
                basePackage.add(v.getClass().getPackage().getName());
            }else {
                basePackage.addAll(Arrays.asList(ann.scanBasePackages()));
                basePackage.addAll(Arrays.asList(ann.scanBasePackageClasses()).stream().map(s->s.getPackage().getName()).collect(Collectors.toList()));
            }
        });
    }
    return new Docket(DocumentationType.SWAGGER_2).select().apis(Predicates.or(basePackage.stream().map(RequestHandlerSelectors::basePackage).collect(Collectors.toList())))
        .paths(Predicates.not(PathSelectors.regex("/error.*"))).build()
        .apiInfo(new ApiInfo(configurableEnvironment.getProperty("spring.application.name"), "",
            configurableEnvironment.getProperty("spring.application.version"), "",
            new Contact(configurableEnvironment.getProperty("spring.application.contact"), "", ""), "", "",
            new ArrayList<>()));
}
 
Example #21
Source File: SwaggerConfiguration.java    From spring-cloud-yes with Apache License 2.0 5 votes vote down vote up
/**
 * swagger 信息
 *
 * @return 页面信息
 */
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("消费者API")
            .description("消费者API")
            .termsOfServiceUrl("")
            .version("1.0.0")
            .contact(new Contact("", "", "")).build();
}
 
Example #22
Source File: SwaggerConfiguration.java    From spring-cloud-yes with Apache License 2.0 5 votes vote down vote up
/**
 * swagger 信息
 *
 * @return 页面信息
 */
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("内容中心API")
            .description("内容中心API")
            .termsOfServiceUrl("")
            .version("1.0.0")
            .contact(new Contact("", "", "")).build();
}
 
Example #23
Source File: SwaggerConfig.java    From signature with MIT License 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("后台接口文档")
            .description("自动签名接口文档")
            .contact(new Contact("iizvv", "", ""))
            .version("1.0")
            .build();
}
 
Example #24
Source File: SwaggerConfig.java    From yshopmall with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title(title)
            .termsOfServiceUrl(serverUrl)
            .description(title)
            .version(version)
            .contact(new Contact("hupeng","https://www.yixiang.co","[email protected]"))
            .build();
}
 
Example #25
Source File: SwaggerConfig.java    From spring-boot-examples with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("基于Swagger构建的Rest API文档")
            .description("更多请咨询服务开发者eknown")
            .contact(new Contact("空夜", "http://www.eknown.cn", "[email protected]"))
            .termsOfServiceUrl("http://www.eknown.com")
            .version("1.0")
            .build();
}
 
Example #26
Source File: HomepageSwaggerConfig.java    From light-reading-cloud with MIT License 5 votes vote down vote up
/**
 * swagger基础信息
 * @return ApiInfo swagger信息
 */
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("阅读APP接口")
            .description("图书、用户、搜索相关")
            .termsOfServiceUrl("")
            .contact(new Contact("", "", ""))
            .license("")
            .licenseUrl("")
            .version("0.0.1")
            .build();
}
 
Example #27
Source File: OpenAPIDocumentationConfig.java    From openapi-generator with Apache License 2.0 5 votes vote down vote up
ApiInfo apiInfo() {
    return new ApiInfoBuilder()
        .title("OpenAPI Petstore")
        .description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
        .license("Apache-2.0")
        .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html")
        .termsOfServiceUrl("")
        .version("1.0.0")
        .contact(new Contact("","", ""))
        .build();
}
 
Example #28
Source File: BookSwaggerConfig.java    From light-reading-cloud with MIT License 5 votes vote down vote up
/**
 * swagger基础信息
 * @return ApiInfo swagger信息
 */
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("图书中心接口")
            .description("图书中心")
            .termsOfServiceUrl("")
            .contact(new Contact("", "", ""))
            .license("")
            .licenseUrl("")
            .version("1.0.0")
            .build();
}
 
Example #29
Source File: Swagger2Config.java    From SpringBootLearn with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            // 文档标题
            .title("springboot利用swagger构建api文档")
            // 文档详细描述
            .description("简单优雅的restfun风格,http://www.lhdyx.cn")
            // 作者
            .contact(new Contact("小东", "http://www.lhdyx.cn", "[email protected]"))
            // 版本号
            .version("1.0")
            .build();
}
 
Example #30
Source File: SwaggerConfig.java    From Java-API-Test-Examples with Apache License 2.0 5 votes vote down vote up
private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("SpringBoot-Swagger2集成和使用示例")
            .description("7DGroup | zuozewei")
            // 作者信息
            .contact(new Contact("zuozewei", "https://blog.csdn.net/zuozewei", "[email protected]"))
            .version("1.0.0")
            .build();
}