36 lines
1.3 KiB
Go
36 lines
1.3 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
common "git.ilapage.cn/ila/yovision/Sense/server/common/models"
|
|
)
|
|
|
|
const (
|
|
ModalityVideo = "video"
|
|
StatusPending = "pending"
|
|
StatusActive = "active"
|
|
StatusDisabled = "disabled"
|
|
AdapterReady = "ready"
|
|
AdapterFailed = "verification_failed"
|
|
AdapterNotReady = "adapter_not_ready"
|
|
)
|
|
|
|
type Device struct {
|
|
ID string `gorm:"size:36;primaryKey" json:"id"`
|
|
Name string `gorm:"size:128;not null" json:"name"`
|
|
Location string `gorm:"size:255;not null;default:''" json:"location"`
|
|
Modality string `gorm:"size:32;not null;index" json:"modality"`
|
|
CapabilitiesJSON string `gorm:"column:capabilities;type:jsonb;not null;default:'[]'" json:"-"`
|
|
Status string `gorm:"size:32;not null;index" json:"status"`
|
|
AdapterStatus string `gorm:"size:32;not null" json:"adapterStatus"`
|
|
RTSPSameAsONVIF bool `gorm:"not null;default:true" json:"rtspCredentialSameAsOnvif"`
|
|
CredentialUpdatedAt *time.Time `json:"credentialUpdatedAt,omitempty"`
|
|
RetryRequestedAt *time.Time `json:"retryRequestedAt,omitempty"`
|
|
Version int64 `gorm:"not null;default:1" json:"version"`
|
|
common.ControlBy
|
|
common.ModelTime
|
|
}
|
|
|
|
func (Device) TableName() string { return "sense_devices" }
|