Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { ID int `gorm:"primary_key" json:"id"` State int `json:"state" validate:"min=0,max=1"` TagID int `json:"tag_id" validate:"gt=0"` Title string `json:"title" validate:"required"` Desc string `json:"desc" validate:"required"` Content string `json:"content" validate:"required"` CoverImageURL string `json:"cover_image_url"` CreatedBy string `json:"created_by" validate:"required"` ModifiedBy string `json:"modified_by"` Tag Tag `json:"tag"` CreatedOn time.Time `json:"created_on"` ModifiedOn time.Time `json:"modified_on"` }
Article 文章结构体
func (*Article) BeforeCreate ¶
BeforeCreate 在创建Article之前,先把创建时间赋值
type Role ¶
type Role struct { ID int `gorm:"primary_key" json:"id"` UserID int `json:"user_id"` UserName string `json:"user_name"` Value string `json:"value"` }
Role 身份信息结构体
type Tag ¶
type Tag struct { ID int `gorm:"primary_key" json:"id"` CreatedOn time.Time `json:"created_on"` ModifiedOn time.Time `json:"modified_on"` Name string `json:"name"` CreatedBy string `json:"created_by"` ModifiedBy string `json:"modified_by"` State int `json:"state"` }
Tag 标签结构体
func (*Tag) BeforeCreate ¶
BeforeCreate CreatedOn赋值
type User ¶
type User struct { ID int `gorm:"primary_key" json:"id"` CreatedOn time.Time `json:"created_on"` ModifiedOn time.Time `json:"modified_on"` Username string `json:"username" validate:"required"` Password string `json:"password" validate:"required"` Avatar string `json:"avatar"` UserType int `json:"user_type"` Deleted int `json:"deteled"` State int `json:"state"` CreatedBy string `json:"created_by"` ModifiedBy string `json:"modified_by"` }
User 用户授权信息
func (*User) BeforeCreate ¶
BeforeCreate CreatedOn赋值
Click to show internal directories.
Click to hide internal directories.