first commit
This commit is contained in:
30
internal/models/banner.go
Normal file
30
internal/models/banner.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Banner model structure
|
||||
// Represents a banner item with optional thumbnail.
|
||||
type Banner struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey" json:"id"`
|
||||
Color string `gorm:"type:varchar(32);not null" json:"color"`
|
||||
Title string `gorm:"type:varchar(254)" json:"title,omitempty"`
|
||||
Text1 string `gorm:"type:varchar(254)" json:"text1,omitempty"`
|
||||
Text2 string `gorm:"type:varchar(254)" json:"text2,omitempty"`
|
||||
Text4 string `gorm:"type:varchar(254)" json:"text4,omitempty"`
|
||||
Text5 string `gorm:"type:varchar(254)" json:"text5,omitempty"`
|
||||
Image string `gorm:"type:text;not null" json:"image"`
|
||||
ImageK string `gorm:"type:text" json:"image_k,omitempty"`
|
||||
ImageKTxt string `gorm:"type:varchar(254)" json:"image_k_txt,omitempty"`
|
||||
IsActive bool `gorm:"default:true" json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// TableName overrides the table name used by Banner to `banners`
|
||||
func (Banner) TableName() string {
|
||||
return "banners"
|
||||
}
|
||||
Reference in New Issue
Block a user