任务2.2.3/2.2.4
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user