33 lines
792 B
Go
33 lines
792 B
Go
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:"-" gorm:"type:bigint;comment:父"`
|
|
Order string `json:"order" gorm:"type:bigint;comment:排序"`
|
|
Status string `json:"status" gorm:"type:int;comment:状态"`
|
|
Children []Category `json:"children" gorm:"-"`
|
|
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
|
|
}
|