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

39 lines
1.1 KiB

package models
import (
"encoding/json"
)
type Station struct {
Id int `json:"id"`
Name string `json:"name"`
Structure int `json:"structure"`
ThingId string `json:"thingId"`
StructName string `json:"struct_name"`
Factor int `json:"factor"`
ManualData bool `json:"manual_data"`
Formula interface{} `json:"formula"`
ParamsValue interface{} `json:"params_value"`
FacName string `json:"fac_name"`
Proto string `json:"proto"`
Devices []struct {
Params map[string]any `json:"params"`
IotaDeviceId string `json:"iota_device_id"`
IotaDeviceSerial int `json:"iota_device_serial"`
} `json:"devices"`
//测点标签 {channelCode:6d608735-6dce-420c-9ffa-58ede93292e1,低频}
Labels string `json:"labels"`
//关联 广东省长大桥梁结构健康监测平台
ChannelCode string `json:"channelCode"`
}
// redis序列化
func (m *Station) MarshalBinary() (data []byte, err error) {
return json.Marshal(m)
}
// redis序列化
func (m *Station) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, m)
}