21 lines
613 B
Go
21 lines
613 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type Media struct {
|
|
ID int `json:"id"`
|
|
ProductID int `json:"product_id"`
|
|
Type string `json:"type"`
|
|
URL string `json:"url"`
|
|
Key string `json:"-"` // clé interne RustFS, jamais exposée
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
func (Media) TableName() string { return "media" }
|
|
|
|
// Méthodes pour l'interface Database
|
|
func (m *Media) GetProductID() int { return m.ProductID }
|
|
func (m *Media) GetType() string { return m.Type }
|
|
func (m *Media) GetURL() string { return m.URL }
|
|
func (m *Media) SetID(id int) { m.ID = id }
|