Files
PandaX/iothub/netbase/iothub_session.go
2024-08-21 17:35:50 +08:00

24 lines
539 B
Go

package netbase
import (
"encoding/json"
"pandax/pkg/global/model"
)
type DeviceEventInfo struct {
DeviceId string `json:"deviceId"`
DeviceAuth *model.DeviceAuth `json:"deviceAuth"`
Datas string `json:"datas"`
Type string `json:"type"`
RequestId string `json:"requestId"` // rpc 请求ID
Identifier string `json:"identifier"` //事件标识
}
func (j *DeviceEventInfo) Bytes() []byte {
b, err := json.Marshal(j)
if err != nil {
return nil
}
return b
}