✨ init project
This commit is contained in:
20
model/category/category.go
Normal file
20
model/category/category.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// 自动生成模板Category
|
||||
package category
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/lckt/global"
|
||||
)
|
||||
|
||||
// 类别 结构体 Category
|
||||
type Category struct {
|
||||
global.GVA_MODEL
|
||||
Name *string `json:"name" form:"name" gorm:"column:name;comment:类别名称;" binding:"required"` //名称
|
||||
Order *int `json:"order" form:"order" gorm:"column:order;comment:排序字段;"` //排序
|
||||
Active *bool `json:"active" form:"active" gorm:"column:active;comment:是否激活;"` //状态
|
||||
ParentId *int `json:"parentId" form:"parentId" gorm:"column:parent_id;comment:父类别ID;"` //父ID
|
||||
}
|
||||
|
||||
// TableName 类别 Category自定义表名 categories
|
||||
func (Category) TableName() string {
|
||||
return "categories"
|
||||
}
|
||||
14
model/category/request/category.go
Normal file
14
model/category/request/category.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/lckt/model/common/request"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CategorySearch struct {
|
||||
StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
request.PageInfo
|
||||
Sort string `json:"sort" form:"sort"`
|
||||
Order string `json:"order" form:"order"`
|
||||
}
|
||||
Reference in New Issue
Block a user