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.

23 lines
664 B

package common_models
import "encoding/json"
type DeviceFactorProto struct {
Formula int `json:"formula"`
FieldVal map[string]string `json:"field_val"`
//MultiFormula interface{} `json:"multi_formula"`
//MultiFields interface{} `json:"multi_fields"`
//UnitConversion interface{} `json:"unit_conversion"`
//纪录 数据输入输出的转换系数
FieldValUnitK map[string]float64
}
// redis序列化
func (m *DeviceFactorProto) MarshalBinary() (data []byte, err error) {
return json.Marshal(m)
}
// redis序列化
func (m *DeviceFactorProto) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, m)
}