first
This commit is contained in:
@@ -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" }
|
||||
Reference in New Issue
Block a user