优化结构
This commit is contained in:
@@ -85,7 +85,7 @@ func NewTaskUsecaseWithRegistry(repo TaskRepo, methods TaskMethodRegistry) *Task
|
||||
return &TaskUsecase{TaskRepo: repo, methods: methods}
|
||||
}
|
||||
|
||||
func (uc *TaskUsecase) RegisteredMethods() []TaskMethod { return uc.methods.List() }
|
||||
func (uc *TaskUsecase) RegisteredMethods() []platformtask.Method { return uc.methods.List() }
|
||||
|
||||
func (uc *TaskUsecase) Validate(value *TimedTask) error {
|
||||
if value.Name == "" {
|
||||
@@ -165,7 +165,7 @@ func NewTaskApplicationUsecase(tasks *TaskUsecase, runtime TaskRuntime) *TaskApp
|
||||
return &TaskApplicationUsecase{tasks: tasks, runtime: runtime}
|
||||
}
|
||||
|
||||
func (uc *TaskApplicationUsecase) RegisteredMethods() []TaskMethod {
|
||||
func (uc *TaskApplicationUsecase) RegisteredMethods() []platformtask.Method {
|
||||
return uc.tasks.RegisteredMethods()
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@ package task
|
||||
|
||||
import platformtask "kra/pkg/task"
|
||||
|
||||
type TaskMethodFunc = platformtask.MethodFunc
|
||||
type TaskMethod = platformtask.Method
|
||||
|
||||
type TaskMethodRegistry interface {
|
||||
Lookup(string) (TaskMethodFunc, bool)
|
||||
List() []TaskMethod
|
||||
Lookup(string) (platformtask.MethodFunc, bool)
|
||||
List() []platformtask.Method
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user