mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-04 22:51:47 +01:00
🧑💻 Add internal kernel API /api/attr/batchGetBlockAttrs https://github.com/siyuan-note/siyuan/issues/11786
This commit is contained in:
parent
17dce8ebd2
commit
675ad65bd1
5 changed files with 92 additions and 21 deletions
|
|
@ -33,6 +33,24 @@ func getBookmarkLabels(c *gin.Context) {
|
|||
ret.Data = model.BookmarkLabels()
|
||||
}
|
||||
|
||||
func batchGetBlockAttrs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
ids := arg["ids"].([]interface{})
|
||||
var idList []string
|
||||
for _, id := range ids {
|
||||
idList = append(idList, id.(string))
|
||||
}
|
||||
|
||||
ret.Data = model.BatchGetBlockAttrs(idList)
|
||||
}
|
||||
|
||||
func getBlockAttrs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/attr/setBlockAttrs", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setBlockAttrs)
|
||||
ginServer.Handle("POST", "/api/attr/batchSetBlockAttrs", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, batchSetBlockAttrs)
|
||||
ginServer.Handle("POST", "/api/attr/getBlockAttrs", model.CheckAuth, getBlockAttrs)
|
||||
ginServer.Handle("POST", "/api/attr/batchGetBlockAttrs", model.CheckAuth, batchGetBlockAttrs)
|
||||
|
||||
ginServer.Handle("POST", "/api/cloud/getCloudSpace", model.CheckAuth, model.CheckAdminRole, getCloudSpace)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue