# spring-adorner **Repository Path**: dahezi/spring-adorner ## Basic Information - **Project Name**: spring-adorner - **Description**: spring mvc api接口文档生成利器 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: https://gitee.com/jaemon/spring-adorner - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2022-01-22 - **Last Updated**: 2022-06-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![Spring Adorner Logo](https://gitee.com/jaemon/docs/raw/master/spring_adorner.png)](https://github.com/Jaemon/spring-adorner) [![Jaemon/Spring-Adorner](https://gitee.com/Jaemon/spring-adorner/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b)](https://gitee.com/jaemon/spring-adorner) ![Gitee license](https://img.shields.io/maven-central/v/io.gitee.jaemon/spring-adorner) ![JDK](https://img.shields.io/badge/JDK-1.8+-green?logo=appveyor) ![springboot 2.4.5](https://img.shields.io/badge/support-springboot-green?logo=appveyor) [![Read the Docs](https://img.shields.io/readthedocs/pip)](https://gitee.com/jaemon/spring-adorner/wikis/Home?sort_id=3968671)

spring mvc api接口文档生成利器

为什么选择Spring Adorner? 开源社区已有[swagger-api](https://github.com/swagger-api)、[JApiDocs](https://github.com/YeDaxia/JApiDocs)等一系列非常优秀的api文档生成器开源项目,但是却也有其不足之处。 - [swagger-api](https://github.com/swagger-api): 代码侵入性强 - [JApiDocs](https://github.com/YeDaxia/JApiDocs): 生成的markdown格式的api文档格式不美观,无法定制化   Spring Adorner项目设立初衷是打造为一款纯API接口文档生成的轻量级工具 - 对代码无侵入性 - 使用简单便捷 - [丰富的功能特性支持](https://gitee.com/jaemon/spring-adorner/wikis/%E4%B8%8A%E4%B8%8B%E6%96%87%E5%AF%B9%E8%B1%A1%E5%B1%9E%E6%80%A7?sort_id=3968720) - 可定制化文档内容 - 轻量级的纯API接口文档生成器   > ★ **如果觉得项目对您的工作有帮助的话, 欢迎[Watch](https://gitee.com/jaemon/spring-adorner/watchers)、[Star](https://gitee.com/jaemon/spring-adorner/stargazers)、[Fork](https://gitee.com/jaemon/spring-adorner/members)三连击**   ## ☑ Quickly Start ### 引入Adorner依赖包 ```xml io.gitee.jaemon spring-adorner ${adorner.version} ``` > ☞ [adorner.version版本号取值](https://gitee.com/jaemon/spring-adorner/wikis/Upgrade%20Log)   ### 使用Adorner生成API接口文档 #### 不解析注释 ```java public class AdornerApplication { public static void main(String[] args) { // 指定API文档生成路径(包括文件名) String filePath = "/home/jaemon/api/api.md"; // 待扫描的API接口包路径(注意修改为实际项目中的包路径) String packageName = "io.gitee.jaemon.spring.adorner.contorller"; SpringAdornerStarter.generate(filePath, packageName); } } ``` #### 解析注释 ```java public class AdornerApplication { public static void main(String[] args) { // 指定API文档生成路径(包括文件名) String filePath = "/home/jaemon/api/api.md"; // 待扫描的API接口包路径(注意修改为实际项目中的包路径) String packageName = "io.gitee.jaemon.spring.adorner.contorller"; // 注释扫描器 DocScanner docScanner = DocScanner.of( // 需要解析注释的包路径 Lists.newArrayList("io.gitee.jaemon.spring.adorner.contorller", "io.gitee.jaemon.spring.adorner.entity") ); // 定义Adorner上下文配置对象 AdornerApplicationContext context = AdornerApplicationContext.builder() .docScanner(docScanner) .build(filePath, new String[]{packageName}); SpringAdornerStarter.generate(context); } } ```   ## ✉ Documentation, Getting Started and Developer Guides - [Spring-Adorner WIKI](https://gitee.com/jaemon/spring-adorner/wikis)   ## ✎ Upgrade Log - [版本变更日志](https://gitee.com/jaemon/spring-adorner/wikis/Upgrade%20Log)   ## ✍ Feedback - [有任何建议或问题欢迎提Issue~](https://gitee.com/jaemon/spring-adorner/issues)