gtsoft-snail-job-demo/src/main/java/com/example/easy/retry/config/SwaggerConfig.java

56 lines
2.1 KiB
Java
Raw Normal View History

2023-09-02 17:24:47 +08:00
package com.example.easy.retry.config;
import com.aizuda.easy.retry.common.core.util.EasyRetryVersion;
2023-09-03 23:49:11 +08:00
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
2023-09-02 17:24:47 +08:00
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
2023-09-03 23:49:11 +08:00
2023-09-02 17:24:47 +08:00
/**
* @author: www.byteblogs.com
* @date : 2023-07-17 18:19
* @since 2.1.0
*/
@Configuration
public class SwaggerConfig {
2023-09-03 23:49:11 +08:00
@Bean
public OpenAPI springShopOpenAPI() {
return new OpenAPI()
.info(new Info()
.title("Easy Retry Example")
.description("<h1>EasyRetry是致力提高分布式业务系统一致性的分布式重试平台</h1> \n" +
2023-09-02 17:35:18 +08:00
"<h3>官网地址: https://www.easyretry.com/</h3>" +
"<h3>在线体验地址: http://preview.easyretry.com/</h3> " +
"<h3>源码地址: https://gitee.com/byteblogs168/easy-retry-demo</h3>" +
2023-09-03 23:49:11 +08:00
"<h3>特别提醒: 🌻在您使用测试案例之前请认真的阅读官网.</h3>")
.version(EasyRetryVersion.getVersion())
.license(new License().name("Apache 2.0").url("https://www.easyretry.com/")))
.externalDocs(new ExternalDocumentation()
.description("视频教程:从0到1快速了解分布式重试组件EasyRetry")
.url("https://www.ixigua.com/pseries/7272009348824433213/"))
;
}
2023-09-02 17:35:18 +08:00
2023-09-03 23:49:11 +08:00
@Bean
public GroupedOpenApi adminApi() {
return GroupedOpenApi.builder()
//分组名
.group("user")
.pathsToMatch("/**")
//扫描路径将路径下有swagger注解的接口解析到文档中
.packagesToScan("com.example.easy.retry.controller")
2023-09-02 17:35:18 +08:00
.build();
2023-09-02 17:24:47 +08:00
}
}