优化结构
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package system
|
||||
|
||||
import "context"
|
||||
|
||||
// MaintenanceRepo owns retention work for system-owned tables. Other data
|
||||
// modules clean their own tables and worker composes the operations.
|
||||
type MaintenanceRepo interface {
|
||||
CleanupExpired(context.Context) error
|
||||
}
|
||||
|
||||
type MaintenanceUsecase struct{ repo MaintenanceRepo }
|
||||
|
||||
func NewMaintenanceUsecase(repo MaintenanceRepo) *MaintenanceUsecase {
|
||||
return &MaintenanceUsecase{repo: repo}
|
||||
}
|
||||
|
||||
func (uc *MaintenanceUsecase) CleanupExpired(ctx context.Context) error {
|
||||
return uc.repo.CleanupExpired(ctx)
|
||||
}
|
||||
Reference in New Issue
Block a user