🎨 新增酒配方相关models
This commit is contained in:
parent
f542b2fafb
commit
b8864755e4
8
model/entity/category.go
Normal file
8
model/entity/category.go
Normal file
@ -0,0 +1,8 @@
|
||||
package entity
|
||||
|
||||
import "Lee-WineList/common/types"
|
||||
|
||||
type Category struct {
|
||||
types.BaseDbModel
|
||||
Name string `gorm:"column:name;type:varchar(255);comment:分类名;NOT NULL" json:"name"`
|
||||
}
|
15
model/entity/wine.go
Normal file
15
model/entity/wine.go
Normal file
@ -0,0 +1,15 @@
|
||||
package entity
|
||||
|
||||
import "Lee-WineList/common/types"
|
||||
|
||||
// Wine 酒
|
||||
type Wine struct {
|
||||
types.BaseDbModel
|
||||
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"`
|
||||
Ingredients string `gorm:"column:ingredients;type:varchar(255);comment:配料;NOT NULL" json:"ingredients"`
|
||||
Quote string `gorm:"column:quote;type:varchar(255);comment:引用;NOT NULL" json:"quote"`
|
||||
CategoryId uint `gorm:"column:category_id;type:int(11) unsigned;comment:分类ID;NOT NULL" json:"category_id"`
|
||||
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"`
|
||||
}
|
14
model/param/wine.go
Normal file
14
model/param/wine.go
Normal file
@ -0,0 +1,14 @@
|
||||
package param
|
||||
|
||||
import "Lee-WineList/common/types"
|
||||
|
||||
type Wine struct {
|
||||
types.BaseDbModel
|
||||
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"`
|
||||
Ingredients string `json:"ingredients"`
|
||||
Quote string `gorm:"column:quote;type:varchar(255);comment:引用;NOT NULL" json:"quote"`
|
||||
CategoryId uint `gorm:"column:category_id;type:int(11) unsigned;comment:分类ID;NOT NULL" json:"category_id"`
|
||||
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"`
|
||||
}
|
19
model/resp/wine.go
Normal file
19
model/resp/wine.go
Normal file
@ -0,0 +1,19 @@
|
||||
package resp
|
||||
|
||||
import "Lee-WineList/common/types"
|
||||
|
||||
type Wine struct {
|
||||
types.BaseDbModel
|
||||
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"`
|
||||
Ingredients []Ingredients `json:"ingredients"`
|
||||
Quote string `gorm:"column:quote;type:varchar(255);comment:引用;NOT NULL" json:"quote"`
|
||||
CategoryId uint `gorm:"column:category_id;type:int(11) unsigned;comment:分类ID;NOT NULL" json:"category_id"`
|
||||
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"`
|
||||
}
|
||||
|
||||
type Ingredients struct {
|
||||
Name string `gorm:"column:name;type:varchar(255);comment:酒名;NOT NULL" json:"name"`
|
||||
Dose string `gorm:"column:dose;type:varchar(255);comment:剂量;NOT NULL" json:"dose"`
|
||||
}
|
Loading…
Reference in New Issue
Block a user