This commit is contained in:
Liang Ding 2022-12-15 11:07:42 +08:00
parent a3718bbbfc
commit d880f155c6
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 111 additions and 18 deletions

View file

@ -26,6 +26,31 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func openRepoSnapshotDoc(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
id := arg["id"].(string)
id, rootID, content, isLargeDoc, err := model.OpenRepoSnapshotDoc(id)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
return
}
ret.Data = map[string]interface{}{
"id": id,
"rootID": rootID,
"content": content,
"isLargeDoc": isLargeDoc,
}
}
func diffRepoSnapshots(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)