Files
platform/web/models/product.go
2026-04-16 14:24:59 +08:00

26 lines
896 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
import (
"platform/web/core"
)
// Product 产品表
type Product struct {
core.Model
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-正常
Skus []*ProductSku `json:"skus,omitempty" gorm:"foreignKey:ProductID"` // 产品包含的SKU列表
}
// ProductStatus 产品状态枚举
type ProductStatus int
const (
ProductStatusDisabled ProductStatus = 0 // 禁用
ProductStatusEnabled ProductStatus = 1 // 正常
)