SpringCloud-Swagger

Swagger 整合knife4j

ruoyi-cloud/cloud/swagger

knife4j

Spring Cloud Gateway集成Knife4j

在xkiot-common-swagger的pom.xml添加如下依赖

1
2
3
4
5
 <dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-micro-spring-boot-starter</artifactId>
<version>2.0.8</version>
</dependency>

然后在xkiot-gateway的pom.xml添加如下依赖

1
2
3
4
5
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>2.0.8</version>
</dependency>

原生swagger访问http://{网关ip}:{port}/swagger-ui.html通过网关进行访问,里面可以进行选择切换服务

整合knife4j后访问http://{网关ip}:{port}/doc.html