Skip to content

Commit 1303efa

Browse files
authored
Docs: update API documentation (#346)
1 parent 05ee1dc commit 1303efa

File tree

18 files changed

+696
-3018
lines changed

18 files changed

+696
-3018
lines changed

docs/guide/api/admin/driver.md

+65-1,285
Large diffs are not rendered by default.

docs/guide/api/admin/meta.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ GET /api/admin/meta/list
3131
| per_page | query | string || 每页个数 |
3232
| Authorization | header | string || none |
3333

34-
> 返回示例
34+
### 返回示例
3535

3636
> 成功
3737
@@ -98,7 +98,7 @@ GET /api/admin/meta/get
9898
| id | query | string || 元信息id |
9999
| Authorization | header | string || none |
100100

101-
> 返回示例
101+
### 返回示例
102102

103103
> 成功
104104
@@ -185,7 +185,7 @@ POST /api/admin/meta/create
185185
| » readme | body | string || 说明 | none |
186186
| » r_sub | body | boolean || 说明是否应用到子文件夹 | none |
187187

188-
> 返回示例
188+
### 返回示例
189189

190190
> 成功
191191
@@ -251,7 +251,7 @@ POST /api/admin/meta/update
251251
| » readme | body | string || 说明 | none |
252252
| » r_sub | body | boolean || 说明是否应用到子文件夹 | none |
253253

254-
> 返回示例
254+
### 返回示例
255255

256256
> 成功
257257
@@ -290,7 +290,7 @@ POST /api/admin/meta/delete
290290
| id | query | string || | none |
291291
| Authorization | header | string || | none |
292292

293-
> 返回示例
293+
### 返回示例
294294

295295
> 成功
296296

docs/guide/api/admin/setting.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ GET /api/admin/setting/list
3232
| group | query | string || 1-站点;2-样式;3-预览;4-全局;7-单点登录 |
3333
| Authorization | header | string || none |
3434

35-
> 返回示例
35+
### 返回示例
3636

3737
> 成功
3838
@@ -134,7 +134,7 @@ GET /api/admin/setting/get
134134
| key | query | string || none |
135135
| Authorization | header | string || none |
136136

137-
> 返回示例
137+
### 返回示例
138138

139139
> 成功
140140
@@ -267,7 +267,7 @@ POST /api/admin/setting/save
267267
| Authorization | header | string || | none |
268268
| body | body | array[object] || 数组 | none |
269269

270-
> 返回示例
270+
### 返回示例
271271

272272
> 成功
273273
@@ -308,7 +308,7 @@ POST /api/admin/setting/delete
308308
| key | query | string || | none |
309309
| Authorization | header | string || | none |
310310

311-
> 返回示例
311+
### 返回示例
312312

313313
> 200 Response
314314
@@ -334,7 +334,7 @@ POST /api/admin/setting/reset_token
334334
| ------------- | ------ | ------ | ---- | ------ | ---- |
335335
| Authorization | header | string || | none |
336336

337-
> 返回示例
337+
### 返回示例
338338

339339
> 成功
340340
@@ -384,7 +384,7 @@ POST /api/admin/setting/set_aria2
384384
| » uri | body | string || aria2地址 | none |
385385
| » secret | body | string || aria2密钥 | none |
386386

387-
> 返回示例
387+
### 返回示例
388388

389389
> 成功
390390
@@ -434,7 +434,7 @@ POST /api/admin/setting/set_qbit
434434
| » url | body | string || qBittorrent链接 | none |
435435
| » seedtime | body | string || 做种时间 | none |
436436

437-
> 返回示例
437+
### 返回示例
438438

439439
> 成功
440440

docs/guide/api/admin/storage.md

+106-24
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ GET /api/admin/storage/list
3131
| per_page | query | string || 每页数目 |
3232
| Authorization | header | string || token |
3333

34-
> 返回示例
34+
### 返回示例
3535

3636
> 成功
3737
@@ -61,7 +61,7 @@ GET /api/admin/storage/list
6161
"down_proxy_url": ""
6262
}
6363
],
64-
"total": 5
64+
"total": 1
6565
}
6666
}
6767
```
@@ -112,7 +112,7 @@ POST /api/admin/storage/enable
112112
| id | query | integer || 存储id |
113113
| Authorization | header | string || token |
114114

115-
> 返回示例
115+
### 返回示例
116116

117117
> 成功
118118
@@ -151,7 +151,7 @@ POST /api/admin/storage/disable
151151
| id | query | string || 存储id |
152152
| Authorization | header | string || token |
153153

154-
> 返回示例
154+
### 返回示例
155155

156156
> 成功
157157
@@ -179,7 +179,7 @@ POST /api/admin/storage/disable
179179
| » message | string | true | none | 信息 | 信息 |
180180
| » data | null | true | none | data | data |
181181

182-
## POST 更新存储
182+
## POST 创建存储
183183

184184
POST /api/admin/storage/create
185185

@@ -205,22 +205,104 @@ POST /api/admin/storage/create
205205

206206
### 请求参数
207207

208-
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
209-
| ------------------ | ------ | ------- | ---- | ------------ | ------------ |
210-
| Authorization | header | string || | token |
211-
| body | body | object || | none |
212-
| » mount_path | body | string || 挂载路径 | 挂载路径 |
213-
| » order | body | integer || 排序 | 排序 |
214-
| » remark | body | string || 备注名 | 备注名 |
215-
| » cache_expiration | body | integer || 缓存过期时间 | 缓存过期时间 |
216-
| » web_proxy | body | boolean || web代理 | web代理 |
217-
| » webdav_policy | body | string || webdav策略 | webdav策略 |
218-
| » down_proxy_url | body | string || 下载代理 | 下载代理 |
219-
| » extract_folder | body | string || 提取目录 | 提取目录 |
220-
| » driver | body | string || 驱动 | 驱动 |
221-
| » addition | body | string || 额外信息 | 额外信息 |
222-
223-
> 返回示例
208+
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
209+
| ------------------ | ------ | ------- | ---- | ------------ | ----- |
210+
| Authorization | header | string || | token |
211+
| body | body | object || | none |
212+
| » id | body | string || ID | none |
213+
| » mount_path | body | string || 挂载路径 | none |
214+
| » order | body | integer || 排序 | none |
215+
| » driver | body | string || 驱动 | none |
216+
| » remark | body | string || 备注名 | none |
217+
| » cache_expiration | body | integer || 缓存过期时间 | none |
218+
| » status | body | string || | none |
219+
| » web_proxy | body | boolean || web代理 | none |
220+
| » webdav_policy | body | string || webdav策略 | none |
221+
| » down_proxy_url | body | string || 下载代理 | none |
222+
| » order_by | body | string || 排序方式 | none |
223+
| » extract_folder | body | string || 提取目录 | none |
224+
| » order_direction | body | string || 排序方向 | none |
225+
| » addition | body | string || 额外信息 | none |
226+
| » enable_sign | body | string || 启用签名 | none |
227+
228+
### 返回示例
229+
230+
> 成功
231+
232+
```json
233+
{
234+
"code": 200,
235+
"message": "success",
236+
"data": {
237+
"id": 7
238+
}
239+
}
240+
```
241+
242+
### 返回结果
243+
244+
| 状态码 | 状态码含义 | 说明 | 数据模型 |
245+
| ------ | ------------------------------------------------------- | ---- | -------- |
246+
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline |
247+
248+
### 返回数据结构
249+
250+
状态码 **200**
251+
252+
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
253+
| --------- | ------- | ---- | ---- | ------ | ------ |
254+
| » code | integer | true | none | 状态码 | 状态码 |
255+
| » message | string | true | none | 信息 | 信息 |
256+
| » data | object | true | none | data | data |
257+
| »» id | integer | true | none | | none |
258+
259+
## POST 更新存储
260+
261+
POST /api/admin/storage/update
262+
263+
> Body 请求参数
264+
265+
```json
266+
{
267+
"mount_path": "/lll",
268+
"order": 0,
269+
"remark": "",
270+
"cache_expiration": 30,
271+
"web_proxy": false,
272+
"webdav_policy": "native_proxy",
273+
"down_proxy_url": "",
274+
"extract_folder": "front",
275+
"enable_sign": false,
276+
"driver": "Local",
277+
"order_by": "name",
278+
"order_direction": "asc",
279+
"addition": "{\"root_folder_path\":\"/\",\"thumbnail\":false,\"thumb_cache_folder\":\"\",\"show_hidden\":true,\"mkdir_perm\":\"777\"}"
280+
}
281+
```
282+
283+
### 请求参数
284+
285+
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
286+
| ------------------ | ------ | ------- | ---- | ------------ | ----- |
287+
| Authorization | header | string || | token |
288+
| body | body | object || | none |
289+
| » id | body | string || ID | none |
290+
| » mount_path | body | string || 挂载路径 | none |
291+
| » order | body | integer || 排序 | none |
292+
| » driver | body | string || 驱动 | none |
293+
| » remark | body | string || 备注名 | none |
294+
| » cache_expiration | body | integer || 缓存过期时间 | none |
295+
| » status | body | string || | none |
296+
| » web_proxy | body | boolean || web代理 | none |
297+
| » webdav_policy | body | string || webdav策略 | none |
298+
| » down_proxy_url | body | string || 下载代理 | none |
299+
| » order_by | body | string || 排序方式 | none |
300+
| » extract_folder | body | string || 提取目录 | none |
301+
| » order_direction | body | string || 排序方向 | none |
302+
| » addition | body | string || 额外信息 | none |
303+
| » enable_sign | body | string || 启用签名 | none |
304+
305+
### 返回示例
224306

225307
> 成功
226308
@@ -262,7 +344,7 @@ GET /api/admin/storage/get
262344
| id | query | string || | 存储id |
263345
| Authorization | header | string || | token |
264346

265-
> 返回示例
347+
### 返回示例
266348

267349
> 成功
268350
@@ -334,7 +416,7 @@ POST /api/admin/storage/delete
334416
| id | query | string || | 存储id |
335417
| Authorization | header | string || | token |
336418

337-
> 返回示例
419+
### 返回示例
338420

339421
> 成功
340422
@@ -372,7 +454,7 @@ POST /api/admin/storage/load_all
372454
| ------------- | ------ | ------ | ---- | ------ | ---- |
373455
| Authorization | header | string || | none |
374456

375-
> 返回示例
457+
### 返回示例
376458

377459
> 成功
378460

docs/guide/api/admin/task.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ POST /api/admin/task/upload/info
5454
| tid | query | string | no | 任务id |
5555
| Authorization | header | string | yes | none |
5656

57-
> 返回示例
57+
### 返回示例
5858

5959
> 成功
6060
@@ -107,7 +107,7 @@ GET /api/admin/task/upload/done
107107
| ------------- | ------ | ------ | ---- | ---- |
108108
| Authorization | header | string || none |
109109

110-
> 返回示例
110+
### 返回示例
111111

112112
> 成功
113113
@@ -160,7 +160,7 @@ GET /api/admin/task/upload/undone
160160
| ------------- | ------ | ------ | ---- | ---- |
161161
| Authorization | header | string || none |
162162

163-
> 返回示例
163+
### 返回示例
164164

165165
> 成功
166166
@@ -214,7 +214,7 @@ POST /api/admin/task/upload/delete
214214
| tid | query | string || 任务id |
215215
| Authorization | header | string || none |
216216

217-
> 返回示例
217+
### 返回示例
218218

219219
> 成功
220220
@@ -253,7 +253,7 @@ POST /api/admin/task/upload/cancel
253253
| tid | query | string || 任务id |
254254
| Authorization | header | string || none |
255255

256-
> 返回示例
256+
### 返回示例
257257

258258
> 成功
259259
@@ -291,7 +291,7 @@ POST /api/admin/task/upload/clear_done
291291
| ------------- | ------ | ------ | ---- | ---- |
292292
| Authorization | header | string || none |
293293

294-
> 返回示例
294+
### 返回示例
295295

296296
> 成功
297297
@@ -329,7 +329,7 @@ POST /api/admin/task/upload/clear_succeeded
329329
| ------------- | ------ | ------ | ---- | ---- |
330330
| Authorization | header | string || none |
331331

332-
> 返回示例
332+
### 返回示例
333333

334334
> 成功
335335
@@ -368,7 +368,7 @@ POST /api/admin/task/upload/retry
368368
| tid | query | string || 任务id |
369369
| Authorization | header | string || none |
370370

371-
> 返回示例
371+
### 返回示例
372372

373373
> 成功
374374

0 commit comments

Comments
 (0)