package models import ( "IotAdmin/common/models" ) // IotDevice 设备实体 type IotDevice struct { models.Model ParentId string `json:"parentId" gorm:"type:bigint(20);comment:父ID"` GroupId string `json:"groupId" gorm:"type:bigint(20);comment:设备分组"` Sn string `json:"sn" gorm:"type:varchar(50);comment:设备编码"` Name string `json:"name" gorm:"type:varchar(50);comment:设备名称"` Type string `json:"type" gorm:"type:bigint(20);comment:设备类型"` Mode string `json:"mode" gorm:"type:bigint(20);comment:设备模式"` Cycle string `json:"cycle" gorm:"type:bigint(20);comment:上报周期"` Dsn string `json:"dsn" gorm:"type:varchar(255);comment:设备Dsn"` Description string `json:"description" gorm:"type:varchar(255);comment:设备描述"` Protocol string `json:"protocol" gorm:"type:varchar(255);comment:表计协议"` Address string `json:"address" gorm:"type:bigint(20);comment:表计地址"` LvRef string `json:"lvRef" gorm:"type:float;comment:表计线基准电压"` PvRef string `json:"pvRef" gorm:"type:float;comment:表计相基准电压"` BmYz string `json:"bmYz" gorm:"type:varchar(255);comment:编码因子"` Config string `json:"config" gorm:"type:varchar(255);comment:其他配置"` Group *IotGroup `json:"group" gorm:"ForeignKey:GroupId;AssociationForeignKey:Id"` models.ControlBy models.ModelTime } func (*IotDevice) TableName() string { return "iot_device" } func (e *IotDevice) Generate() models.ActiveRecord { o := *e return &o } func (e *IotDevice) GetId() interface{} { return e.Id }