mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
🎨 Add internal kernel API /api/riff/batchSetRiffCardsDueTime https://github.com/siyuan-note/siyuan/issues/10423
This commit is contained in:
parent
3ec2ff243f
commit
285eb12b48
5 changed files with 78 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue