From 5457f8f4dd7c187b56dbd43def8d995d7f49f0b4 Mon Sep 17 00:00:00 2001 From: dushixiang Date: Sun, 3 Jan 2021 21:41:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E7=AD=BEmodel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/model/tag.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pkg/model/tag.go diff --git a/pkg/model/tag.go b/pkg/model/tag.go new file mode 100644 index 0000000..d79c073 --- /dev/null +++ b/pkg/model/tag.go @@ -0,0 +1,23 @@ +package model + +import "next-terminal/pkg/global" + +type Tag struct { + Tag string `json:"tag"` +} + +func (r *Tag) TableName() string { + return "tags" +} + +func FindAllTag() (o []Property) { + if global.DB.Find(&o).Error != nil { + return nil + } + return +} + +func CreateNewTag(o *Tag) (err error) { + err = global.DB.Create(o).Error + return +}