重构名字
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/domain/scheduler"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/domain/plan"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/logs"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
|
||||
)
|
||||
@@ -20,7 +20,7 @@ type DelayTask struct {
|
||||
logger *logs.Logger
|
||||
}
|
||||
|
||||
func NewDelayTask(logger *logs.Logger, executionTask *models.TaskExecutionLog) scheduler.Task {
|
||||
func NewDelayTask(logger *logs.Logger, executionTask *models.TaskExecutionLog) plan.Task {
|
||||
return &DelayTask{
|
||||
executionTask: executionTask,
|
||||
logger: logger,
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/repository"
|
||||
)
|
||||
|
||||
// FullCollectionTask 实现了 scheduler.Task 接口,用于执行一次全量的设备数据采集
|
||||
// FullCollectionTask 实现了 plan.Task 接口,用于执行一次全量的设备数据采集
|
||||
type FullCollectionTask struct {
|
||||
log *models.TaskExecutionLog
|
||||
deviceRepo repository.DeviceRepository
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/domain/device"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/domain/scheduler"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/domain/plan"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/logs"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/repository"
|
||||
@@ -41,7 +41,7 @@ func NewReleaseFeedWeightTask(
|
||||
deviceRepo repository.DeviceRepository,
|
||||
deviceService device.Service,
|
||||
logger *logs.Logger,
|
||||
) scheduler.Task {
|
||||
) plan.Task {
|
||||
return &ReleaseFeedWeightTask{
|
||||
claimedLog: claimedLog,
|
||||
deviceRepo: deviceRepo,
|
||||
|
||||
@@ -2,7 +2,7 @@ package task
|
||||
|
||||
import (
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/domain/device"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/domain/scheduler"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/domain/plan"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/logs"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/repository"
|
||||
@@ -20,7 +20,7 @@ func NewTaskFactory(
|
||||
sensorDataRepo repository.SensorDataRepository,
|
||||
deviceRepo repository.DeviceRepository,
|
||||
deviceService device.Service,
|
||||
) scheduler.TaskFactory {
|
||||
) plan.TaskFactory {
|
||||
return &taskFactory{
|
||||
logger: logger,
|
||||
sensorDataRepo: sensorDataRepo,
|
||||
@@ -29,7 +29,7 @@ func NewTaskFactory(
|
||||
}
|
||||
}
|
||||
|
||||
func (t *taskFactory) Production(claimedLog *models.TaskExecutionLog) scheduler.Task {
|
||||
func (t *taskFactory) Production(claimedLog *models.TaskExecutionLog) plan.Task {
|
||||
switch claimedLog.Task.Type {
|
||||
case models.TaskTypeWaiting:
|
||||
return NewDelayTask(t.logger, claimedLog)
|
||||
|
||||
Reference in New Issue
Block a user