-
Notifications
You must be signed in to change notification settings - Fork 9
/
api-doc.html
132 lines (98 loc) · 7.23 KB
/
api-doc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<html>
<header>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="zh-CN" />
<link href="https://cdn.bootcss.com/jquery-jsonview/1.2.3/jquery.jsonview.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/github-markdown-css/3.0.1/github-markdown.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<style>
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
@media (max-width: 767px) {
.markdown-body {
padding: 15px;
}
}
</style>
</header>
<body class='markdown-body'>
<h1>API Markdown 文档,源于<a href="https://github.com/china-wangyu/TRR">TRR</a>的美好生活💑。</h1>
<h2><code>TOC</code>目录</h2>
<ul>
<li><p><a href="#app\api\controller\Auth:授权类">app\api\controller\Auth:授权类</a></p><ul><p><a href="#create:创建授权">create:创建授权</a></p><p><a href="#refresh:刷新授权">refresh:刷新授权</a></p></ul></li><li><p><a href="#app\api\controller\v1\Book:图书类">app\api\controller\v1\Book:图书类</a></p><ul><p><a href="#create:创建图书">create:创建图书</a></p></ul></li></ul>
<h2><code>API</code>内容</h2>
<h3><span id="app\api\controller\Auth:授权类">app\api\controller\Auth:授权类</span></h3>
<h4><span id="create:创建授权">create:创建授权</span></h4>
<ul><li><p>[url] : <code>auth/</code></p></li><li><p>[method] : <code>post</code></p></li><li><p>[params] : <code>请求参数文档</code></p><table><thead>
<tr>
<th style="text-align: center;">参数名称</th>
<th style="text-align: center;">参数文档</th>
<th style="text-align: center;">参数 <code>filter</code></th>
<th style="text-align: center;">参数默认</th>
</tr>
</thead><tbody><tr>
<td style="text-align: center;">password</td>
<td style="text-align: center;">密码</td>
<td style="text-align: center;">require</td>
<td style="text-align: center;"></td>
</tr><tr>
<td style="text-align: center;">name</td>
<td style="text-align: center;">名称</td>
<td style="text-align: center;">require</td>
<td style="text-align: center;"></td>
</tr></tbody></table></li><p>[success] : <code>成功返回样例</code></p><pre><code id="result" class="language-json5">{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJUUlIiLCJpYXQiOjE1NjQwNDc4ODcsImV4cCI6MTU2NDA1NTA4NywidXVpZCI6MTAwLCJzaWduYXR1cmUiOiIxMiJ9.QAvjERUOvQ2QwUcPnQOJuYGuTDgzWCZ7gaNziJHDmVI","refresh_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJUUlIiLCJpYXQiOjE1NjQwNDc4ODcsInV1aWQiOjEwMCwic2lnbmF0dXJlIjoiMTIifQ.n-TZSFr9NqaTIjWpxR3ZUeP7WobYrhYvS5lIVkxRaIM"}</code></pre>
<p>[error] : <code>失败返回样例</code></p><pre><code id="result" class="language-json5">{"code":3000,"message":"3000: \u9519\u8bef\u5185\u5bb9 . \u53c2\u6570\u9a8c\u8bc1 . name\u4e0d\u80fd\u4e3a\u7a7a,password\u4e0d\u80fd\u4e3a\u7a7a","request_url":"auth"}</code></pre>
</ul>
<h4><span id="refresh:刷新授权">refresh:刷新授权</span></h4>
<ul><li><p>[url] : <code>auth/refresh</code></p></li><li><p>[method] : <code>get</code></p></li><li><p>[params] : <code>请求参数文档</code></p><table><thead>
<tr>
<th style="text-align: center;">参数名称</th>
<th style="text-align: center;">参数文档</th>
<th style="text-align: center;">参数 <code>filter</code></th>
<th style="text-align: center;">参数默认</th>
</tr>
</thead><tbody></tbody></table></li><p>[success] : <code>成功返回样例</code></p><pre><code id="result" class="language-json5">{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJUUlIiLCJpYXQiOjE1NjQxMDY2ODAsImV4cCI6MTU2NDExMzg4MCwidXVpZCI6MTAwLCJzaWduYXR1cmUiOiIyMyJ9.1Te9jeAQVvj6VbgiVEk1-CChn8KybpOXqiyH8a4UB68"}</code></pre>
<p>[error] : <code>失败返回样例</code></p><pre><code id="result" class="language-json5">{"code":3000,"message":"3000: \u9519\u8bef\u5185\u5bb9 . 1000: \u9519\u8bef\u5185\u5bb9 . \u8bf7\u6c42header\u672a\u643a\u5e26authorization\u4fe1\u606f","request_url":"auth\/refresh"}</code></pre>
</ul>
<h3><span id="app\api\controller\v1\Book:图书类">app\api\controller\v1\Book:图书类</span></h3>
<h4><span id="create:创建图书">create:创建图书</span></h4>
<ul><li><p>[url] : <code>v1/book/</code></p></li><li><p>[method] : <code>get</code></p></li><li><p>[params] : <code>请求参数文档</code></p><table><thead>
<tr>
<th style="text-align: center;">参数名称</th>
<th style="text-align: center;">参数文档</th>
<th style="text-align: center;">参数 <code>filter</code></th>
<th style="text-align: center;">参数默认</th>
</tr>
</thead><tbody><tr>
<td style="text-align: center;">img</td>
<td style="text-align: center;">图书img</td>
<td style="text-align: center;">require|graph|length:1,16</td>
<td style="text-align: center;"></td>
</tr><tr>
<td style="text-align: center;">name</td>
<td style="text-align: center;">图书名称</td>
<td style="text-align: center;">require|graph|length:1,50</td>
<td style="text-align: center;"></td>
</tr></tbody></table></li><p>[success] : <code>成功返回样例</code></p><pre><code id="result" class="language-json5"></code></pre>
<p>[error] : <code>失败返回样例</code></p><pre><code id="result" class="language-json5"></code></pre>
</ul>
<h1> 感谢🙏使用<a href="https://github.com/china-wangyu/TRR">TRR</a>,祝你生活美满~</h1>
<script src="https://cdn.bootcss.com/jquery-jsonview/1.2.3/jquery.jsonview.min.js"></script>
<script>
//页面加载json格式化
$(function () {
$(".language-json5").each(function (i) {
console.log($(this))
var json = $(this).html();
if (json != '' && json != 'undefined'){
$(this).JSONView(json);
}
})
});
</script>