This commit is contained in:
parent
448fed5532
commit
ad60a28278
3 changed files with 22 additions and 0 deletions
|
@ -31,6 +31,24 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func export2Liandi(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
err := model.Export2Liandi(id)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func exportDataInFolder(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
@ -236,6 +236,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/export/exportData", model.CheckAuth, exportData)
|
||||
ginServer.Handle("POST", "/api/export/exportDataInFolder", model.CheckAuth, exportDataInFolder)
|
||||
ginServer.Handle("POST", "/api/export/exportTempContent", model.CheckAuth, exportTempContent)
|
||||
ginServer.Handle("POST", "/api/export/export2Liandi", model.CheckAuth, export2Liandi)
|
||||
|
||||
ginServer.Handle("POST", "/api/import/importStdMd", model.CheckAuth, model.CheckReadonly, importStdMd)
|
||||
ginServer.Handle("POST", "/api/import/importData", model.CheckAuth, model.CheckReadonly, importData)
|
||||
|
|
|
@ -58,6 +58,9 @@ func Export2Liandi(id string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
sqlAssets := sql.QueryRootBlockAssets(id)
|
||||
err = uploadCloud(sqlAssets)
|
||||
|
||||
// 判断帖子是否已经存在,存在则使用更新接口
|
||||
foundArticle := false
|
||||
articleId := tree.Root.IALAttr("liandiArticleId")
|
||||
|
|
Loading…
Add table
Reference in a new issue