daShangDao_psiServer/models/product_category.go
2026-06-15 13:47:39 +08:00

21 lines
960 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package models
// ProductCategory 商品分类表
type ProductCategory struct {
ID int64 `json:"id" gorm:"primarykey;comment:分类ID"`
ParentID int64 `json:"parent_id" gorm:"not null;default:0;index;comment:上级分类ID0表示顶级"`
Name string `json:"name" gorm:"size:100;not null;default:'';comment:分类名称"`
SortOrder int `json:"sort_order" gorm:"not null;default:0;comment:排序"`
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;comment:创建时间戳(秒)"`
UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;not null;default:0;comment:更新时间戳(秒)"`
IsDel int8 `json:"is_del" gorm:"type:tinyint(1);not null;default:0;comment:逻辑删除标记(0:未删除,1:已删除)"`
}
func (ProductCategory) TableName() string {
return "product_category"
}
func (ProductCategory) TableOptions() string {
return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品分类表'"
}