first commit
This commit is contained in:
39
internal/models/setting.go
Normal file
39
internal/models/setting.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Setting model structure
|
||||
// Stores site-wide metadata and contact information.
|
||||
type Setting struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey" json:"id"`
|
||||
Title string `gorm:"type:varchar(254);not null" json:"title"`
|
||||
MetaTitle string `gorm:"type:varchar(254);not null" json:"meta_title"`
|
||||
MetaDescription string `gorm:"type:varchar(254);not null" json:"meta_description"`
|
||||
Phone string `gorm:"type:varchar(254);not null" json:"phone"`
|
||||
URL string `gorm:"type:varchar(254);not null" json:"url"`
|
||||
Email string `gorm:"type:varchar(254);not null" json:"email"`
|
||||
Facebook string `gorm:"type:varchar(254)" json:"facebook,omitempty"`
|
||||
X string `gorm:"type:varchar(254)" json:"x,omitempty"`
|
||||
Instagram string `gorm:"type:varchar(254)" json:"instagram,omitempty"`
|
||||
Whatsapp string `gorm:"type:varchar(254)" json:"whatsapp,omitempty"`
|
||||
Pinterest string `gorm:"type:varchar(254)" json:"pinterest,omitempty"`
|
||||
Linkedin string `gorm:"type:varchar(254)" json:"linkedin,omitempty"`
|
||||
Slogan string `gorm:"type:varchar(254)" json:"slogan,omitempty"`
|
||||
Address string `gorm:"type:text" json:"address,omitempty"`
|
||||
Copyright string `gorm:"type:varchar(254)" json:"copyright,omitempty"`
|
||||
MapEmbed string `gorm:"type:text" json:"map_embed,omitempty"`
|
||||
WLogo string `gorm:"type:text" json:"w_logo,omitempty"`
|
||||
BLogo string `gorm:"type:text" json:"b_logo,omitempty"`
|
||||
IsActive bool `gorm:"default:false" json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// TableName overrides the table name used by Setting to `settings`
|
||||
func (Setting) TableName() string {
|
||||
return "settings"
|
||||
}
|
||||
Reference in New Issue
Block a user