From b8864755e499032b60a883bbf7c2849dd4c162ed Mon Sep 17 00:00:00 2001 From: loser <1711788888@qq.com> Date: Mon, 24 Apr 2023 17:34:38 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=96=B0=E5=A2=9E=E9=85=92=E9=85=8D?= =?UTF-8?q?=E6=96=B9=E7=9B=B8=E5=85=B3models?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/entity/category.go | 8 ++++++++ model/entity/wine.go | 15 +++++++++++++++ model/param/wine.go | 14 ++++++++++++++ model/resp/wine.go | 19 +++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 model/entity/category.go create mode 100644 model/entity/wine.go create mode 100644 model/param/wine.go create mode 100644 model/resp/wine.go diff --git a/model/entity/category.go b/model/entity/category.go new file mode 100644 index 0000000..324d6f4 --- /dev/null +++ b/model/entity/category.go @@ -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"` +} diff --git a/model/entity/wine.go b/model/entity/wine.go new file mode 100644 index 0000000..f53f2fe --- /dev/null +++ b/model/entity/wine.go @@ -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"` +} diff --git a/model/param/wine.go b/model/param/wine.go new file mode 100644 index 0000000..a2b2600 --- /dev/null +++ b/model/param/wine.go @@ -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"` +} diff --git a/model/resp/wine.go b/model/resp/wine.go new file mode 100644 index 0000000..f8cd629 --- /dev/null +++ b/model/resp/wine.go @@ -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"` +}