|
|
|
@ -8,7 +8,7 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
// Device 结构体
|
|
|
|
// Device 结构体
|
|
|
|
type DeviceV2 struct {
|
|
|
|
type DeviceV2 struct {
|
|
|
|
ID uint `gorm:"primarykey"` // 主键ID
|
|
|
|
ID uint `json:"id" gorm:"primarykey"` // 主键ID
|
|
|
|
ProductId *int `json:"product_id" form:"product_id" gorm:"column:product_id;comment:产品表主键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:;"`
|
|
|
|
DeviceName string `json:"device_name" form:"device_name" gorm:"column:device_name;comment:;"`
|
|
|
|
Brand string `json:"brand" form:"brand" gorm:"column:brand;comment:设备品牌;"`
|
|
|
|
Brand string `json:"brand" form:"brand" gorm:"column:brand;comment:设备品牌;"`
|
|
|
|
@ -19,7 +19,7 @@ type DeviceV2 struct {
|
|
|
|
LanIp string `json:"lan_ip" form:"lan_ip" gorm:"column:lan_ip;comment:局域网ip地址;"`
|
|
|
|
LanIp string `json:"lan_ip" form:"lan_ip" gorm:"column:lan_ip;comment:局域网ip地址;"`
|
|
|
|
Status string `json:"status" form:"status" gorm:"column:status;comment:描述设备的状态;"`
|
|
|
|
Status string `json:"status" form:"status" gorm:"column:status;comment:描述设备的状态;"`
|
|
|
|
StatusDetails string `json:"status_details" form:"status_details" gorm:"column:status_details;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:;"`
|
|
|
|
IsEnabled int `json:"is_enabled" form:"is_enabled" gorm:"column:is_enabled;comment:;"`
|
|
|
|
CreatedAt time.Time `json:"create_time" gorm:"column:created_at;autoCreate"` // 创建时间
|
|
|
|
CreatedAt time.Time `json:"create_time" gorm:"column:created_at;autoCreate"` // 创建时间
|
|
|
|
UpdatedAt time.Time `json:"update_time" gorm:"column:updated_at;autoUpdate"` // 更新时间
|
|
|
|
UpdatedAt time.Time `json:"update_time" gorm:"column:updated_at;autoUpdate"` // 更新时间
|
|
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` // 删除时间
|
|
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` // 删除时间
|
|
|
|
|