当前位置:网站首页>Knife4j configuration can use direct copy
Knife4j configuration can use direct copy
2022-06-10 20:28:00 【Hehexue programming】
I won't say more nonsense , Go straight up maven rely on
<!-- knife4j Interface document -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
Then write a configuration class Knife4jConfig, To avoid the wrong package , I gave you my bag, too
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class Knife4jConfig {
@Bean(value = "defaultApi2")
public Docket defaultApi2() {
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(new ApiInfoBuilder()
.title("xxx Interface specification ")
.description("xxx Interface description ")
.termsOfServiceUrl("http://www.xx.com/")
.contact(new Contact("xxx company ", "http://xxx.com/", "[email protected]"))
.version("1.0")
.build())
// Group name
.groupName("2.X edition ")
.select()
// Designated here Controller Scan package path
.apis(RequestHandlerSelectors.basePackage("com.xxx.controller"))
.paths(PathSelectors.any())
.build();
return docket;
}
}
Run project access http://localhost:8080/doc.html
边栏推荐
- C language floating point number storage form
- 20192407 2021-2022-2 《网络与系统攻防技术》实验八实验报告
- FPGA状态机
- Unity 分析内置地形(Terrain)的渲染并做一些有意思的事情
- 用一个性能提升了666倍的小案例说明在TiDB中正确使用索引的重要性
- The national advanced computing industry innovation (Yichang) center was officially launched and jointly operated by Zhongke Shuguang and Shengzhe technologies
- 【legendre】多项式
- Recording a super Oolong mental retardation bug may help people like me eat for free
- Analysis on rendering principle of mobile terminal
- 国庆期间给大家推荐一个可能会成为2019最佳的CRUD工具
猜你喜欢

hidden danger? Limited meaning? Can't stop the real cooking Mini kitchenware hot 618

vulnhub-The Planets: Earth

【观察】昇腾智行:场景驱动,创新先行,为智慧交通按下“加速键”

8.4v双节锂电池专业充电ic(FS4062A)

传音 Infinix 新机现身谷歌产品库,TECNO CAMON 19 预装 Android 13

首批!青藤通过信通院CWPP能力评估检验

Microsoft Word 教程「5」,如何在 Word 中更改頁邊距、創建新聞稿欄?

RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1.

Redis集群形式--哨兵模式集群和高可用模式集群---Redis学习笔记003

暗黑破坏神不朽数据库怎么用 暗黑破坏神手游不朽数据库使用方法
随机推荐
RT-Thread Smart Win10 64位下编译环境的搭建
割舍绳子/整数分割
Fs2117 boost IC output 5v2.4a synchronous rectification
An old programmer of about 10 years said: simple crud function enters the era of codeless development 1. Adding, deleting, modifying and checking interface information
Basic instructions for ads and AXD
Tidb - quick start, cluster setup
Mysql database foundation
ESP8266 系统环境搭建
Zabbix_监控ssh/crond服务-微信告警
JD released ted-q, a large-scale and distributed quantum machine learning platform based on tensor network acceleration
【FAQ】运动健康服务REST API接口使用过程中常见问题和解决方法总结
[enter textbook latex record]
Redis集群形式--哨兵模式集群和高可用模式集群---Redis学习笔记003
Tencent cloud database tdsql- a big guy talks about the past, present and future of basic software
功耗开发经验分享:设计功耗大板
FS4100 锂电充电管理IC输入12V给8.4V充电IC
Unity 分析内置地形(Terrain)的渲染并做一些有意思的事情
零信任架构
mixin--混入
手写代码 bind