🎨 Add API /api/export/exportResources to export files and folders (#8841)

This commit is contained in:
Yingyi / 颖逸 2023-07-28 16:48:17 +08:00 committed by GitHub
parent 9ee922794e
commit 0c7e16e558
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 162 additions and 0 deletions

View file

@ -47,6 +47,7 @@
* [列出文件](#列出文件)
* [导出](#导出)
* [导出 Markdown 文本](#导出-markdown-文本)
* [导出文件与目录](#导出文件与目录)
* [转换](#转换)
* [Pandoc](#Pandoc)
* [通知](#通知)
@ -1110,6 +1111,45 @@
* `hPath`:人类可读的路径
* `content`Markdown 内容
### 导出文件与目录
* `/api/export/exportResources`
* 参数
```json
{
"paths": [
"/conf/appearance/boot",
"/conf/appearance/langs",
"/conf/appearance/emojis/conf.json",
"/conf/appearance/icons/index.html",
],
"name": "zip-file-name"
}
```
* `paths`:要导出的文件或文件夹路径列表,相同名称的文件/文件夹会被覆盖
* `name`:(可选)导出的文件名,未设置时默认为 `export-YYYY-MM-DD_hh-mm-ss.zip`
* 返回值
```json
{
"code": 0,
"msg": "",
"data": {
"path": "temp/export/zip-file-name.zip"
}
}
```
* `path`:创建的 `*.zip` 文件路径
* `zip-file-name.zip` 中的目录结构如下所示:
* `zip-file-name`
* `boot`
* `langs`
* `conf.json`
* `index.html`
## 转换
### Pandoc