Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArchivePosts ¶
type BaseModel ¶
type BaseModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"-"`
CreatedAt time.Time `gorm:"column:created_at" json:"-"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
DeletedAt *time.Time `gorm:"column:deleted_at" sql:"index" json:"-"`
}
BaseModel 实体基础类
type PostModel ¶
type PostModel struct {
BaseModel
CanComment int `gorm:"column:can_comment;type:tinyint" json:"can_comment"`
Status int `gorm:"column:status;type:smallint" json:"status"`
Title string `gorm:"column:title;type:varchar(100)" json:"title"`
AuthorID int `gorm:"column:author_id" json:"author_id"`
Slug string `gorm:"column:slug;type:varchar(100)" json:"slug"`
Summary string `gorm:"column:summary;type:varchar(255)" json:"summary"`
Typ int `gorm:"column:type;type:int" json:"type"`
PageView int `gorm:"column:pageview;type:int" json:"pageview"`
Content string `gorm:"column:content;type:text" json:"content"`
Name string `gorm:"-"`
Tags []Tag `gorm:"-"`
Avatar string `gorm:"-"`
HTML template.HTML `gorm:"-"`
TOC template.HTML `gorm:"-"`
}
PostModel 文章表
type PostTag ¶
type UserModel ¶
type UserModel struct {
BaseModel
Username string `json:"name" gorm:"column:name;not null" binding:"required" validate:"min=1,max=32"`
Password string `json:"password" gorm:"column:password;not null" binding:"required" validate:"min=5,max=128"`
Email string `json:"email" gorm:"column:email;not null"`
Avatar string `json:"avatar" gorm:"column:avatar"`
Active bool `json:"active" gorm:"column:active"`
}
UserModel 用户实体
Click to show internal directories.
Click to hide internal directories.