From 02f9915fb0a2335382dabd483b10afcea127bbee Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 24 Mar 2022 00:08:33 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=8F=90=E4=BE=9B=E8=AF=BB=E5=86=99?= =?UTF-8?q?=E6=96=87=E4=BB=B6=20API=20https://github.com/siyuan-note/siyua?= =?UTF-8?q?n/issues/4343?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API_zh_CN.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/API_zh_CN.md b/API_zh_CN.md index d49451d27..4f6a8d3f2 100644 --- a/API_zh_CN.md +++ b/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 文本