Documentation
¶
Index ¶
Constants ¶
View Source
const ( DictTypeText = "text" DictTypeTextArea = "textarea" DictTypeSelect = "select" // 格式为 key:value,key:value DictTypeUploadImage = "uploadImage" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct {
orm.Model
Nickname string `gorm:"type:varchar(60)" json:"nickname"`
Username string `gorm:"type:varchar(60);unique_index" json:"username"`
Password string `gorm:"size:64;not null" json:"-"`
Background string `json:"background"`
Resume string `gorm:"type:varchar(140)" json:"resume"`
Avatar string `gorm:"type:varchar(200)" json:"avatar"`
RoleID uint `json:"role_id"`
Token string `gorm:"-" json:"token"`
Role *Role `gorm:"-" json:"role"`
IsSelf bool `gorm:"-" json:"is_self"`
}
type Article ¶
type Article struct {
orm.Model
Title string `json:"title"`
SEOTitle string `json:"seo_title"`
SEODescription string `json:"seo_description"`
SEOKeyword string `json:"seo_keyword"`
CategoryID uint `json:"category_id"`
Description string `json:"description"` // article description
Cover string `json:"cover"` // conver image
ContentTable string `json:"content_table"` // content table
ContentID uint `json:"content_id"` // content id
PublishTime *time.Time `json:"publish_time"` // timing publish
Status ArticleStatus `json:"status"` // status
Views int `json:"views"` // page view count
Tags string `json:"tags"` // article tags
AuthorID uint `json:"author"` // article author
Template string `json:"template"` // 页面渲染模板
Visibility uint `json:"visibility"` // 可见性 [1. public, 2. private]
CreatorID uint `json:"creator_id"` // 创建人
EditorID uint `json:"editor_id"` // 修改人
AuthorName string `gorm:"-" json:"author_name"`
CategoryName string `gorm:"-" json:"category_name"`
}
type ArticleContent ¶
type ArticlePublish ¶
type ArticleStatus ¶
type ArticleStatus int
const ( ArticleStatusPublish ArticleStatus = 1 ArticleStatusDraft ArticleStatus = 2 )
type Category ¶
type Category struct {
orm.Model
Name string `json:"name"`
Path string `json:"path"`
SEOTitle string `json:"seo_title"`
Description string `json:"description"`
Keyword string `json:"keyword"`
Remark string `json:"remark"`
Icon string `json:"icon"`
ParentId uint `json:"parent_id"`
Sort int `json:"sort"`
ArticleCount int `json:"article_count"`
Children interface{} `gorm:"-" json:"children"`
}
type Dict ¶
type Dict struct {
orm.Model
Key string `json:"key"` // 唯一Key
Name string `json:"name"` // 名称
Description string `json:"description"` // 描述
Type DictType `json:"type"` // 数据类型
Options string `json:"options"` // 选项
Value string `json:"value"` // 值
ReadOnly bool `json:"read_only"` // 是否只读
Visible bool `json:"visible"` // 是否可见
}
type Permission ¶
type Permission struct {
orm.Model
Code string `json:"code"` // 唯一识别码
PermissionName string `json:"permission_name"` // 权限名称
PID uint `json:"pid"` // 上级ID
Child []*Permission `gorm:"-" json:"child"`
Parent *Permission `gorm:"-" json:"parent"`
}
type RelRolePermission ¶
type RelTagArticle ¶
type Tag ¶
type Tag struct {
orm.Model
Name string `gorm:"unique_index" json:"name"`
Path string `gorm:"unique_index" json:"path"`
Description string `json:"description"`
Icon string `json:"icon"`
MetaTitle string `json:"meta_title"`
MetaDescription string `json:"meta_description"`
ArticleCount int `json:"article_count"`
}
Click to show internal directories.
Click to hide internal directories.