package model import "time" type MarketingTemplate struct { ID uint `json:"id" gorm:"primaryKey;comment:主键ID"` CategoryID uint `json:"category_id" gorm:"not null;index;comment:所属分类ID"` Title string `json:"title" gorm:"size:100;not null;comment:模板名称"` ImageURL string `json:"image_url" gorm:"size:500;not null;comment:模板图片URL"` ThumbnailURL string `json:"thumbnail_url" gorm:"size:500;comment:缩略图URL"` Width int `json:"width" gorm:"default:0;comment:图片宽度px"` Height int `json:"height" gorm:"default:0;comment:图片高度px"` SortOrder int `json:"sort_order" gorm:"default:0;comment:排序权重(越大越靠前)"` Status int `json:"status" gorm:"default:1;index;comment:状态(1=启用,0=禁用)"` DownloadCount int `json:"download_count" gorm:"default:0;comment:下载次数"` CreatedAt time.Time `json:"created_at" gorm:"comment:创建时间"` UpdatedAt time.Time `json:"updated_at" gorm:"comment:更新时间"` Category *MarketingCategory `json:"category,omitempty" gorm:"foreignKey:CategoryID"` } func (MarketingTemplate) TableName() string { return "marketing_templates" }