🎨 Add a kernel API /api/block/getBlockTreeInfos https://github.com/siyuan-note/siyuan/issues/11311

This commit is contained in:
Daniel 2024-05-09 23:20:28 +08:00
parent 5d47fe4e86
commit 7d73482cfa
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 120 additions and 22 deletions

View file

@ -29,6 +29,24 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func getBlockTreeInfos(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
var ids []string
idsArg := arg["ids"].([]interface{})
for _, id := range idsArg {
ids = append(ids, id.(string))
}
ret.Data = model.GetBlockTreeInfos(ids)
}
func getBlockSiblingID(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)