25 lines
1.1 KiB
Go
25 lines
1.1 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Banner 轮播图模型
|
|
type Banner struct {
|
|
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
|
|
Title string `json:"title" gorm:"type:varchar(255);not null;comment:轮播图标题"`
|
|
Image string `json:"image" gorm:"type:varchar(500);not null;comment:轮播图图片URL"`
|
|
LinkType int `json:"link_type" gorm:"type:tinyint;not null;default:1;comment:链接类型:1-无链接,2-商品详情,3-分类页面,4-外部链接"`
|
|
LinkValue string `json:"link_value" gorm:"type:varchar(500);comment:链接值"`
|
|
Sort int `json:"sort" gorm:"type:int;not null;default:0;comment:排序值,数值越大越靠前"`
|
|
Status int `json:"status" gorm:"type:tinyint;not null;default:1;comment:状态:0-禁用,1-启用"`
|
|
StartTime *time.Time `json:"start_time" gorm:"comment:开始时间"`
|
|
EndTime *time.Time `json:"end_time" gorm:"comment:结束时间"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (Banner) TableName() string {
|
|
return "ai_banners"
|
|
} |