Documentation ¶
Index ¶
Constants ¶
View Source
const ( WeiboPageSize int = 15 ArticlePageSize int = 5 )
*
- 定义常量
Variables ¶
View Source
var DB *gorm.DB
View Source
var Redis redis.Conn
Functions ¶
Types ¶
type ArticleDetail ¶
func GetArticleDetail ¶
func GetArticleDetail(id string) (data *ArticleDetail, err error)
type ArticleList ¶
type ArticleList struct { Total int `json:"total"` // 文章总数 PerPage int `json:"per_page"` // 下一页页码 List []*TpMovie `json:"list"` // 文章列表 }
func GetArticleList ¶
func GetArticleList(page string, count int) (list *ArticleList, err error)
type ImgConList ¶
func GetImgConList ¶
func GetImgConList(t int) (list *ImgConList, err error)
type ShanList ¶
func GetShanList ¶
type TpImages ¶
type TpImages struct { Id int `gorm:"type:int(11);AUTO_INCREMENT" json:"id"` // id PicUrl string `gorm:"type:varchar(255)" json:"pic_url"` // 图片地址 TargetId int `gorm:"type:int(11);default:0" json:"target_id"` // 目标id Target int `gorm:"type:tinyint(3);default:0" json:"target"` // 目标类型,0摄影,1相册 }
func GetImgList ¶
type TpMovie ¶
type TpMovie struct { Id int `gorm:"type:mediumint(7);AUTO_INCREMENT" json:"id"` // 文章id Title string `gorm:"type:varchar(50);not null" json:"title"` // 标题 Cover string `gorm:"type:varchar(255);not null" json:"cover"` // 封面图 Content string `gorm:"type:text;not null" json:"content"` // 内容 Time time.Time `gorm:"type:date;not null" json:"time"` // 创建日期 IsMarkdown string `gorm:"type:varchar(10);not null" json:"is_markdown"` // 是否markdown格式 }
Click to show internal directories.
Click to hide internal directories.