Documentation ¶
Overview ¶
Author: Aosen Data: 2016-01-11 QQ: 316052486 Desc: models的基类,所有其他model都继承此类, 使用beego提供的orm
Index ¶
- Variables
- func NovelCollectSort(nsc NovelsCollect)
- func NovelPvSort(nsp NovelsPv)
- type BaseModel
- func (self *BaseModel) GetAllNovel() ([]*Novel, error)
- func (self *BaseModel) GetAllNovelForIndex() ([]*Novel, error)
- func (self *BaseModel) GetNovel(novelid int) (map[string]interface{}, error)
- func (self *BaseModel) GetNovels(novelids []int, picpath string) ([]map[string]interface{}, error)
- func (self *BaseModel) GetSecondName(second int) (name string)
- type Clickrank
- type Collectrank
- type Content
- type First
- type Novel
- type NovelChapterModel
- type NovelCollectModel
- type NovelContentModel
- type NovelDownloadModel
- type NovelIntroductionModel
- type NovelListModel
- type NovelPVModel
- type NovelRankModel
- type NovelRecommendModel
- type NovelsCollect
- type NovelsPv
- type Recommend
- type Second
- type System
- type TagListModel
- type Userinfo
- type Userlog
Constants ¶
This section is empty.
Variables ¶
View Source
var RecommendMap map[int]string = map[int]string{
1: "编辑推荐",
2: "百万粉丝追读",
}
Functions ¶
func NovelCollectSort ¶
func NovelCollectSort(nsc NovelsCollect)
func NovelPvSort ¶
func NovelPvSort(nsp NovelsPv)
Types ¶
type BaseModel ¶
type BaseModel struct { }
func NewBaseModel ¶
func NewBaseModel() *BaseModel
func (*BaseModel) GetAllNovel ¶
func (*BaseModel) GetAllNovelForIndex ¶
func (*BaseModel) GetSecondName ¶
根据secondid获取小说二级分类名称
type Clickrank ¶
type Clickrank struct { Id int //小说ID Novelid int //小说一级分类ID Firstid int //小说二级分类ID Secondid int //小说pv Novelpv int //小说收藏量 Novelcollect int Createtime time.Time `orm:"type(date)"` }
小说点击量排名信息
type Collectrank ¶
type Collectrank struct { Id int //小说ID Novelid int //小说一级分类ID Firstid int //小说二级分类ID Secondid int //小说pv Novelpv int //小说收藏量 Novelcollect int Createtime time.Time `orm:"type(date)"` }
小说收藏量排名信息
type Content ¶
type Content struct { Id int Novelid int Title string `orm:"size(200);index"` Firstid int `orm:"index"` Secondid int `orm:"index"` Chapter int `orm:"index"` Subtitle string `orm:"size(200);index"` Text string `orm:"type(text)"` Contentsource string `orm:"size(200);index"` Createtime time.Time `orm:"type(date)"` }
小说内容表
type First ¶
type First struct { Id int Firstname string `orm:"size(20);unique"` Updatetime time.Time `orm:"type(date)"` Createtime time.Time `orm:"type(date)"` }
一级分类表
type Novel ¶
type Novel struct { Id int Title string `orm:"size(200)"` Firstid int `orm:"index"` Secondid int `orm:"index"` Author string `orm:"size(50);index"` Introduction string `orm:"type(text)"` Picture string `orm:"size(200)"` Novelsource string `orm:"size(200);unique"` Novelpv int `orm:"default(0)"` Novelcollect int `orm:"default(0)"` Createtime time.Time `orm:"type(date)"` }
小说简介信息
type NovelChapterModel ¶
type NovelChapterModel struct {
BaseModel
}
func NewNovelChapterModel ¶
func NewNovelChapterModel() *NovelChapterModel
func (*NovelChapterModel) GetChapterList ¶
func (self *NovelChapterModel) GetChapterList(novelid int) ([]map[string]interface{}, error)
type NovelCollectModel ¶
type NovelCollectModel struct {
BaseModel
}
func NewNovelCollectModel ¶
func NewNovelCollectModel() *NovelCollectModel
func (*NovelCollectModel) PutCollect ¶
func (self *NovelCollectModel) PutCollect(novelid int) (map[string]interface{}, error)
type NovelContentModel ¶
type NovelContentModel struct {
BaseModel
}
func NewNovelContentModel ¶
func NewNovelContentModel() *NovelContentModel
func (*NovelContentModel) GetContent ¶
func (self *NovelContentModel) GetContent(chapterid int) (map[string]interface{}, error)
type NovelDownloadModel ¶
type NovelDownloadModel struct {
BaseModel
}
func NewNovelDownloadModel ¶
func NewNovelDownloadModel() *NovelDownloadModel
func (*NovelDownloadModel) GetNovelText ¶
func (self *NovelDownloadModel) GetNovelText(novelid int) (map[string]interface{}, error)
根据novelid生成json文本
type NovelIntroductionModel ¶
type NovelIntroductionModel struct {
BaseModel
}
func NewNovelIntroductionModel ¶
func NewNovelIntroductionModel() *NovelIntroductionModel
func (*NovelIntroductionModel) GetChapterNum ¶
func (self *NovelIntroductionModel) GetChapterNum(novelid int) (int64, error)
func (*NovelIntroductionModel) GetNovelIntroduction ¶
func (self *NovelIntroductionModel) GetNovelIntroduction(novelid int, np string) (map[string]interface{}, error)
type NovelListModel ¶
type NovelListModel struct {
BaseModel
}
func NewNovelListModel ¶
func NewNovelListModel() *NovelListModel
func (*NovelListModel) GetNovelList ¶
func (self *NovelListModel) GetNovelList(firstid, secondid, page, limit int, np string) ([]map[string]interface{}, error)
type NovelPVModel ¶
type NovelPVModel struct {
BaseModel
}
func NewNovelPVModel ¶
func NewNovelPVModel() *NovelPVModel
type NovelRankModel ¶
type NovelRankModel struct {
BaseModel
}
func NewNovelRankModel ¶
func NewNovelRankModel() *NovelRankModel
func (*NovelRankModel) GetRankList ¶
func (self *NovelRankModel) GetRankList(page, limit int, picpath string) ([]map[string]interface{}, error)
type NovelRecommendModel ¶
type NovelRecommendModel struct {
BaseModel
}
func NewNovelRecommendModel ¶
func NewNovelRecommendModel() *NovelRecommendModel
type NovelsCollect ¶
type NovelsCollect []*Novel
根据novel结构体列表中的novelcollect进行排序
func (NovelsCollect) Len ¶
func (self NovelsCollect) Len() int
func (NovelsCollect) Less ¶
func (self NovelsCollect) Less(i, j int) bool
func (NovelsCollect) Swap ¶
func (self NovelsCollect) Swap(i, j int)
type Second ¶
type Second struct { Id int Firstid int Secondname string `orm:"size(20);unique"` Updatetime time.Time `orm:"type(date)"` Createtime time.Time `orm:"type(date)"` }
二级分类表
type TagListModel ¶
type TagListModel struct {
BaseModel
}
func NewTagListModel ¶
func NewTagListModel() *TagListModel
func (*TagListModel) GetTagList ¶
func (self *TagListModel) GetTagList() ([]map[string]interface{}, error)
Click to show internal directories.
Click to hide internal directories.