🎨 提供读写文件 API https://github.com/siyuan-note/siyuan/issues/4343
This commit is contained in:
parent
539c4d9781
commit
02f9915fb0
1 changed files with 40 additions and 1 deletions
41
API_zh_CN.md
41
API_zh_CN.md
|
@ -36,6 +36,9 @@
|
|||
* [渲染模板](#渲染模板)
|
||||
* [导出](#导出)
|
||||
* [导出 Markdown 文本](#导出-markdown-文本)
|
||||
* [文件](#文件)
|
||||
* [获取文件](#获取文件)
|
||||
* [写入文件](#写入文件)
|
||||
* [系统](#系统)
|
||||
* [获取启动进度](#获取启动进度)
|
||||
* [获取系统版本](#获取系统版本)
|
||||
|
@ -432,7 +435,7 @@
|
|||
}
|
||||
```
|
||||
|
||||
* `id`:块 ID
|
||||
* `id`:块 ID
|
||||
* 返回值
|
||||
|
||||
```json
|
||||
|
@ -773,6 +776,42 @@
|
|||
|
||||
/template/render
|
||||
|
||||
## 文件
|
||||
|
||||
### 获取文件
|
||||
|
||||
* `/api/file/getFile`
|
||||
* 参数
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "/data/20210808180117-6v0mkxr/20200923234011-ieuun1p.sy"
|
||||
}
|
||||
```
|
||||
* `path`:工作空间路径下的文件路径
|
||||
* 返回值
|
||||
|
||||
文件内容
|
||||
|
||||
### 写入文件
|
||||
|
||||
* `/api/file/putFile`
|
||||
* 参数为 HTTP Multipart 表单
|
||||
|
||||
* `path`:工作空间路径下的文件路径
|
||||
* `isDir`:是否为创建文件夹,为 `true` 时仅创建文件夹,忽略 `file`
|
||||
* `modTime`:最近访问时间,Unix time
|
||||
* `file`:上传的文件
|
||||
* 返回值
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "",
|
||||
"data": null
|
||||
}
|
||||
```
|
||||
|
||||
## 导出
|
||||
|
||||
### 导出 Markdown 文本
|
||||
|
|
Loading…
Add table
Reference in a new issue