Documentation ¶
Index ¶
Constants ¶
View Source
const TableNameBlog = "blogs"
View Source
const TableNameCategory = "categories"
View Source
const TableNameComment = "comments"
View Source
const TableNamePage = "pages"
View Source
const TableNamePost = "posts"
View Source
const TableNamePostTag = "post_tag"
View Source
const TableNameTag = "tags"
View Source
const TableNameUser = "users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blog ¶
type Category ¶
type Comment ¶
type Media ¶ added in v0.2.0
type Media struct { UpdatedAt time.Time `json:"updated_at" gorm:"index"` CreatedAt time.Time `json:"created_at" gorm:"index"` Thumbnail string `json:"thumbnail,omitempty" gorm:"size:500"` Tags string `json:"tags,omitempty" gorm:"size:200;index"` Title string `json:"title,omitempty" gorm:"size:200"` Alt string `json:"alt,omitempty"` Description string `json:"description,omitempty"` Keywords string `json:"keywords,omitempty"` CreatorID uint `json:"-"` Creator User `json:"-"` Author string `json:"author" gorm:"size:64"` Published bool `json:"published"` PublishedAt sql.NullTime `json:"published_at"` ContentType string `json:"content_type" gorm:"size:32"` Remark string `json:"remark"` Size int64 `json:"size"` Directory bool `json:"directory" gorm:"index"` Path string `json:"path" gorm:"size:200;uniqueIndex:,composite:_path_name"` Name string `json:"name" gorm:"size:200;uniqueIndex:,composite:_path_name"` Ext string `json:"ext" gorm:"size:100"` Dimensions string `json:"dimensions" gorm:"size:200"` // x*y StorePath string `json:"-" gorm:"size:300"` External bool `json:"external"` PublicUrl string `json:"public_url,omitempty" gorm:"-"` }
func (*Media) BuildPublicUrls ¶ added in v0.2.0
type MediaFolder ¶ added in v0.2.0
type Page ¶
type Page struct { gorm.Model Slug string `gorm:"column:slug;not null" json:"slug"` Title string `gorm:"column:title;not null" json:"title"` Body string `gorm:"column:body;not null" json:"body"` PublishedAt time.Time `gorm:"column:published_at" json:"published_at"` UserID uint `gorm:"column:user_id;not null" json:"user_id"` User User }
type Post ¶
type Post struct { gorm.Model Slug string `gorm:"column:slug;not null;uniqueIndex" json:"slug"` Title string `gorm:"column:title;not null" json:"title"` Description string `gorm:"column:description;not null" json:"description"` Body string `gorm:"column:body;not null" json:"body"` CategoryID uint `gorm:"column:category_id" json:"category_id"` IsDraft uint `gorm:"column:is_draft" json:"is_draft"` PublishedAt time.Time `gorm:"column:published_at" json:"published_at"` UserID uint `gorm:"column:user_id;not null" json:"user_id"` User User Category Category Comments []Comment Tags []Tag `gorm:"many2many:post_tag"` }
func (Post) GetTagsAsCharSeparated ¶
func (Post) GetTagsAsCommaSeparated ¶
type PostTag ¶
type Site ¶ added in v0.2.0
type Tag ¶
type UploadResult ¶ added in v0.2.0
type UploadResult struct { PublicUrl string `json:"publicUrl"` Thumbnail string `json:"thumbnail"` Path string `json:"path"` Name string `json:"name"` External bool `json:"external"` StorePath string `json:"storePath"` Dimensions string `json:"dimensions"` Ext string `json:"ext"` Size int64 `json:"size"` ContentType string `json:"contentType"` }
type User ¶
type User struct { gorm.Model Username string `gorm:"column:username;not null" json:"username"` Password string `gorm:"column:password;not null;default:123456" json:"password"` Name string `gorm:"column:name;not null" json:"name"` Token string `gorm:"column:token;not null" json:"token"` Avatar string `gorm:"column:avatar;not null" json:"avatar"` Gender uint `gorm:"column:gender;not null;default:1" json:"gender"` Phone string `gorm:"column:phone;not null" json:"phone"` Email string `gorm:"column:email;not null" json:"email"` Addr string `gorm:"column:addr;not null" json:"addr"` IP string `gorm:"column:ip;not null" json:"ip"` LoginAt time.Time `gorm:"column:login_at" json:"login_at"` LogoutAt time.Time `gorm:"column:logout_at" json:"logout_at"` }
Click to show internal directories.
Click to hide internal directories.