|
|
@@ -13,15 +13,15 @@ type DeviceStatusDatas []DeviceStatusData
|
|
|
type DeviceStatus struct {
|
|
|
gorm.Model
|
|
|
RecordID string `gorm:"primary_key;column:record_id;size:32;index" json:"record_id"`
|
|
|
- DeviceTypeId string `gorm:"column:device_type_id;size:32;index" json:"device_type_id"` // 设备类型id
|
|
|
- DeviceTypeCode string `gorm:"column:device_type_code;size:100" json:"device_type_code"` // 设备类型code
|
|
|
- Desc string `gorm:"column:desc;size:500" json:"desc"` // 描述
|
|
|
- Name string `gorm:"column:name;size:200" json:"name"` // 状态字段名称
|
|
|
- Label string `gorm:"column:label;size:200" json:"label"` // 状态字段标签
|
|
|
- Type string `gorm:"column:type;size:100" json:"type"` // 状态字段类型
|
|
|
- Unit string `gorm:"column:unit;size:50" json:"unit"` // 单位
|
|
|
- FieldType int `gorm:"column:field_type" json:"field_type"` // 数据类型
|
|
|
- Data DeviceStatusDatas `gorm:"foreignkey:StatusID,RecordID" json:"data"` // 状态数据
|
|
|
+ DeviceTypeId string `gorm:"column:device_type_id;size:32;index" json:"device_type_id"` // 设备类型id
|
|
|
+ DeviceTypeCode string `gorm:"column:device_type_code;size:100" json:"device_type_code"` // 设备类型code
|
|
|
+ Desc string `gorm:"column:desc;size:500" json:"desc"` // 描述
|
|
|
+ Name string `gorm:"column:name;size:200" json:"name"` // 状态字段名称
|
|
|
+ Label string `gorm:"column:label;size:200" json:"label"` // 状态字段标签
|
|
|
+ Type string `gorm:"column:type;size:100" json:"type"` // 状态字段类型
|
|
|
+ Unit string `gorm:"column:unit;size:50" json:"unit"` // 单位
|
|
|
+ FieldType int `gorm:"column:field_type" json:"field_type"` // 数据类型
|
|
|
+ Data DeviceStatusDatas `gorm:"foreignkey:StatusID;associationforeignkey:RecordID" json:"data"` // 状态数据
|
|
|
}
|
|
|
|
|
|
// TableName 表名
|