/
category.gen.go
33 lines (27 loc) · 1.56 KB
/
category.gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package entity
import (
"time"
"github.com/go-sonic/sonic/consts"
)
const TableNameCategory = "category"
// Category mapped from table <category>
type Category struct {
ID int32 `gorm:"column:id;type:int;primaryKey;autoIncrement:true" json:"id"`
CreateTime time.Time `gorm:"column:create_time;type:datetime;not null" json:"create_time"`
UpdateTime *time.Time `gorm:"column:update_time;type:datetime" json:"update_time"`
Description string `gorm:"column:description;type:varchar(100);not null" json:"description"`
Type consts.CategoryType `gorm:"column:type;type:tinyint;not null" json:"type"`
Name string `gorm:"column:name;type:varchar(255);not null;index:category_name,priority:1" json:"name"`
ParentID int32 `gorm:"column:parent_id;type:int;not null;index:category_parent_id,priority:1" json:"parent_id"`
Password string `gorm:"column:password;type:varchar(255);not null" json:"password"`
Slug string `gorm:"column:slug;type:varchar(255);not null;uniqueIndex:uniq_category_slug,priority:1" json:"slug"`
Thumbnail string `gorm:"column:thumbnail;type:varchar(1023);not null" json:"thumbnail"`
Priority int32 `gorm:"column:priority;type:int;not null" json:"priority"`
}
// TableName Category's table name
func (*Category) TableName() string {
return TableNameCategory
}