数据 输入输出 处理
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.
 
 

31 lines
626 B

package models
import (
"encoding/json"
)
type Structure struct {
ThingId string `json:"thingId"`
Id int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
OrgId int `json:"orgId"`
}
type ThingStruct struct {
ThingId string `json:"thingId"`
Id int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
OrgId int `json:"orgId"`
}
// redis序列化
func (m *ThingStruct) MarshalBinary() (data []byte, err error) {
return json.Marshal(m)
}
// redis序列化
func (m *ThingStruct) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, m)
}