update: 更新api文档

This commit is contained in:
MarkusJoe
2022-11-11 18:47:47 +08:00
parent a52902f43e
commit cf2e7005ee
1 file changed
+37 -15
+36 -14
View File
@@ -1,10 +1,12 @@
# 这里是API接口的开发文档 # 这里是API接口的开发文档
> 所有接口前缀都为`/api/` > 所有接口前缀都为`/api/`
> 返回类型除了 `export` 都是JSON > 返回类型除了 `export` 都是RESTFul风格的api
# 接口 # 接口
* 部分数据可能不同
## query ## query
* 参数: `name` * 参数: `name`
@@ -17,7 +19,12 @@ $ curl -X GET 'http://127.0.0.1/api/query/test'
```json ```json
{ {
"test": 0 "code": 200,
"time": 1668163249.493199,
"data": {
"name": "test",
"times": 26
}
} }
``` ```
@@ -29,14 +36,18 @@ $ curl -X GET 'http://127.0.0.1/api/query/test'
$ curl -X GET 'http://127.0.0.1/api/query-all/' $ curl -X GET 'http://127.0.0.1/api/query-all/'
``` ```
> 注: 如果使用`Redis`数据库则无法使用此API
### 返回数据 ### 返回数据
```json ```json
{ {
"test": 114514, "code": 200,
"test1": 1919810 "time": 1668163318.0312304,
"data": [
{
"name": "dasd",
"times": 26
}
]
} }
``` ```
@@ -52,16 +63,27 @@ $ curl -X GET 'http://127.0.0.1/api/query-theme/lewd'
### 返回数据 ### 返回数据
* 省略了部分数据
```json ```json
[ {
[ "code": 200,
0, "time": 1668163380.9702282,
"base64...", "data": [
45, {
100 "index": 0,
], "image": "...",
... "width": 68,
"height": 150
},
{
"index": 1,
"image": "...",
"width": 68,
"height": 150
}
] ]
}
``` ```
### export ### export