This commit is contained in:
CFOU
2026-09-14 20:50:19 +02:00
commit 3091fb4020
135 changed files with 10262 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
// Package media manages uploaded files (images/videos) and abstracts the
// storage backend behind a Storage interface so the admin can switch
// between local disk and any S3-compatible bucket via configuration only.
package media
import (
"time"
"github.com/google/uuid"
)
type Media struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
Filename string `gorm:"not null"`
StorageKey string `gorm:"not null"`
URL string `gorm:"not null"`
MimeType string `gorm:"not null"`
SizeBytes int64 `gorm:"not null"`
AltText string `gorm:"not null;default:''"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (Media) TableName() string { return "media" }