This commit is contained in:
Liang Ding 2022-06-18 09:55:52 +08:00
parent 8ba7cd3aa3
commit b885773a7e
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 49 additions and 4 deletions

View file

@ -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),
}
}