mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-31 20:51:48 +01:00
✨ 数据仓库支持云端备份 https://github.com/siyuan-note/siyuan/issues/5336
This commit is contained in:
parent
9350d5d224
commit
4bfe4490a7
5 changed files with 41 additions and 21 deletions
|
|
@ -43,7 +43,7 @@ func checkoutRepo(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
func getRepoIndexLogs(c *gin.Context) {
|
||||
func getRepoSnapshots(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
|
|
@ -66,6 +66,22 @@ func getRepoIndexLogs(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
func getRepoTagSnapshots(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
snapshots, err := model.GetTagSnapshots()
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"snapshots": snapshots,
|
||||
}
|
||||
}
|
||||
|
||||
func createSnapshot(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
|
|
@ -257,7 +257,8 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/repo/createSnapshot", model.CheckAuth, createSnapshot)
|
||||
ginServer.Handle("POST", "/api/repo/tagSnapshot", model.CheckAuth, tagSnapshot)
|
||||
ginServer.Handle("POST", "/api/repo/checkoutRepo", model.CheckAuth, checkoutRepo)
|
||||
ginServer.Handle("POST", "/api/repo/getRepoIndexLogs", model.CheckAuth, getRepoIndexLogs)
|
||||
ginServer.Handle("POST", "/api/repo/getRepoSnapshots", model.CheckAuth, getRepoSnapshots)
|
||||
ginServer.Handle("POST", "/api/repo/getRepoTagSnapshots", model.CheckAuth, getRepoTagSnapshots)
|
||||
|
||||
ginServer.Handle("POST", "/api/notification/pushMsg", model.CheckAuth, pushMsg)
|
||||
ginServer.Handle("POST", "/api/notification/pushErrMsg", model.CheckAuth, pushErrMsg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue