mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-28 03:06:10 +01:00
🎨 Support exporting .sy.zip after selecting multiple documents https://github.com/siyuan-note/siyuan/issues/14484
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
315618a77c
commit
65532aec99
4 changed files with 51 additions and 20 deletions
|
|
@ -406,6 +406,27 @@ func exportNotebookSY(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
func exportSYs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
idsArg := arg["ids"].([]interface{})
|
||||
var ids []string
|
||||
for _, id := range idsArg {
|
||||
ids = append(ids, id.(string))
|
||||
}
|
||||
|
||||
zipPath := model.ExportSYs(ids)
|
||||
ret.Data = map[string]interface{}{
|
||||
"zip": zipPath,
|
||||
}
|
||||
}
|
||||
|
||||
func exportSY(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
@ -416,10 +437,9 @@ func exportSY(c *gin.Context) {
|
|||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
name, zipPath := model.ExportSY(id)
|
||||
zipPath := model.ExportSYs([]string{id})
|
||||
ret.Data = map[string]interface{}{
|
||||
"name": name,
|
||||
"zip": zipPath,
|
||||
"zip": zipPath,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/export/exportNotebookMd", model.CheckAuth, model.CheckAdminRole, exportNotebookMd)
|
||||
ginServer.Handle("POST", "/api/export/exportMds", model.CheckAuth, model.CheckAdminRole, exportMds)
|
||||
ginServer.Handle("POST", "/api/export/exportMd", model.CheckAuth, model.CheckAdminRole, exportMd)
|
||||
ginServer.Handle("POST", "/api/export/exportSYs", model.CheckAuth, model.CheckAdminRole, exportSYs)
|
||||
ginServer.Handle("POST", "/api/export/exportSY", model.CheckAuth, model.CheckAdminRole, exportSY)
|
||||
ginServer.Handle("POST", "/api/export/exportNotebookSY", model.CheckAuth, model.CheckAdminRole, exportNotebookSY)
|
||||
ginServer.Handle("POST", "/api/export/exportMdContent", model.CheckAuth, model.CheckAdminRole, exportMdContent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue