mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
更改ID太长问题
This commit is contained in:
@@ -2,12 +2,12 @@ package nodes
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/kakuilan/kgo"
|
||||
"github.com/sirupsen/logrus"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/pkg/global"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
"pandax/pkg/tool"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -52,7 +52,7 @@ func (n *createAlarmNode) Handle(msg *message.Message) error {
|
||||
}
|
||||
} else {
|
||||
alarm = &entity.DeviceAlarm{}
|
||||
alarm.Id = kgo.KStr.Uniqid("a")
|
||||
alarm.Id = tool.GenerateID()
|
||||
alarm.DeviceId = msg.Metadata.GetValue("deviceId").(string)
|
||||
alarm.ProductId = msg.Metadata.GetValue("productId").(string)
|
||||
alarm.Name = msg.Metadata.GetValue("deviceName").(string)
|
||||
|
||||
Reference in New Issue
Block a user