Files
template-vitrine/backend/internal/modules/media/model.go
T
2026-09-14 20:50:19 +02:00

25 lines
702 B
Go

// 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" }