【feature】添加组织数据读取权限

This commit is contained in:
XM-GO
2023-09-14 17:28:52 +08:00
parent bde42bfc9a
commit b5ee2a54b9
84 changed files with 1664 additions and 774 deletions

View File

@@ -60,6 +60,7 @@ func (n *createAlarmNode) Handle(msg *message.Message) error {
alarm.State = global.ALARMING
alarm.Type = n.AlarmType
alarm.Time = time.Now()
alarm.OrgId = msg.Metadata.GetValue("orgId").(int64)
marshal, _ := json.Marshal(msg.Msg)
alarm.Details = string(marshal)
err := services.DeviceAlarmModelDao.Insert(*alarm)

View File

@@ -40,6 +40,7 @@ func (n *logNode) Handle(msg *message.Message) error {
MessageId: msg.Id,
MsgType: msg.MsgType,
DeviceId: msg.Metadata["deviceId"].(string),
OrgId: msg.Metadata["orgId"].(int64),
DeviceName: msg.Metadata["deviceName"].(string),
Ts: msg.Ts,
Content: logMessage,