You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
555 B
26 lines
555 B
1 month ago
|
package common_models
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
)
|
||
|
|
||
|
type IotaDevice struct {
|
||
|
Id string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Properties string `json:"properties"`
|
||
|
DeviceMetaId string `json:"deviceMetaId"`
|
||
|
ThingId string `json:"thingId"`
|
||
|
DeviceMeta DeviceMeta `json:"deviceMeta"`
|
||
|
}
|
||
|
|
||
|
// redis序列化
|
||
|
func (m *IotaDevice) MarshalBinary() (data []byte, err error) {
|
||
|
return json.Marshal(m)
|
||
|
}
|
||
|
|
||
|
// redis序列化
|
||
|
func (m *IotaDevice) UnmarshalBinary(data []byte) error {
|
||
|
return json.Unmarshal(data, m)
|
||
|
|
||
|
}
|