mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 03:48:48 +01:00
🎨 Add kernel API /api/riff/getRiffCardsByBlockIDs Fix https://github.com/siyuan-note/siyuan/issues/10535
This commit is contained in:
parent
d55dcf1bf7
commit
e083dacca8
4 changed files with 54 additions and 4 deletions
|
|
@ -27,6 +27,33 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func getRiffCardsByBlockIDs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
blockIDsArg := arg["blockIDs"].([]interface{})
|
||||
var blockIDs []string
|
||||
for _, blockID := range blockIDsArg {
|
||||
blockIDs = append(blockIDs, blockID.(string))
|
||||
}
|
||||
page := int(arg["page"].(float64))
|
||||
pageSize := 20
|
||||
if nil != arg["pageSize"] {
|
||||
pageSize = int(arg["pageSize"].(float64))
|
||||
}
|
||||
|
||||
blocks, total, pageCount := model.GetFlashcardsByBlockIDs(blockIDs, page, pageSize)
|
||||
ret.Data = map[string]interface{}{
|
||||
"blocks": blocks,
|
||||
"total": total,
|
||||
"pageCount": pageCount,
|
||||
}
|
||||
}
|
||||
|
||||
func batchSetRiffCardsDueTime(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue