🎨 Database block supports export as CSV https://github.com/siyuan-note/siyuan/issues/10072

This commit is contained in:
Daniel 2024-01-04 11:52:43 +08:00
parent 88d3eb4a00
commit 97012e75c6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 61 additions and 7 deletions

View file

@ -33,6 +33,29 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func exportAttributeView(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
avID := arg["id"].(string)
zipPath, err := model.ExportAv2CSV(avID)
if nil != err {
ret.Code = 1
ret.Msg = err.Error()
ret.Data = map[string]interface{}{"closeTimeout": 7000}
return
}
ret.Data = map[string]interface{}{
"zip": zipPath,
}
}
func exportEPUB(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)