models

package
v0.0.0-...-627f02a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Author: Aosen Data: 2016-01-11 QQ: 316052486 Desc: models的基类,所有其他model都继承此类, 使用beego提供的orm

Index

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 (self *BaseModel) GetAllNovel() ([]*Novel, error)

func (*BaseModel) GetAllNovelForIndex

func (self *BaseModel) GetAllNovelForIndex() ([]*Novel, error)

func (*BaseModel) GetNovel

func (self *BaseModel) GetNovel(novelid int) (map[string]interface{}, error)

根据novelid获取小说简介

func (*BaseModel) GetNovels

func (self *BaseModel) GetNovels(novelids []int, picpath string) ([]map[string]interface{}, error)

func (*BaseModel) GetSecondName

func (self *BaseModel) GetSecondName(second int) (name string)

根据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

func (*NovelPVModel) PutPV

func (self *NovelPVModel) PutPV(novelid int) (map[string]interface{}, error)

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

func (*NovelRecommendModel) GetList

func (self *NovelRecommendModel) GetList(picpath string) ([]map[string]interface{}, error)

func (*NovelRecommendModel) GetMore

func (self *NovelRecommendModel) GetMore(tagid int, picpath string) (map[string]interface{}, error)

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 NovelsPv

type NovelsPv []*Novel

根据novel结构体列表中的novelpv进行排序

func (NovelsPv) Len

func (self NovelsPv) Len() int

func (NovelsPv) Less

func (self NovelsPv) Less(i, j int) bool

func (NovelsPv) Swap

func (self NovelsPv) Swap(i, j int)

type Recommend

type Recommend struct {
	Id      int
	Tagid   int
	Novelid int
	Top     int
}

小说推荐列表 json格式的

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 System

type System struct {
	Id int
	K  string `orm:"size(50);unique"`
	V  string `orm:"size(100)"`
}

服务器配置信息

type TagListModel

type TagListModel struct {
	BaseModel
}

func NewTagListModel

func NewTagListModel() *TagListModel

func (*TagListModel) GetTagList

func (self *TagListModel) GetTagList() ([]map[string]interface{}, error)

type Userinfo

type Userinfo struct {
	Id int
	//用户的唯一识别码
	Userauth   string    `orm:"size(30);unique"`
	Createtime time.Time `orm:"type(date)"`
}

用户信息表

type Userlog

type Userlog struct {
	Id int
	//用户ID
	Userid int
	//登陆时间
	Logintime time.Time `orm:"type(date)"`
}

用户日至,只记录用户当天首次登陆

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL