package dao import "wails-app/internal/global" // Camera 摄像头模型 type Camera struct { global.GVA_MODEL DeviceCode string `gorm:"size:50;not null;uniqueIndex" json:"device_code"` // 设备编码 DeviceName string `gorm:"size:100;not null" json:"device_name"` // 设备名称 ChannelID uint `gorm:"index;comment:绑定通道ID" json:"channel_id"` BoundChannel *Channel `gorm:"foreignKey:ChannelID;references:ID" json:"channel_binding"` IPAddress string `gorm:"size:50;not null" json:"ip_address"` // IP地址 Port int `gorm:"not null" json:"port"` // 端口 Username string `gorm:"size:50" json:"username"` // 用户名 Password string `gorm:"size:50" json:"password"` // 密码 Channel int `gorm:"default:1" json:"channel"` // 通道号 Status string `gorm:"size:20;default:'offline'" json:"status"` // 连接状态 IsActive bool `gorm:"default:true" json:"is_active"` // 是否启用 StreamProtocol string `gorm:"size:20;default:'webrtc'" json:"stream_protocol"` // system-mjpeg / webrtc / hls / mp4 SourceURL string `gorm:"size:500" json:"source_url"` // 系统转换模式下的原始 RTSP/HTTP 地址 StreamURL string `gorm:"size:500" json:"stream_url"` // 边缘转换后的浏览器播放地址,不应包含设备凭据 SnapshotURL string `gorm:"size:500" json:"snapshot_url"` // 可选抓拍地址 Description string `gorm:"size:200" json:"description"` // 备注 } func (Camera) TableName() string { return "camera" }