123456789101112131415161718192021222324252627282930313233343536373839 |
- package models
- import "github.com/jinzhu/gorm"
- // Device device model
- // device is a product instance, which is managed by our platform
- type Device struct {
- gorm.Model
- // which product the device belongs to
- ProductID int32
- // universal device identifier, generated from vendorid-productid-deviceserial
- DeviceIdentifier string `sql:"type:varchar(200);not null;unique;key"`
- // device secret which is auto generated by the platform
- DeviceSecret string `sql:"type:varchar(200);not null;"`
- // device key is used to auth a device
- DeviceKey string `sql:"type:varchar(200);not null;key;"`
- // device name
- DeviceName string `sql:"type:varchar(200);not null;"`
- // device desc
- DeviceDescription string `sql:"type:text;not null;"`
- // device version(the agent version)
- DeviceVersion string `sql:"type:text;not null;"`
- // vendor id
- VendorID uint
- //通讯模组名称
- ModuleName string
- }
- // DeviceQuery device query
- type DeviceQuery struct {
- Device
- ProductName string
- }
- // DeviceChartData 设备数据图表
- type DeviceChartData struct {
- Dt string
- Count int
- }
|