mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-08 01:38:50 +01:00
This commit is contained in:
parent
8ba7cd3aa3
commit
b885773a7e
7 changed files with 49 additions and 4 deletions
|
|
@ -116,3 +116,18 @@ func initRepoKey(c *gin.Context) {
|
|||
"key": hex.EncodeToString(model.Conf.Repo.Key),
|
||||
}
|
||||
}
|
||||
|
||||
func resetRepo(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
if err := model.ResetRepo(); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = fmt.Sprintf(model.Conf.Language(146), err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"key": hex.EncodeToString(model.Conf.Repo.Key),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,6 +248,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/bazaar/getBazaarPackageREAME", model.CheckAuth, getBazaarPackageREAME)
|
||||
|
||||
ginServer.Handle("POST", "/api/repo/initRepoKey", model.CheckAuth, initRepoKey)
|
||||
ginServer.Handle("POST", "/api/repo/resetRepo", model.CheckAuth, resetRepo)
|
||||
ginServer.Handle("POST", "/api/repo/importRepoKey", model.CheckAuth, importRepoKey)
|
||||
ginServer.Handle("POST", "/api/repo/indexRepo", model.CheckAuth, indexRepo)
|
||||
ginServer.Handle("POST", "/api/repo/checkoutRepo", model.CheckAuth, checkoutRepo)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue