2023-04-24 17:34:38 +08:00
|
|
|
package entity
|
|
|
|
|
|
|
|
import "Lee-WineList/common/types"
|
|
|
|
|
|
|
|
// Wine 酒
|
|
|
|
type Wine struct {
|
2023-04-27 15:56:12 +08:00
|
|
|
types.Model
|
|
|
|
WineId int `gorm:"column:wine_id;type:int(11) unsigned;primarykey;comment:酒ID;NOT NULL" json:"wine_id"`
|
|
|
|
Name string `gorm:"column:name;type:varchar(255);comment:酒名;NOT NULL" json:"name"`
|
|
|
|
ChineseName string `gorm:"column:chinese_name;type:varchar(255);comment:中文酒名;NOT NULL" json:"chinese_name"`
|
|
|
|
Quote string `gorm:"column:quote;type:varchar(255);comment:引用;NOT NULL" json:"quote"`
|
|
|
|
Category string `gorm:"column:category;type:varchar(255);comment:分类;NOT NULL" json:"category"`
|
|
|
|
Steps string `gorm:"column:steps;type:varchar(255);comment:步骤;NOT NULL" json:"steps"`
|
|
|
|
Context string `gorm:"column:context;type:varchar(255);comment:酒文;NOT NULL" json:"context"`
|
2023-04-27 17:36:07 +08:00
|
|
|
Materials []Material `gorm:"many2many:wine_materials" json:"materials"`
|
2023-04-27 15:56:12 +08:00
|
|
|
UserId int `gorm:"column:user_id;type:int(11) unsigned;comment:用户ID;NOT NULL" json:"user_id"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// TableName 设置表名
|
|
|
|
func (Wine) TableName() string {
|
|
|
|
return "wines"
|
2023-04-24 17:34:38 +08:00
|
|
|
}
|