This commit is contained in:
panda
2024-06-06 20:36:50 +08:00
parent 14c5b453b6
commit 41b61ebf1e
19 changed files with 41 additions and 288 deletions

View File

@@ -4,8 +4,8 @@ import (
"encoding/json"
"pandax/apps/device/entity"
"pandax/apps/device/services"
"pandax/kit/utils"
"pandax/pkg/global"
"pandax/pkg/global/model"
"pandax/pkg/rule_engine/message"
"time"
)
@@ -48,7 +48,7 @@ func (n *createAlarmNode) Handle(msg *message.Message) error {
}
} else {
alarm = &entity.DeviceAlarm{}
alarm.Id = model.GenerateID()
alarm.Id = utils.GenerateID()
alarm.DeviceId = msg.Metadata.GetValue("deviceId").(string)
alarm.ProductId = msg.Metadata.GetValue("productId").(string)
alarm.Name = msg.Metadata.GetValue("deviceName").(string)