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:
Yingyi / 颖逸 2023-08-30 23:45:24 +08:00 committed by GitHub
parent dc3889b5b3
commit baa3ef0bb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 7 deletions

View file

@ -984,7 +984,24 @@
* `path`:工作空间路径下的文件路径
* 返回值
文件内容
* 响应状态码 `200`: 文件内容
* 响应状态码 `202`: 异常信息
```json
{
"code": 404,
"msg": "",
"data": null
}
```
* `code`: 非零的异常值
* `-1`: 参数解析错误
* `404`: 未找到 (文件不存在)
* `405`: 方法不被允许 (这是一个目录)
* `500`: 服务器错误 (文件查询失败 / 文件读取失败)
* `msg`: 一段描述错误的文本
### 写入文件