package models import ( "time" "gorm.io/gorm" ) // Device 结构体 type DeviceV2 struct { ID uint `gorm:"primarykey"` // 主键ID ProductId *int `json:"product_id" form:"product_id" gorm:"column:product_id;comment:产品表主键id;"` DeviceName string `json:"device_name" form:"device_name" gorm:"column:device_name;comment:;"` Brand string `json:"brand" form:"brand" gorm:"column:brand;comment:设备品牌;"` Udid string `json:"udid" form:"udid" gorm:"column:udid;comment:;"` AppDid string `json:"app_did" form:"app_did" gorm:"column:app_did;comment:;"` Platform string `json:"platform" form:"platform" gorm:"column:platform;comment:支持两项ios/adr;"` OsVersion string `json:"os_version" form:"os_version" gorm:"column:os_version;comment:;"` LanIp string `json:"lan_ip" form:"lan_ip" gorm:"column:lan_ip;comment:局域网ip地址;"` Status string `json:"status" form:"status" gorm:"column:status;comment:描述设备的状态;"` StatusDetails string `json:"status_details" form:"status_details" gorm:"column:status_details;comment:设备详细状态;"` IsEnabled *int `json:"is_enabled" form:"is_enabled" gorm:"column:is_enabled;comment:;"` CreatedAt time.Time `json:"create_time" gorm:"column:created_at;autoCreate"` // 创建时间 UpdatedAt time.Time `json:"update_time" gorm:"column:updated_at;autoUpdate"` // 更新时间 DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` // 删除时间 } // TableName Device 表名 func (DeviceV2) TableName() string { return "qa_devices" }