设为首页 加入收藏

TOP

接口文档神器--apiui的使用(一)
2019-08-15 23:32:40 】 浏览:35
Tags:接口 文档 神器 --apiui 使用

接口开发,最麻烦的就是写文档了,曾经我也因为写接口文档苦不堪言;自从使用了apiui接口文档神器,工作效率和文档清晰得到了不止一个档次的提升。

下面介绍一下这个神器的使用:

把文件下载下来,放在网站根目录;

链接:https://pan.baidu.com/s/1DaT_rUANaSoHVhy8BjtQRw 密码:atgu

更改index.html文件的三个参数;

然后打开api.json文件,添加对应的接口模块;

 1 {
 2     "apiVersion":"0.2",
 3     "swaggerVersion":"1.1",
 4     "apis":[
 5     {
 6         "path":"/fellow.{format}",
 7         "description":"会员详情"
 8     },
 9     {
10         "path":"/red_packet.{format}",
11         "description":"红包"
12     }
13 
14     ]
15 }

apis下面一组数据对应就是一个模块;

path参数是模块名,description参数是模块别名,一个模块对应api文件夹下的一个json文件;

 

 然后就编辑api下面的json文件,

  1 {
  2     "apiVersion":"0.2",
  3     "swaggerVersion":"1.1",
  4     "resourcePath":"/",
  5     "apis":[
  6     {
  7         "path":"/fellow_info",
  8         "operations":[
  9         {
 10             "description":"",
 11             "updateTime":"2018/4/12 22:17",
 12             "httpMethod":"GET",
 13             "summary":"会员资料",
 14             "apiStatus":2,
 15             "reviser":"完成",
 16             "responseClass":"void",
 17             "nickname":"test0",
 18             "revisionHighlight":true,
 19             "fieldDesc":{
 20                 "result@string":"请求返回的状态1成功0失败",
 21                 "message@string":"提示信息",
 22                 "data@string":"返回的数据",
 23                 "nickname@string":"昵称",
 24                 "sex@string":"性别",
 25                 "tel@string":"手机号",
 26                 "label@string":"标签",
 27                 "remark@string":"备注",
 28                 "industry@string":"行业",
 29                 "company@string":"所在公司",
 30                 "position@string":"职位",
 31                 "region@string":"地区",
 32                 "email@string":"邮箱",
 33                 "qq_account@string":"QQ号",
 34                 "wx_account@string":"微信号",
 35                 "identity@string":"身份"
 36                
 37                 },
 38             "parameters":[
 39             
 40             {
 41                 "description":"用户id",
 42                 "paramType":"body",
 43                 "required":true,
 44                 "allowMultiple":false,
 45                 "dataType":"uid"
 46             }
 47             ]
 48         }
 49         ]
 50     },
 51     {
 52         "path":"/upd_fellow_info",
 53         "operations":[
 54         {
 55             "description":"",
 56             "updateTime":"2018/4/12 22:17",
 57             "httpMethod":"GET",
 58             "summary":"编辑会员资料",
 59             "apiStatus":2,
 60             "reviser":"完成",
 61             "responseClass":"void",
 62             "nickname":"test1",
 63             "revisionHighlight":true,
 64             "fieldDesc":{
 65                 "result@string":"请求返回的状态1成功0失败",
 66                 "message@string":"提示信息",
 67                 "data@string":"返回的数据"
 68                
 69                 },
 70             "parameters":[
 71             
 72             {
 73                 &quo
首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇List排序方法 下一篇介绍几个PHP 自带的加密解密函数

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目