diff --git a/internal/core/application.go b/internal/core/application.go index 7244a69..3767c85 100644 --- a/internal/core/application.go +++ b/internal/core/application.go @@ -64,6 +64,9 @@ func NewApplication(configPath string) (*Application, error) { // 初始化设备仓库 deviceRepo := repository.NewGormDeviceRepository(storage.GetDB()) + // 初始化区域主控仓库 + areaControllerRepo := repository.NewGormAreaControllerRepository(storage.GetDB()) + // 初始化计划仓库 planRepo := repository.NewGormPlanRepository(storage.GetDB()) @@ -89,7 +92,7 @@ func NewApplication(configPath string) (*Application, error) { auditService := audit.NewService(userActionLogRepo, logger) // 初始化设备上行监听器 - listenHandler := transport.NewChirpStackListener(logger, sensorDataRepo, deviceRepo, deviceCommandLogRepo, pendingCollectionRepo) + listenHandler := transport.NewChirpStackListener(logger, sensorDataRepo, deviceRepo, areaControllerRepo, deviceCommandLogRepo, pendingCollectionRepo) // 初始化计划触发器管理器 analysisPlanTaskManager := task.NewAnalysisPlanTaskManager(planRepo, pendingTaskRepo, executionLogRepo, logger)