2025-11-24 18:44:06 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"platform/web/core"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Product 产品表
|
|
|
|
|
|
type Product struct {
|
|
|
|
|
|
core.Model
|
2025-12-15 14:48:30 +08:00
|
|
|
|
Code string `json:"code" gorm:"column:code"` // 产品代码
|
|
|
|
|
|
Name string `json:"name" gorm:"column:name"` // 产品名称
|
|
|
|
|
|
Description *string `json:"description,omitempty" gorm:"column:description"` // 产品描述
|
|
|
|
|
|
Sort int32 `json:"sort" gorm:"column:sort"` // 排序
|
|
|
|
|
|
Status ProductStatus `json:"status" gorm:"column:status"` // 产品状态:0-禁用,1-正常
|
2026-04-14 15:06:08 +08:00
|
|
|
|
|
2026-04-15 16:56:24 +08:00
|
|
|
|
Skus []*ProductSku `json:"skus,omitempty" gorm:"foreignKey:ProductID"` // 产品包含的SKU列表
|
2025-11-24 18:44:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ProductStatus 产品状态枚举
|
|
|
|
|
|
type ProductStatus int
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
ProductStatusDisabled ProductStatus = 0 // 禁用
|
|
|
|
|
|
ProductStatusEnabled ProductStatus = 1 // 正常
|
|
|
|
|
|
)
|