diff --git a/backend/models/objects.go b/backend/models/objects.go new file mode 100644 index 0000000..74e8513 --- /dev/null +++ b/backend/models/objects.go @@ -0,0 +1,59 @@ +package models + +import "time" + +type User struct { + Name string `json:"name"` + IsAdmin bool `json:"is_admin"` +} + +type MIME struct { + Name string `json:"name"` + Extension string `json:"extension"` +} + +type Category struct { + ID string `json:"id"` + Name string `json:"name"` + Color string `json:"color"` + CreatedAt time.Time `json:"created_at"` + Creator User `json:"creator"` +} + +type File struct { + ID string `json:"id"` + Name string `json:"name"` + MIME MIME `json:"mime"` + CreatedAt time.Time `json:"created_at"` + Creator User `json:"creator"` +} + +type Tag struct { + ID string `json:"id"` + Name string `json:"name"` + Color string `json:"color"` + Category Category `json:"category"` + CreatedAt time.Time `json:"created_at"` + Creator User `json:"creator"` +} + +type Autotag struct { + TriggerTag Tag `json:"trigger_tag"` + AddTag Tag `json:"add_tag"` + IsActive bool `json:"is_active"` +} + +type Pool struct { + ID string `json:"id"` + Name string `json:"name"` + CreatedAt time.Time `json:"created_at"` + Creator User `json:"creator"` +} + +type Session struct { + ID int `json:"id"` + UserAgent string `json:"user_agent"` + StartedAt time.Time `json:"started_at"` + ExpiresAt time.Time `json:"expires_at"` + LastActivity time.Time `json:"last_activity"` +}