This commit is contained in:
Liang Ding 2022-09-27 21:52:30 +08:00
parent 06b88df2dd
commit daa29df6fc
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 92 additions and 57 deletions

View file

@ -31,6 +31,20 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func getHeadingChildrenDOM(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)
dom := model.GetHeadingChildrenDOM(id)
ret.Data = dom
}
func getHeadingLevelTransaction(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)

View file

@ -148,6 +148,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/block/deleteBlock", model.CheckAuth, deleteBlock)
ginServer.Handle("POST", "/api/block/setBlockReminder", model.CheckAuth, setBlockReminder)
ginServer.Handle("POST", "/api/block/getHeadingLevelTransaction", model.CheckAuth, getHeadingLevelTransaction)
ginServer.Handle("POST", "/api/block/getHeadingChildrenDOM", model.CheckAuth, getHeadingChildrenDOM)
ginServer.Handle("POST", "/api/file/getFile", model.CheckAuth, getFile)
ginServer.Handle("POST", "/api/file/putFile", model.CheckAuth, putFile)