package models

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

// ProductCategory /*
type ProductCategory 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"` // 商品身份标识
	CategoryId      int64  `gorm:"column:category_id;not null;" json:"category_id"`  //  分类ID

	Category MallCategory `gorm:"foreignKey:ID;references:CategoryId;"` // 关联分类
	Product  MallProduct  `gorm:"foreignKey:ID;references:ProductId;"`  // 关联商品
}

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

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