mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
refactor: base.repo与app重构优化
This commit is contained in:
@@ -78,8 +78,8 @@ func (app *DbRestoreApp) Enable(ctx context.Context, jobId uint64) error {
|
||||
defer app.mutex.Unlock()
|
||||
|
||||
repo := app.restoreRepo
|
||||
job := &entity.DbRestore{}
|
||||
if err := repo.GetById(job, jobId); err != nil {
|
||||
job, err := repo.GetById(jobId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if job.IsEnabled() {
|
||||
@@ -101,8 +101,8 @@ func (app *DbRestoreApp) Disable(ctx context.Context, jobId uint64) error {
|
||||
defer app.mutex.Unlock()
|
||||
|
||||
repo := app.restoreRepo
|
||||
job := &entity.DbRestore{}
|
||||
if err := repo.GetById(job, jobId); err != nil {
|
||||
job, err := repo.GetById(jobId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !job.IsEnabled() {
|
||||
|
||||
Reference in New Issue
Block a user