This commit is contained in:
Liang Ding 2022-07-05 09:32:23 +08:00
parent ebdb5b2a36
commit e41d411c2d
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
10 changed files with 108 additions and 38 deletions

View file

@ -66,7 +66,7 @@ func getRepoIndexLogs(c *gin.Context) {
}
}
func indexRepo(c *gin.Context) {
func createSnapshot(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
@ -75,8 +75,8 @@ func indexRepo(c *gin.Context) {
return
}
message := arg["message"].(string)
if err := model.IndexRepo(message); nil != err {
name := arg["name"].(string)
if err := model.CreateSnapshot(name); nil != err {
ret.Code = -1
ret.Msg = fmt.Sprintf(model.Conf.Language(140), err)
ret.Data = map[string]interface{}{"closeTimeout": 5000}