DeleteDeviceThresholdAlarm
DeleteAreaThresholdAlarm
This commit is contained in:
@@ -269,7 +269,11 @@ func initAppServices(ctx context.Context, infra *Infrastructure, domainServices
|
||||
thresholdAlarmService := service.NewThresholdAlarmService(
|
||||
logs.AddCompName(baseCtx, "ThresholdAlarmService"),
|
||||
domainServices.alarmService,
|
||||
domainServices.planService,
|
||||
infra.repos.alarmRepo,
|
||||
infra.repos.planRepo,
|
||||
infra.repos.areaControllerRepo,
|
||||
infra.repos.deviceRepo,
|
||||
)
|
||||
|
||||
return &AppServices{
|
||||
|
||||
@@ -58,7 +58,7 @@ func (app *Application) initializeSystemPlans(ctx context.Context) error {
|
||||
}
|
||||
|
||||
// 2. 为了方便查找, 将现有计划名放入一个 map
|
||||
existingPlanMap := make(map[string]*models.Plan)
|
||||
existingPlanMap := make(map[models.PlanName]*models.Plan)
|
||||
for i := range existingPlans {
|
||||
existingPlanMap[existingPlans[i].Name] = &existingPlans[i]
|
||||
}
|
||||
@@ -78,7 +78,7 @@ func (app *Application) initializeSystemPlans(ctx context.Context) error {
|
||||
|
||||
// initializePeriodicSystemHealthCheckPlan 负责初始化 "周期性系统健康检查" 计划。
|
||||
// 它会根据当前配置动态构建计划,并决定是创建新计划还是更新现有计划。
|
||||
func (app *Application) initializePeriodicSystemHealthCheckPlan(ctx context.Context, existingPlanMap map[string]*models.Plan) error {
|
||||
func (app *Application) initializePeriodicSystemHealthCheckPlan(ctx context.Context, existingPlanMap map[models.PlanName]*models.Plan) error {
|
||||
appCtx, logger := logs.Trace(ctx, app.Ctx, "initializePeriodicSystemHealthCheckPlan")
|
||||
|
||||
// 根据配置创建定时全量采集计划
|
||||
@@ -175,7 +175,7 @@ func (app *Application) initializePeriodicSystemHealthCheckPlan(ctx context.Cont
|
||||
|
||||
// initializeAlarmNotificationPlan 负责初始化 "告警通知发送" 计划。
|
||||
// 它确保系统中存在一个每分钟执行的、用于发送告警通知的预定义计划。
|
||||
func (app *Application) initializeAlarmNotificationPlan(ctx context.Context, existingPlanMap map[string]*models.Plan) error {
|
||||
func (app *Application) initializeAlarmNotificationPlan(ctx context.Context, existingPlanMap map[models.PlanName]*models.Plan) error {
|
||||
appCtx, logger := logs.Trace(ctx, app.Ctx, "initializeAlarmNotificationPlan")
|
||||
|
||||
predefinedPlan := &models.Plan{
|
||||
|
||||
Reference in New Issue
Block a user