下面列出了org.springframework.boot.autoconfigure.condition.ConditionalOnExpression#springfox.documentation.builders.ApiInfoBuilder 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* 动态产生Docket分组信息
*
* @return
*/
@Autowired
public void dynamicConfiguration() {
ConfigurableApplicationContext context = (ConfigurableApplicationContext) applicationContext;
DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) context.getBeanFactory();
String systemName = "Microservice PaaS";
ApiInfoBuilder apiInfoBuilder = new ApiInfoBuilder()
.description("mPaas前端后端对应接口")
.version("1.0.1")
.license("Code Farmer Framework(iByte) Org.");
Map<String, ModuleMappingInfo> moduleInfo = mappingHelper.getMappingInfos();
for (Map.Entry<String, ModuleMappingInfo> entry : moduleInfo.entrySet()) {
beanFactory.registerSingleton(entry.getKey(), new Docket(DocumentationType.SWAGGER_2)
.groupName(entry.getKey())
.apiInfo(apiInfoBuilder.title(systemName + NamingConstant.DOT + entry.getKey()).build())
.select()
.apis(genSubPackage(entry.getKey()))
.paths(Predicates.or(PathSelectors.ant(NamingConstant.PATH_PREFIX_DATA + "/**"),
PathSelectors.ant(NamingConstant.PATH_PREFIX_API + "/**")))
.build());
}
}
/**
* api文档的详细信息函数,注意这里的注解引用的是哪个
*
* @return
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
// //大标题
.title("Jeecg-Boot 后台服务API接口文档")
// 版本号
.version("1.0")
// .termsOfServiceUrl("NO terms of service")
// 描述
.description("后台API接口")
// 作者
.contact("JEECG团队")
.license("The Apache License, Version 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Pig Swagger API ")
.description("https://gitee.com/log4j/pig/wikis")
.termsOfServiceUrl("https://gitee.com/log4j/pig")
.contact(new Contact("冷冷","https://gitee.com/log4j/pig","[email protected]"))
.version("1.0")
.build();
}
/**
* 获取apiInfo
*
* @return
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title(swaggerProperties.getTitle())
.description(swaggerProperties.getDescription())
.termsOfServiceUrl(swaggerProperties.getUrl())
.contact(new Contact(swaggerProperties.getContactName(), swaggerProperties.getContactUrl(), swaggerProperties.getContactEmail()))
.version(swaggerProperties.getVersion())
.build();
}
private ApiInfo apiInfo() {
// 创建API的基本信息,这些信息会在Swagger UI中进行显示
return new ApiInfoBuilder()
// API 标题
.title("接口文档服务")
// API描述
.description("默认接口调用需要使用TOKEN,请传入TOKEN后进行接口验证")
.contact(new Contact("SuperBoot", "http://www.superboot.org", "[email protected]"))
// 版本号
.version("1.0-SNAPSHOT")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("SwaggerUI演示")
.description("mall-tiny")
.contact("macro")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("DBus Keeper Service")
.description("basic interface for dbus management")
.license("Apache 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.termsOfServiceUrl("")
.version(VERSION)
.contact(new Contact("DBus", "https://github.com/BriData/DBus", "[email protected]"))
.build();
}
@Bean
public Docket testdriveSwagger() {
return new Docket(SWAGGER_2)
.groupName("testdrive")
.apiInfo(new ApiInfoBuilder().title("Test Drive").build())
.useDefaultResponseMessages(false)
.tags(new Tag("testdrive", "Test Drive"))
.select()
.paths(PathSelectors.regex("/testdrive.*"))
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("HIS-CLOUD-SERVICE-DMS")
.description("基于restful的HIS接口")
.contact("neu")
.version("1.0")
.build();
}
/**
* swagger 信息
*
* @return 页面信息
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("消费者API")
.description("消费者API")
.termsOfServiceUrl("")
.version("1.0.0")
.contact(new Contact("", "", "")).build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Security Group Manager")
.description("Security Group lifecycle management")
.license("Apache 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Spring Boot中使用Swagger2构建RESTful APIs")
.description("测试")
.termsOfServiceUrl("http://www.panchengming.com/")
.contact("xuwujing")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("SwaggerUI演示")
.description("mall-tiny")
.contact("macro")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
ApiInfoBuilder builder = new ApiInfoBuilder()
.title(dewConfig.getBasic().getName())
.description(dewConfig.getBasic().getDesc())
.termsOfServiceUrl(dewConfig.getBasic().getWebSite())
.version(dewConfig.getBasic().getVersion());
if (dewConfig.getBasic().getDoc().getContact() != null) {
builder.contact(new Contact(
dewConfig.getBasic().getDoc().getContact().getName(),
dewConfig.getBasic().getDoc().getContact().getUrl(),
dewConfig.getBasic().getDoc().getContact().getEmail()
));
}
return builder.build();
}
/**
* swagger 信息
*
* @return 页面信息
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("内容中心API")
.description("内容中心API")
.termsOfServiceUrl("")
.version("1.0.0")
.contact(new Contact("", "", "")).build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("flash-waimai api")
.description("快速构建外卖系统")
.termsOfServiceUrl("microapp.store")
.contact("www.microapp.store")
.version("1.0")
.build();
}
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();
}
/**
* Api info api info.
*
* @return the api info
*/
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Swagger API")
.description("motan框架 基于mq分布式事务解决方案 测试体验")
.license("Apache 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.termsOfServiceUrl("")
.version(VERSION)
.contact(new Contact("xiaoyu", "", "[email protected]"))
.build();
}
/**
* Returns the API info for Swagger.
* @return
*/
private final ApiInfo getApiInfo() {
return new ApiInfoBuilder()
.title("Vulas REST API")
.description("This is the REST API of Vulas")
.version(VulasConfiguration.getGlobal().getConfiguration().getString("shared.version"))
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("service-customer")
.description("Demo project for Spring Boot")
.termsOfServiceUrl("https://localhostL8200")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("NFVO REST API")
.version("3.2.x")
.description(
"Below is a detailed description of the REST API of the OpenBaton Network Function Virtualization Orchestrator"
+ "(NFVO). \n"
+ "To send REST requests to the NFVO you first have to get a token which you then have to pass in the"
+ " header of every request. You can retrieve a token by executing this curl request: \n "
+ "curl -v -u openbatonOSClient:secret -X POST http://localhost:8080/oauth/token -H \"Accept:application/json\" -d \"username=admin&password=openbaton&grant_type=password\"")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("SwaggerUI演示")
.description("mall-tiny")
.contact("macro")
.version("1.0")
.build();
}
/**
* Api info api info.
*
* @return the api info
*/
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Swagger API")
.description("Myth分布式事务解决方案之SpringCloud测试体验")
.license("Apache 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.termsOfServiceUrl("")
.version(VERSION)
.contact(new Contact("xiaoyu", "", "[email protected]"))
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Restful API")
.description("REST API接口文档")
.contact(new Contact("imloama","https://github.com/imloama","[email protected]"))
.version("1.0")
.build();
}
/**
* This method will return the API info object to swagger which will in turn
* display the information on the swagger UI.
*
* @return the API information
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title(title)
.description(description)
.version(version)
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("mall后台系统")
.description("mall后台模块")
.contact("macro")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("mall前台系统")
.description("mall前台模块")
.contact("macro")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Lottor Server")
.description("Lottor UI接口描述")
.termsOfServiceUrl("http://blueskykong.com")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Our cool Zuul Edgeservice with dynamic Eureka-registered routes")
.description("Try it :)")
.version("0.0.1")
.build();
}
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();
}