🎨 Add Rollup column to database table view https://github.com/siyuan-note/siyuan/issues/9958

This commit is contained in:
Daniel 2023-12-29 09:54:54 +08:00
parent 50156a0dc9
commit e29b674301
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 78 additions and 0 deletions

View file

@ -26,6 +26,42 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func searchAttributeViewNonRelationKey(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, _ := util.JsonArg(c, ret)
if nil == arg {
return
}
avID := arg["avID"].(string)
keyword := arg["keyword"].(string)
nonRelationKeys := model.SearchAttributeViewNonRelationKey(avID, keyword)
ret.Data = map[string]interface{}{
"nonRelationKeys": nonRelationKeys,
}
}
func searchAttributeViewRelationKey(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, _ := util.JsonArg(c, ret)
if nil == arg {
return
}
avID := arg["avID"].(string)
keyword := arg["keyword"].(string)
relationKeys := model.SearchAttributeViewRelationKey(avID, keyword)
ret.Data = map[string]interface{}{
"relationKeys": relationKeys,
}
}
func getAttributeView(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)