mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[优化]
This commit is contained in:
@@ -2,9 +2,9 @@ package nodes
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
"time"
|
||||
@@ -48,7 +48,7 @@ func (n *createAlarmNode) Handle(msg *message.Message) error {
|
||||
}
|
||||
} else {
|
||||
alarm = &entity.DeviceAlarm{}
|
||||
alarm.Id = utils.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)
|
||||
|
||||
@@ -2,11 +2,11 @@ package nodes
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/iothub/client/mqttclient"
|
||||
"pandax/iothub/client/tcpclient"
|
||||
"pandax/iothub/client/udpclient"
|
||||
"pandax/kit/utils"
|
||||
devicerpc "pandax/pkg/device_rpc"
|
||||
"pandax/pkg/global"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
@@ -72,7 +72,7 @@ func (n *rpcRequestFromDeviceNode) Handle(msg *message.Message) error {
|
||||
RequestId := n.RequestId
|
||||
if RequestId == "" {
|
||||
if msg.Metadata.GetValue("requestId") == nil {
|
||||
rpc.RequestId = utils.GenerateID()
|
||||
rpc.RequestId = utils.GenerateID("")
|
||||
} else {
|
||||
rpc.RequestId = msg.Metadata.GetValue("requestId").(string)
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@ package nodes
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/iothub/client/mqttclient"
|
||||
"pandax/iothub/client/tcpclient"
|
||||
"pandax/iothub/client/udpclient"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
"pandax/pkg/global/model"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
@@ -51,7 +51,7 @@ func (n *rpcRequestToDeviceNode) Handle(msg *message.Message) error {
|
||||
|
||||
// 构建指令记录
|
||||
var data entity.DeviceCmdLog
|
||||
data.Id = utils.GenerateID()
|
||||
data.Id = utils.GenerateID("")
|
||||
data.DeviceId = deviceId
|
||||
data.CmdName = datas.Method
|
||||
data.CmdContent = kgo.KConv.ToStr(datas.Params)
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/PandaXGO/PandaKit/httpclient"
|
||||
"net/url"
|
||||
"pandax/kit/httpclient"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ package nodes
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"pandax/kit/httpclient"
|
||||
"github.com/PandaXGO/PandaKit/httpclient"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package nodes
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"pandax/kit/httpclient"
|
||||
"github.com/PandaXGO/PandaKit/httpclient"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user