Documentation ¶
Index ¶
- func GetCategories(currentID int64) (map[string]bool, error)
- type Artical
- type ArticalComments
- type ArticalSummary
- type Category
- func (cat *Category) Delete(confirm bool) (bool, error)
- func (cat *Category) SetAlias(alias string) (bool, error)
- func (cat *Category) SetDescription(description string) (bool, error)
- func (cat *Category) SetKeywords(keywords ...string) (bool, error)
- func (cat *Category) SetName(name string) (bool, error)
- type Comment
- type Common
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Artical ¶
type Artical struct { ID int64 `json:"id"` Name string `xorm:"varchar(255) index" json:"name"` Alias string `xorm:"varchar(255) index" json:"alias"` Summary string `xorm:"varchar(1024) index" json:"summary"` Content string `xorm:"text" json:"content"` Author string `xorm:"varchar(30)" json:"author"` Category int64 `json:"category_id"` Keywords []string `json:"keywords"` Common }
Artical 定义文章类
type ArticalComments ¶
type ArticalComments struct { ArticalID int64 `json:"artical_id"` Comments []Comment `json:"comments"` }
ArticalComments 定义文章评论列表类
func GetComments ¶
func GetComments(articalID int64) (ArticalComments, error)
GetComments 根据文章ID获取评论列表
type ArticalSummary ¶
type ArticalSummary struct { ID int64 `json:"id"` Name string `json:"name"` Summary string `json:"summary"` Category Category `json:"category"` CreateTime string `json:"create_time"` UpdateTime string `json:"update_time"` }
ArticalSummary 定义文章摘要类
func GetSummariesWithPageID ¶
func GetSummariesWithPageID(pid int) []ArticalSummary
GetSummariesWithPageID 根据文章索引页获得摘要
type Category ¶
type Category struct { ID int64 `json:"id"` Name string `json:"name" xorm:"unique"` Alias string `json:"alias" xorm:"unique"` Keywords []string `json:"keywords"` Description string `json:"description"` Common }
Category 定义文章分类
func GetCategoryByAlias ¶
GetCategoryByAlias 根据给定分类别名获得分类
func GetCategoryByName ¶
GetCategoryByName 根据给定分类名称获得分类
func (*Category) SetDescription ¶
SetDescription 设置分类的详细描述
func (*Category) SetKeywords ¶
SetKeywords 设置分类的关键词
type Comment ¶
type Comment struct { ID int64 `json:"id"` ArticalID int64 `json:"artical_id"` Author string `xorm:"varchar(30)" json:"author"` Content string `xorm:"text" json:"content"` CommentTo int64 `xorm:"default(0)" json:"comment_to"` Like int64 `xorm:"default(0)" json:"like"` Unlike int64 `xorm:"default(0)" json:"unlike"` Common }
Comment 定义评论类
Click to show internal directories.
Click to hide internal directories.