package models import ( "time" ) // Banner 轮播图表 type Banner struct { ID uint `gorm:"primaryKey;autoIncrement" json:"id"` Title string `gorm:"type:varchar(200);not null;comment:轮播图标题" json:"title" binding:"required"` ImageUrl string `gorm:"type:varchar(500);not null;comment:轮播图图片URL" json:"image_url" binding:"required"` LinkUrl string `gorm:"type:varchar(500);comment:点击跳转链接" json:"link_url"` Description string `gorm:"type:text;comment:描述信息" json:"description"` SortOrder int `gorm:"type:int;not null;default:0;comment:排序序号" json:"sort_order"` Status uint8 `gorm:"type:tinyint;not null;default:1;comment:状态:0禁用,1启用" json:"status"` CreatedAt time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" json:"updated_at"` } func (Banner) TableName() string { return "banners" }