package models

import (
	"git.apinb.com/bsm-sdk/core/database"
	"git.apinb.com/bsm-sdk/core/types"
)

// ProductSpec /*
type ProductSpec struct {
	types.Std_IICUDS
	ProductId       uint   `gorm:"column:product_id;not null;" json:"product_id"`    // 产品ID
	ProductIdentity string `gorm:"column:product_identity;" json:"product_identity"` // 商品身份标识
	SpecId          int64  `gorm:"column:spec_id;not null;" json:"spec_id"`          // 规格ID

	Spec    MallProductSpec `gorm:"foreignKey:ID;references:SpecId;"`    // 关联分类
	Product MallProduct     `gorm:"foreignKey:ID;references:ProductId;"` // 关联商品
}

func init() {
	database.AppendMigrate(&ProductSpec{})
}

// TableName .
func (table *ProductSpec) TableName() string {
	return "product_spec" //对应数据库表名
}
