|
@@ -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)
|