mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-02 04:36:35 +08:00
refactor: 精简base.repo与base.app等
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gorm.io/gorm"
|
||||
"math"
|
||||
"mayfly-go/internal/db/domain/entity"
|
||||
"mayfly-go/internal/db/domain/repository"
|
||||
@@ -15,6 +14,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
@@ -74,7 +75,7 @@ func (app *DbBackupApp) prune(ctx context.Context) error {
|
||||
historyCond := map[string]any{
|
||||
"db_backup_id": job.Id,
|
||||
}
|
||||
if err := app.backupHistoryRepo.ListByCondOrder(historyCond, &histories, "id"); err != nil {
|
||||
if err := app.backupHistoryRepo.SelectByCond(historyCond, &histories); err != nil {
|
||||
return err
|
||||
}
|
||||
expiringTime := time.Now().Add(-math.MaxInt64)
|
||||
@@ -140,7 +141,7 @@ func (app *DbBackupApp) Delete(ctx context.Context, jobId uint64) error {
|
||||
history := &entity.DbBackupHistory{
|
||||
DbBackupId: jobId,
|
||||
}
|
||||
err := app.backupHistoryRepo.GetBy(history, "name")
|
||||
err := app.backupHistoryRepo.GetByCond(history)
|
||||
switch {
|
||||
default:
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user