feat: more reorganisation and keys endpoint

This commit is contained in:
DaanSelen
2026-04-23 16:51:18 +02:00
parent c3aac38089
commit 417cecf43f
10 changed files with 131 additions and 95 deletions
+4 -12
View File
@@ -1,18 +1,10 @@
package database
import (
"orbits-server/internal/shared/utility"
"time"
)
type MediaType string
const (
Video MediaType = "video"
Presentation MediaType = "presentation"
Internet MediaType = "internet"
Unspecified MediaType = "unspecified"
)
type Timestamps struct {
CreatedAt time.Time `gorm:"not null;"`
UpdatedAt time.Time `gorm:"not null;"`
@@ -26,10 +18,10 @@ type Command struct {
// video
// presentation
// internet URL
MediaType MediaType `gorm:"type:varchar(20);not null"` // Must specify what kind of file it is
MediaType utility.MediaType `gorm:"type:varchar(20);not null;"` // Must specify what kind of file it is
// Must be target list who are compelled to listen to the command
// can be none when there is no targets specified (init stage)
Targets []string `gorm:"type:json"`
Targets []string `gorm:"type:json;"`
// Must be the location where the file is downloadable on the API
// can be none when there is no media specified (init stage)
Location string
@@ -64,7 +56,7 @@ type File struct {
// video
// presentation
// internet URL
MediaType MediaType `gorm:"type:varchar(20);not null;"`
MediaType utility.MediaType `gorm:"type:varchar(20);not null;"`
// the name given by the user
MetaName string
FileName string `gorm:"not null;"`