任务2.2.3/2.2.4

This commit is contained in:
2025-10-31 16:00:55 +08:00
parent 3334537663
commit ccab7c98e4
4 changed files with 11 additions and 11 deletions

View File

@@ -45,17 +45,14 @@ func NewApplication(configPath string) (*Application, error) {
cfg.Server,
logger,
infra.Repos.UserRepo,
infra.Repos.DeviceRepo,
infra.Repos.AreaControllerRepo,
infra.Repos.DeviceTemplateRepo,
infra.Repos.PlanRepo,
appServices.PigFarmService,
appServices.PigBatchService,
appServices.MonitorService,
appServices.DeviceService,
infra.TokenService,
appServices.AuditService,
infra.NotifyService,
domain.GeneralDeviceService,
infra.Lora.ListenHandler,
domain.AnalysisPlanTaskManager,
)

View File

@@ -185,6 +185,7 @@ type AppServices struct {
PigFarmService service.PigFarmService
PigBatchService service.PigBatchService
MonitorService service.MonitorService
DeviceService service.DeviceService
AuditService audit.Service
}
@@ -208,12 +209,19 @@ func initAppServices(infra *Infrastructure, domainServices *DomainServices, logg
infra.Repos.PigTradeRepo,
infra.Repos.NotificationRepo,
)
deviceService := service.NewDeviceService(
infra.Repos.DeviceRepo,
infra.Repos.AreaControllerRepo,
infra.Repos.DeviceTemplateRepo,
domainServices.GeneralDeviceService,
)
auditService := audit.NewService(infra.Repos.UserActionLogRepo, logger)
return &AppServices{
PigFarmService: pigFarmService,
PigBatchService: pigBatchService,
MonitorService: monitorService,
DeviceService: deviceService,
AuditService: auditService,
}
}