mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 05:20:53 +08:00
🎨 提供读写文件 API https://github.com/siyuan-note/siyuan/issues/4343
This commit is contained in:
parent
02f9915fb0
commit
561e722f6d
38
API.md
38
API.md
@ -771,7 +771,43 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
|
|||||||
|
|
||||||
### Render a template
|
### Render a template
|
||||||
|
|
||||||
/template/render
|
/api/template/render
|
||||||
|
|
||||||
|
## File
|
||||||
|
|
||||||
|
### Get file
|
||||||
|
|
||||||
|
* `/api/file/getFile`
|
||||||
|
* Parameters
|
||||||
|
|
||||||
|
``json
|
||||||
|
{
|
||||||
|
"path": "/data/20210808180117-6v0mkxr/20200923234011-ieuun1p.sy"
|
||||||
|
}
|
||||||
|
``
|
||||||
|
* `path`: the file path under the workspace path
|
||||||
|
* Return value
|
||||||
|
|
||||||
|
File content
|
||||||
|
|
||||||
|
### Put file
|
||||||
|
|
||||||
|
* `/api/file/putFile`
|
||||||
|
* The parameter is an HTTP Multipart form
|
||||||
|
|
||||||
|
* `path`: the file path under the workspace path
|
||||||
|
* `isDir`: whether to create a folder, when `true` only create a folder, ignore `file`
|
||||||
|
* `modTime`: last access and modification time, Unix time
|
||||||
|
* `file`: the uploaded file
|
||||||
|
* return value
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"msg": "",
|
||||||
|
"data": null
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Export
|
## Export
|
||||||
|
|
||||||
|
@ -774,7 +774,7 @@
|
|||||||
|
|
||||||
### 渲染模板
|
### 渲染模板
|
||||||
|
|
||||||
/template/render
|
/api/template/render
|
||||||
|
|
||||||
## 文件
|
## 文件
|
||||||
|
|
||||||
@ -800,7 +800,7 @@
|
|||||||
|
|
||||||
* `path`:工作空间路径下的文件路径
|
* `path`:工作空间路径下的文件路径
|
||||||
* `isDir`:是否为创建文件夹,为 `true` 时仅创建文件夹,忽略 `file`
|
* `isDir`:是否为创建文件夹,为 `true` 时仅创建文件夹,忽略 `file`
|
||||||
* `modTime`:最近访问时间,Unix time
|
* `modTime`:最近访问和修改时间,Unix time
|
||||||
* `file`:上传的文件
|
* `file`:上传的文件
|
||||||
* 返回值
|
* 返回值
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user