refactor: base.repo与base.app精简优化

This commit is contained in:
meilin.huang
2024-04-29 12:29:56 +08:00
parent f2c7ef78c0
commit a5cd7caf19
14 changed files with 108 additions and 105 deletions

View File

@@ -78,7 +78,7 @@ func (d *dbBackupRepoImpl) AddJob(ctx context.Context, jobs any) error {
return addJob[*entity.DbBackup](ctx, d.dbJobBaseImpl, jobs)
}
func (d *dbBackupRepoImpl) UpdateEnabled(_ context.Context, jobId uint64, enabled bool) error {
func (d *dbBackupRepoImpl) UpdateEnabled(ctx context.Context, jobId uint64, enabled bool) error {
cond := map[string]any{
"id": jobId,
}
@@ -86,10 +86,10 @@ func (d *dbBackupRepoImpl) UpdateEnabled(_ context.Context, jobId uint64, enable
if enabled {
desc = "已启用"
}
return d.Updates(cond, map[string]any{
return d.UpdateByCond(ctx, map[string]any{
"enabled": enabled,
"enabled_desc": desc,
})
}, cond)
}
func (d *dbBackupRepoImpl) ListByCond(cond any, listModels any, cols ...string) error {