-
Notifications
You must be signed in to change notification settings - Fork 31
javayh swagger starter 说明
haiji.yang edited this page May 6, 2020
·
4 revisions
javayh-swagger-starter是本项目API文档管理中心
这里以Demo案例为编写条件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-demo</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>javayh-demo-api</artifactId>
<dependencies>
<dependency>
<groupId>com.javayh</groupId>
<artifactId>javayh-swagger-starter</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>
依赖引入后,即可计入开发阶段
需要在启动配添加 @EnableAutoSwagger注解
案例如下:
@EnableAutoSwagger
@JavayhBootApplication
public class ApiApplication {
public static void main(String[] args) {
SpringApplication.run(ApiApplication.class, args);
}
}
启动项目进行api文档访问:ip:port/doc.html
关于swagger与gateway配置详情查看 https://github.com/Dylan-haiji/javayh-platform/blob/master/javayh-route/javayh-api-gateway/src/main/resources/bootstrap.yml
......未完待续......
关注 Java有货领取更多资料 联系小编。微信:372787553,带您进群互相学习 左侧小编微信,右侧获取免费资料
- SpringCloud 自定义封装架构https://github.com/Dylan-haiji/javayh-platform
- Java 设计模式学习代码 https://github.com/Dylan-haiji/design-pattern
- SpringCloud学习代码: https://github.com/Dylan-haiji/javayh-cloud
- AlibabaCloud学习代码:https://github.com/Dylan-haiji/javayh-cloud-nacos
- SpringBoot+Mybatis 多数据源切换:https://github.com/Dylan-haiji/javayh-boot-data-soure
- Redis、Mongo、Rabbitmq、Kafka学习代码: https://github.com/Dylan-haiji/javayh-middleware
- SpringBoot+SpringSecurity实现自定义登录学习代码:https://github.com/Dylan-haiji/javayh-distribution