This commit is contained in:
Liang Ding 2023-02-27 15:52:45 +08:00
parent b57010d449
commit 880ed3d6f9
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 69 additions and 1 deletions

View file

@ -27,6 +27,25 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func getNotebookRiffCards(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
notebookID := arg["id"].(string)
page := int(arg["page"].(float64))
blockIDs, total, pageCount := model.GetNotebookFlashcards(notebookID, page)
ret.Data = map[string]interface{}{
"blocks": blockIDs,
"total": total,
"pageCount": pageCount,
}
}
func getTreeRiffCards(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)