mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 20:08:49 +01:00
✨ 数据仓库支持云端备份 https://github.com/siyuan-note/siyuan/issues/5336
This commit is contained in:
parent
1ecdb8864a
commit
44c0372a19
9 changed files with 55 additions and 49 deletions
|
|
@ -75,8 +75,27 @@ func createSnapshot(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
memo := arg["memo"].(string)
|
||||
if err := model.IndexRepo(memo); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = fmt.Sprintf(model.Conf.Language(140), err)
|
||||
ret.Data = map[string]interface{}{"closeTimeout": 5000}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func tagSnapshot(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)
|
||||
name := arg["name"].(string)
|
||||
if err := model.CreateSnapshot(name); nil != err {
|
||||
if err := model.TagSnapshot(id, name); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = fmt.Sprintf(model.Conf.Language(140), err)
|
||||
ret.Data = map[string]interface{}{"closeTimeout": 5000}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue