camera.go 1.0 KB

12345678910111213141516171819202122
  1. package dao
  2. import "server/global"
  3. // Camera 摄像头模型
  4. type Camera struct {
  5. global.GVA_MODEL
  6. DeviceCode string `gorm:"size:50;not null;uniqueIndex" json:"device_code"` // 设备编码
  7. DeviceName string `gorm:"size:100;not null" json:"device_name"` // 设备名称
  8. IPAddress string `gorm:"size:50;not null" json:"ip_address"` // IP地址
  9. Port int `gorm:"not null" json:"port"` // 端口
  10. Username string `gorm:"size:50" json:"username"` // 用户名
  11. Password string `gorm:"size:50" json:"password"` // 密码
  12. Channel int `gorm:"default:1" json:"channel"` // 通道号
  13. Status string `gorm:"size:20;default:'offline'" json:"status"` // 连接状态
  14. IsActive bool `gorm:"default:true" json:"is_active"` // 是否启用
  15. Description string `gorm:"size:200" json:"description"` // 备注
  16. }
  17. func (Camera) TableName() string {
  18. return "camera"
  19. }