device.go 768 B

123456789101112131415161718
  1. package dao
  2. import "server/global"
  3. type Device struct {
  4. global.GVA_MODEL
  5. DeviceCode string `gorm:"size:50;not null;uniqueIndex" json:"device_code"` // 设备编码
  6. DeviceName string `gorm:"size:100;not null" json:"device_name"` // 设备名称
  7. DeviceType string `gorm:"size:50;not null" json:"device_type"` // 设备类别
  8. IPAddress string `gorm:"size:50" json:"ip_address"` // IP地址
  9. Port int `json:"port"` // 端口
  10. Status string `gorm:"size:20;default:'offline'" json:"status"` // 设备状态
  11. Description string `gorm:"size:200" json:"description"` // 备注
  12. }
  13. func (Device) TableName() string {
  14. return "device"
  15. }