Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { ID string `gorm:"type:uuid;primary_key;default:uuid_generate_v4()"` CreatedAt time.Time UpdatedAt time.Time Slug string `form:"slug" validate:"required" gorm:"unique_index"` Title string `form:"title" validate:"required"` Content string `form:"content" validate:"required" gorm:"text"` TemplateID byte `form:"template" validate:"required"` IsBook bool `form:"is_book"` RawTags string `form:"tags" gorm:"-"` Tags pq.StringArray `gorm:"index;type:varchar(255)[]" validate:"-" form:"-"` ReadNum uint `gorm:"default:0;"` CommentNum uint `gorm:"default:0;"` Version uint `gorm:"default:1;"` BookRefer *string `form:"book_refer" validate:"omitempty,uuid4" gorm:"type:uuid;index;default:NULL"` Comments []*Comment ArticleHistories []*ArticleHistory Toc []*ArticleTOC Chapters []*Article `gorm:"foreignkey:BookRefer" form:"-" validate:"-"` Book *Article `gorm:"-" validate:"-" form:"-"` SibilingArticle *SibilingArticle `gorm:"-" validate:"-" form:"-"` // for form NewVersion bool `gorm:"-" form:"new_version"` }
Article 文章表
type ArticleHistory ¶
type ArticleHistory struct { ArticleID string `gorm:"type:uuid;index"` Article Article Version uint `gorm:"index"` Desc string `gorm:"text"` Content string `gorm:"text"` CreatedAt time.Time }
ArticleHistory 文章修订历史
func (*ArticleHistory) GetIndexID ¶
func (t *ArticleHistory) GetIndexID() string
GetIndexID get index data id
type ArticleIndex ¶
ArticleIndex index data
type ArticleTOC ¶
type ArticleTOC struct { Title string Slug string SubTitles []*ArticleTOC Parent *ArticleTOC `gorm:"-"` Level int `gorm:"-"` ShowLevel int `gorm:"-"` }
ArticleTOC 文章标题
type Comment ¶
type Comment struct { ID string `gorm:"type:uuid;primary_key;default:uuid_generate_v4()"` CreatedAt time.Time ReplyTo *string `gorm:"type:uuid;index;default:NULL" form:"reply_to"` Nickname string `form:"nickname" validate:"required"` Content string `form:"content" validate:"required" gorm:"text"` Website string `form:"website"` Version uint `form:"-"` Email string `form:"email"` IP string `gorm:"inet"` UserAgent string IsAdmin bool ArticleID *string `gorm:"type:uuid;index;default:NULL" form:"article_id" validate:"required,uuid"` Article *Article ChildComments []*Comment `gorm:"foreignkey:ReplyTo" form:"-" validate:"-"` }
Comment 评论表
type Config ¶
type Config struct { Debug bool ServerChan string Database string Akismet string Email struct { Host string Port int User string Pass string SSL bool } User User Site struct { SpaceName string SpaceDesc string SpaceKeywords string HomeTopContent string HomeBottomContent string Domain string Theme string HeaderMenus []Menu FooterMenus []Menu } ConfigFilePath string }
Config 系统配置
type SibilingArticle ¶
SibilingArticle 相邻文章
Click to show internal directories.
Click to hide internal directories.