feat: 完成 aof 备份恢复功能

This commit is contained in:
ssongliu
2022-11-04 19:02:15 +08:00
committed by ssongliu
parent 917a11457e
commit a111e04c65
19 changed files with 981 additions and 626 deletions

View File

@@ -48,16 +48,19 @@ func (b *BaseApi) UpdateMysql(c *gin.Context) {
}
func (b *BaseApi) UpdateMysqlVariables(c *gin.Context) {
var req dto.MysqlVariablesUpdate
var req []dto.MysqlVariablesUpdate
if err := c.ShouldBindJSON(&req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
if err := global.VALID.Struct(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
mysqlName, ok := c.Params.Get("mysqlName")
if !ok {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, errors.New("error mysqlName in path"))
return
}
if err := mysqlService.UpdateVariables(req); err != nil {
if err := mysqlService.UpdateVariables(mysqlName, req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}