记录信号强度数据
This commit is contained in:
@@ -69,8 +69,11 @@ func NewApplication(configPath string) (*Application, error) {
|
||||
// 初始化执行日志仓库
|
||||
executionLogRepo := repository.NewGormExecutionLogRepository(storage.GetDB())
|
||||
|
||||
// 初始化传感器数据仓库
|
||||
sensorDataRepo := repository.NewGormSensorDataRepository(storage.GetDB())
|
||||
|
||||
// 初始化设备上行监听器
|
||||
listenHandler := transport.NewChirpStackListener(logger)
|
||||
listenHandler := transport.NewChirpStackListener(logger, sensorDataRepo, deviceRepo)
|
||||
|
||||
// 初始化计划触发器管理器
|
||||
analysisPlanTaskManager := task.NewAnalysisPlanTaskManager(planRepo, pendingTaskRepo, executionLogRepo, logger)
|
||||
@@ -79,7 +82,7 @@ func NewApplication(configPath string) (*Application, error) {
|
||||
executor := task.NewScheduler(pendingTaskRepo, executionLogRepo, planRepo, analysisPlanTaskManager, task.TaskFactory, logger, time.Duration(cfg.Task.Interval)*time.Second, cfg.Task.NumWorkers)
|
||||
|
||||
// 初始化 API 服务器
|
||||
apiServer := api.NewAPI(cfg.Server, logger, userRepo, deviceRepo, planRepo, tokenService, listenHandler, analysisPlanTaskManager)
|
||||
apiServer := api.NewAPI(cfg.Server, logger, userRepo, deviceRepo, planRepo, sensorDataRepo, executionLogRepo, tokenService, listenHandler, analysisPlanTaskManager)
|
||||
|
||||
// 组装 Application 对象
|
||||
app := &Application{
|
||||
|
||||
Reference in New Issue
Block a user