Skip to content

Commit

Permalink
feat: add status to camera model
Browse files Browse the repository at this point in the history
  • Loading branch information
Sculas committed Jul 10, 2022
1 parent cbcb19b commit 9fc1f82
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions service/database/models/cameras.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ type Camera struct {
OwnerUuid string `gorm:"uniqueIndex:idx_owner_uuid_name" json:"ownerUuid"`
Name string `gorm:"uniqueIndex:idx_owner_uuid_name" json:"name"`

IPAddress string `gorm:"not null" json:"addr"`
Port int `gorm:"not null" json:"port"`
Type CameraType `gorm:"not null" json:"type"`
IPAddress string `gorm:"not null" json:"addr"`
Port int `gorm:"not null" json:"port"`
Type CameraType `gorm:"not null" json:"type"`
Status CameraStatus `gorm:"not null" json:"status"`

CreatedAt int64 `json:"-"`
}
Expand All @@ -21,3 +22,11 @@ const (
CameraTypeONVIF
CameraTypeRTSP
)

type CameraStatus int

const (
CameraStatusInvalid CameraType = iota
CameraStatusDisconnected
CameraStatusConnected
)

0 comments on commit 9fc1f82

Please sign in to comment.