feat: mysql 列表读写切换

This commit is contained in:
ssongliu
2022-12-24 13:31:30 +08:00
committed by ssongliu
parent e1c2348e44
commit 44df6acb5d
13 changed files with 207 additions and 99 deletions

View File

@@ -37,6 +37,7 @@ type IMysqlService interface {
ChangePassword(info dto.ChangeDBInfo) error
UpdateVariables(updatas []dto.MysqlVariablesUpdate) error
UpdateConfByFile(info dto.MysqlConfUpdateByFile) error
UpdateDescription(req dto.MysqlDescription) error
RecoverByUpload(req dto.UploadRecover) error
Backup(db dto.BackupDB) error
@@ -191,6 +192,10 @@ func (u *MysqlService) Create(ctx context.Context, mysqlDto dto.MysqlDBCreate) (
return &mysql, nil
}
func (u *MysqlService) UpdateDescription(req dto.MysqlDescription) error {
return mysqlRepo.Update(req.ID, map[string]interface{}{"description": req.Description})
}
func (u *MysqlService) Backup(db dto.BackupDB) error {
localDir, err := loadLocalDir()
if err != nil {