更新报错

This commit is contained in:
XM-GO
2023-09-01 16:47:22 +08:00
parent 9e53f07d92
commit 64d61b14ad
5 changed files with 2 additions and 36 deletions

View File

@@ -104,17 +104,16 @@ func getRuleChain(etoken *tool.DeviceAuth) *ruleEntity.RuleDataJson {
return &ruleData
}
func buildRuleMessage(etoken *tool.DeviceAuth, dei *DeviceEventInfo, msgType string) message.Message {
func buildRuleMessage(etoken *tool.DeviceAuth, dei *DeviceEventInfo, msgType string) *message.Message {
metadataVals := map[string]interface{}{
"deviceId": etoken.DeviceId,
"deviceName": etoken.Name,
"deviceType": etoken.DeviceType,
"productId": etoken.ProductId,
}
metadata := message.NewDefaultMetadata(metadataVals)
msgVals := make(map[string]interface{})
json.Unmarshal([]byte(dei.Datas), &msgVals)
return message.NewMessageWithDetail(etoken.User, msgType, msgVals, metadata)
return message.NewMessage(etoken.User, msgType, msgVals, metadataVals)
}
func SendZtWebsocket(deviceId, message string) {