mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-30 13:28:48 +01:00
修改exportResources这个API的参数 (#10855)
* 修改exportResources这个API,使得能够同时识别path和paths参数 * 修改exportResources这个API的说明文档 * 设定exportResources这个API的paths参数是必须的 * 重新修改exportResources的参数示例 * 设定exportResources这个API的返回值为1
This commit is contained in:
parent
e6591d9e43
commit
ffc8b41c50
1 changed files with 9 additions and 4 deletions
|
|
@ -283,11 +283,16 @@ func exportResources(c *gin.Context) {
|
|||
name = time.Now().Format("export-2006-01-02_15-04-05") // 生成的 *.zip 文件主文件名
|
||||
}
|
||||
|
||||
if arg["paths"] == nil {
|
||||
ret.Code = 1
|
||||
ret.Data = ""
|
||||
ret.Msg = "paths is required"
|
||||
return
|
||||
}
|
||||
|
||||
var resourcePaths []string // 文件/文件夹在工作空间中的路径
|
||||
if nil != arg["paths"] {
|
||||
for _, resourcePath := range arg["paths"].([]interface{}) {
|
||||
resourcePaths = append(resourcePaths, resourcePath.(string))
|
||||
}
|
||||
for _, resourcePath := range arg["paths"].([]interface{}) {
|
||||
resourcePaths = append(resourcePaths, resourcePath.(string))
|
||||
}
|
||||
|
||||
zipFilePath, err := model.ExportResources(resourcePaths, name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue