🎨 Add internal kernel API /api/riff/batchSetRiffCardsDueTime https://github.com/siyuan-note/siyuan/issues/10423

This commit is contained in:
Daniel 2024-02-24 22:04:36 +08:00
parent 3ec2ff243f
commit 285eb12b48
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 78 additions and 12 deletions

View file

@ -27,6 +27,31 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func batchSetRiffCardsDueTime(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
var cardDues []*model.SetFlashcardDueTime
for _, cardDueArg := range arg["cardDues"].([]interface{}) {
cardDue := cardDueArg.(map[string]interface{})
cardDues = append(cardDues, &model.SetFlashcardDueTime{
ID: cardDue["id"].(string),
Due: cardDue["due"].(string),
})
}
err := model.SetFlashcardsDueTime(cardDues)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
}
}
func resetRiffCards(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)