This commit is contained in:
Liang Ding 2023-03-10 09:37:59 +08:00
parent c1d2259eac
commit a11e3d9871
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 103 additions and 135 deletions

View file

@ -25,37 +25,6 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func setRecentDoc(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
param, err := gulu.JSON.MarshalJSON(arg["recentDoc"])
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
return
}
recentDoc := &model.RecentDoc{}
if err = gulu.JSON.UnmarshalJSON(param, recentDoc); nil != err {
ret.Code = -1
ret.Msg = err.Error()
return
}
err = model.SetRecentDoc(recentDoc)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
return
}
}
func getRecentDocs(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)