feat: 添加操作日志拦截中间件

This commit is contained in:
ssongliu
2022-12-13 18:54:28 +08:00
committed by ssongliu
parent 5272d44558
commit 2a0f2dcd6a
59 changed files with 1162 additions and 437 deletions

View File

@@ -127,17 +127,12 @@ func (b *BaseApi) UpdateBackup(c *gin.Context) {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
id, err := helper.GetParamID(c)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
upMap := make(map[string]interface{})
upMap["bucket"] = req.Bucket
upMap["credential"] = req.Credential
upMap["vars"] = req.Vars
if err := backupService.Update(id, upMap); err != nil {
if err := backupService.Update(req.ID, upMap); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}