mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
🧑💻 Add internal kernel API /api/av/getAttributeViewBoundBlockIDs and getAttributeViewItemIDs https://github.com/siyuan-note/siyuan/issues/15708
This commit is contained in:
parent
3c8c096d83
commit
ab66716178
3 changed files with 82 additions and 0 deletions
|
|
@ -27,6 +27,44 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func getAttributeViewItemIDsByBoundIDs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
avID := arg["avID"].(string)
|
||||
blockIDsArg := arg["blockIDs"].([]interface{})
|
||||
var blockIDs []string
|
||||
for _, v := range blockIDsArg {
|
||||
blockIDs = append(blockIDs, v.(string))
|
||||
}
|
||||
|
||||
ret.Data = model.GetAttributeViewItemIDs(avID, blockIDs)
|
||||
}
|
||||
|
||||
func getAttributeViewBoundBlockIDsByItemIDs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
avID := arg["avID"].(string)
|
||||
itemIDsArg := arg["itemIDs"].([]interface{})
|
||||
var itemIDs []string
|
||||
for _, v := range itemIDsArg {
|
||||
itemIDs = append(itemIDs, v.(string))
|
||||
}
|
||||
|
||||
ret.Data = model.GetAttributeViewBoundBlockIDs(avID, itemIDs)
|
||||
}
|
||||
|
||||
// getAttributeViewAddingBlockDefaultValues 用于获取添加块时的默认值。
|
||||
// 存在过滤或分组条件时,添加块时需要填充默认值到过滤字段或分组字段中,前端需要调用该接口来获取这些默认值以便填充。
|
||||
func getAttributeViewAddingBlockDefaultValues(c *gin.Context) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue