package models import ( "time" ) // ProductCategory 商品分类表 type ProductCategory struct { ID uint `gorm:"primaryKey;autoIncrement" json:"id"` CategoryName string `gorm:"type:varchar(100);not null;comment:分类名称" json:"category_name" binding:"required"` CategoryIcon string `gorm:"type:varchar(255);comment:分类图标URL" json:"category_icon"` 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 (ProductCategory) TableName() string { return "product_categories" }