You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
932 B

package model
import "shop-api/global"
type TbAttribute struct { // 属性表
Name string `gorm:"type:varchar(255);not null;" json:"name"` // 规格名称
Status int `gorm:"type:tinyint(1);not null;comment:状态 1:正常" json:"status"`
global.MG_MODEL
}
type TbAttributeView struct {
ID uint `json:"id"`
Name string `json:"name"`
}
type TbAttributeDetail struct {
AttributeId uint `json:"attribute_id"` // 规格属性id
Value string `json:"value"` //
ValueId uint `json:"value_id"` //
}
type TbAttributeWithValues struct {
TbAttributeView
Values []TbAttributeValueItem `gorm:"-" json:"values"`
}
func (TbAttribute) TableName() string {
return "tb_attribute"
}
func (TbAttributeView) TableName() string {
return "tb_attribute"
}
func (TbAttributeWithValues) TableName() string {
return "tb_attribute"
}
func (TbAttributeDetail) TableName() string {
return "tb_attribute"
}