Documentation ¶
Index ¶
- Variables
- func ArticleAfter(article *orm.Article)
- func ArticleRank(article orm.Article) (rank float64)
- func CreateTempQrcode(id int32) (*qrcode.TempQrcode, error)
- func Decode(s string) (ids []int)
- func Encode(ids []int) (s string)
- func Find(url string) (article wechat.Article, err error)
- func GetArticle(limit, offset, tag int) (articles []orm.Article, err error)
- func GetBindQrcode(uid int) (url string, err error)
- func GetMd5String(s string) string
- func GetMediaByAppID(appID string) (media orm.Media, err error)
- func GetMediaByID(id int) (media orm.Media, err error)
- func GetMediaIDByAppID()
- func GetRandomSalt() string
- func GetRandomString(l int) string
- func GetTagByMediaID(id int) (tag orm.Tag, err error)
- func GetTagByType(name string) (tags []orm.Tag, err error)
- func GetTagsByIDS(idstr string) (tags []orm.Tag, err error)
- func GetTagsByTitle(name string) (tags []orm.Tag, err error)
- func GetTimestamp() int64
- func Hate(id int) (a orm.Article, err error)
- func Insert(url string) (article wechat.Article, err error)
- func Like(id int) (a orm.Article, err error)
- func Post(url string) (err error)
- func PrintErrorImageHandler(w http.ResponseWriter, r *http.Request)
- func PrintImageHandler(u string, w http.ResponseWriter, r *http.Request)
- func Rank(vote int, devote int, timestamp int64) float64
- func Remove(url string) (article wechat.Article, err error)
- func SaveImg(imageURL, saveName string) (n int64, err error)
- func SearchTags(title string) (tags []orm.Tag, err error)
- func SendArticle(openID, title, description, picURL, url string) (err error)
- func SendEmail(address, title, body string) (err error)
- func SendText(openID, text string) (err error)
- func SetWebGetSignTaskValueForWechatPush(str, openID string) bool
- func SpiderGet(url string) (article wechat.Article, err error)
- func Str2Int64(str string) []int64
- func Tag(id int) (tag orm.Tag, err error)
- func View(id int) (a orm.Article, err error)
- func WechatServe(w http.ResponseWriter, r *http.Request)
- type ArticleItem
- func GetArticleCursorByID(id, limit int, tags []int64) (rows []ArticleItem, err error)
- func GetArticleCursorByRank(rank float64, limit int, tags []int64) (rows []ArticleItem, err error)
- func GetArticleData(article orm.Article) (data ArticleItem)
- func GetArticlesByTitle(text string, rank float64, limit int) (rows []ArticleItem, err error)
- func GetArticlesData(articles []orm.Article) (rows []ArticleItem)
- type JsSign
- type TagItem
Constants ¶
This section is empty.
Variables ¶
View Source
var CacheTags = map[int]TagItem{}
CacheTags 缓存标签
View Source
var Hid *hashids.HashID
Hid ...
Functions ¶
func ArticleRank ¶
ArticleRank 获取文章RANK 该rank具有维一性,可作游标 通过创建时间计算期分值,以赞同否定作为偏移值
func CreateTempQrcode ¶
func CreateTempQrcode(id int32) (*qrcode.TempQrcode, error)
CreateTempQrcode 创建临时二维码
func GetArticle ¶
GetArticle 获取文章列表
func GetMediaByAppID ¶
GetMediaByAppID 通过 appID 获取公众号信息
func GetMediaByID ¶
GetMediaByID 通过 appID 获取公众号信息
func GetMediaIDByAppID ¶
func GetMediaIDByAppID()
func GetTagByType ¶
GetTagByType ..通过属性获取标签
func GetTagsByIDS ¶
GetTagsByIDS ..通过id获取标签
func GetTagsByTitle ¶
GetTagsByTitle ..通过属性获取标签
func PrintErrorImageHandler ¶
func PrintErrorImageHandler(w http.ResponseWriter, r *http.Request)
PrintErrorImageHandler 显示错误图片
func PrintImageHandler ¶
func PrintImageHandler(u string, w http.ResponseWriter, r *http.Request)
PrintImageHandler 显示正常图片
func SendArticle ¶
SendArticle 发送文章
func SetWebGetSignTaskValueForWechatPush ¶
SetWebGetSignTaskValueForWechatPush ..
Types ¶
type ArticleItem ¶
type ArticleItem struct { ID uint Title string Author string Cover string PubAt time.Time MediaTagID int MediaTagTitle string Like int Hate int Rank float64 URL string }
ArticleItem 返回前台使用的文章信息
func GetArticleCursorByID ¶
func GetArticleCursorByID(id, limit int, tags []int64) (rows []ArticleItem, err error)
GetArticleCursorByID 通过ID游标方式获取最新收录文章
func GetArticleCursorByRank ¶
func GetArticleCursorByRank(rank float64, limit int, tags []int64) (rows []ArticleItem, err error)
GetArticleCursorByRank 通过Rank游标方式获取热门文章
func GetArticleData ¶
func GetArticleData(article orm.Article) (data ArticleItem)
GetArticleData 获取文章数据,转义返回
func GetArticlesByTitle ¶
func GetArticlesByTitle(text string, rank float64, limit int) (rows []ArticleItem, err error)
GetArticlesByTitle 通过Rank游标方式获取热门文章
func GetArticlesData ¶
func GetArticlesData(articles []orm.Article) (rows []ArticleItem)
GetArticlesData 获取文章数据,转义返回
Click to show internal directories.
Click to hide internal directories.