mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
Improve the response status code of kernel API /api/file/getFile (#9075)
* 🎨 Improve the response status code of API `/api/file/getFile`
* refactor: change status code from `204` to `202`
This commit is contained in:
parent
dc3889b5b3
commit
baa3ef0bb4
3 changed files with 41 additions and 7 deletions
19
API_zh_CN.md
19
API_zh_CN.md
|
|
@ -984,7 +984,24 @@
|
|||
* `path`:工作空间路径下的文件路径
|
||||
* 返回值
|
||||
|
||||
文件内容
|
||||
* 响应状态码 `200`: 文件内容
|
||||
* 响应状态码 `202`: 异常信息
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 404,
|
||||
"msg": "",
|
||||
"data": null
|
||||
}
|
||||
```
|
||||
|
||||
* `code`: 非零的异常值
|
||||
|
||||
* `-1`: 参数解析错误
|
||||
* `404`: 未找到 (文件不存在)
|
||||
* `405`: 方法不被允许 (这是一个目录)
|
||||
* `500`: 服务器错误 (文件查询失败 / 文件读取失败)
|
||||
* `msg`: 一段描述错误的文本
|
||||
|
||||
### 写入文件
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue