增加标签model
This commit is contained in:
1 parent
55919cc4ac
commit
5457f8f4dd
1 file changed
+23
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user