Documentation ¶
Index ¶
- func AddCategory(cTitle string) error
- func AddReply(tId, rName, rContent string) error
- func AddTopic(tTitle, cId, tContent, tAttachment string) (string, error)
- func DeleteCategory(cId string) error
- func DeleteReply(rId string) error
- func DeleteTopic(tId string) error
- func GetReplyCountByTopic(tId string) (int64, error)
- func GetTopicCountByCategory(cId string) (int64, error)
- func ModifyTopic(tId, tTitle, cId, TContent, tAttachment string) error
- func RegisterDB()
- func TopicViewsChange(tId string, up bool) error
- func TotalViewsChange(cId string) error
- type Category
- type Reply
- type Topic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTopicCountByCategory ¶
通过分类ID获取分类下文章数
Types ¶
type Category ¶
type Category struct { Id int64 `orm:"pk;auto"` Title string Created time.Time `orm:"index;null"` Views int64 `orm:"index;null"` TopicTime time.Time `orm:"index;null"` TopicCount int64 `orm:"null"` TopicLastUserId int64 `orm:"null"` }
分类结构映射
type Reply ¶
type Reply struct { Id int64 Tid int64 Name string Content string `orm:"size(1000)"` Created time.Time `orm:"index"` }
回复结构映射
type Topic ¶
type Topic struct { Id int64 Uid int64 `orm:"null"` Title string Category string Content string `orm:"size(5000)"` Attachment string `orm:"null"` Created time.Time `orm:"index"` Updated time.Time `orm:"index"` Views int64 `orm:"index;null"` Author string `orm:"null"` ReplyTime time.Time `orm:"index;null"` ReplyCount int64 `orm:"null"` ReplyLastUserId int64 `orm:"null"` }
文章结构映射
Click to show internal directories.
Click to hide internal directories.