1、选择原因
- 个人比较懒惰,不想写注释。
- 不想引入依赖,侵入代码。
- 安全,不托管到外网,可以部署到内网。
- 可以离线下载。
最终选择yapi。
2、安装
官网地址:https://hellosean1025.github.io/yapi/index.html
安装方式如下:
内网部署
地址:https://hellosean1025.github.io/yapi/devops/index.html
对小白用户不是太友好。
docker部署
地址:https://github.com/fjc0k/docker-YApi
安装后访问地址
http://{ip}:40001
3、idea使用
安装插件easyapi
Preferences(Settings) > Plugins > Browse repositories... > find"EasyYapi" > Install Plugin
easyYap配置
从访问地址中获取token
idea配置用户相关信息
模板注释配置
类注释
* @className $className$
* @author geoffrey
* @date $DATE$
* @version V1.0
**/
方法注释
* @methodName: $methodName$ $params$
* @return: $return$
* @author: geoffrey
* @date: $date$
**/
4、easyYapi使用
导出当前选中文件或者文件夹所有接口
使用ExportYapi
生成效果
导出一个或多个的接口
使用Export Api
点击点击[?]按钮或者按回车键完成导出。
生成效果