任务2.4

This commit is contained in:
2025-10-31 16:28:26 +08:00
parent b44e1a0e7c
commit 942ffa29a1
7 changed files with 516 additions and 273 deletions

View File

@@ -45,16 +45,15 @@ func NewApplication(configPath string) (*Application, error) {
cfg.Server,
logger,
infra.Repos.UserRepo,
infra.Repos.PlanRepo,
appServices.PigFarmService,
appServices.PigBatchService,
appServices.MonitorService,
appServices.DeviceService,
appServices.PlanService,
infra.TokenService,
appServices.AuditService,
infra.NotifyService,
infra.Lora.ListenHandler,
domain.AnalysisPlanTaskManager,
)
// 4. 组装 Application 对象

View File

@@ -187,6 +187,7 @@ type AppServices struct {
MonitorService service.MonitorService
DeviceService service.DeviceService
AuditService audit.Service
PlanService service.PlanService
}
// initAppServices 初始化所有的应用服务。
@@ -216,6 +217,7 @@ func initAppServices(infra *Infrastructure, domainServices *DomainServices, logg
domainServices.GeneralDeviceService,
)
auditService := audit.NewService(infra.Repos.UserActionLogRepo, logger)
planService := service.NewPlanService(logger, infra.Repos.PlanRepo, domainServices.AnalysisPlanTaskManager)
return &AppServices{
PigFarmService: pigFarmService,
@@ -223,6 +225,7 @@ func initAppServices(infra *Infrastructure, domainServices *DomainServices, logg
MonitorService: monitorService,
DeviceService: deviceService,
AuditService: auditService,
PlanService: planService,
}
}