package model

import "pure/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"
}