添加category的模板以及相关的sql文件

This commit is contained in:
Siyi Guo committed 2023-02-03 12:52:14 +08:00
1 parent 598d5549c8
commit fc259ba274
11 files changed
+1000

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
package models
import (
"go-admin/common/models"
)
type Category struct {
models.Model
Title string `json:"title" gorm:"type:varchar(127);comment:标题"`
Slug string `json:"slug" gorm:"type:varchar(127);comment:id"`
Desc string `json:"desc" gorm:"type:varchar(127);comment:描述"`
Parent string `json:"parent" gorm:"type:bigint;comment:父"`
Order string `json:"order" gorm:"type:bigint;comment:排序"`
Status string `json:"status" gorm:"type:int;comment:状态"`
models.ModelTime
models.ControlBy
}
func (Category) TableName() string {
return "category"
}
func (e *Category) Generate() models.ActiveRecord {
o := *e
return &o
}
func (e *Category) GetId() interface{} {
return e.Id
}