dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//HBaseArticleTable 文章作者概况
	HBaseArticleTable = "read_auth_stats_daily"
)

Functions

func AnniversaryKey

func AnniversaryKey(mid int64) string

AnniversaryKey format anniversary key

func PromError

func PromError(name string)

PromError prom error

func PromInfo

func PromInfo(name string)

PromInfo add prom info

Types

type Dao

type Dao struct {

	// inteval
	UpdateRecommendsInterval int64
	UpdateBannersInterval    int64
	// contains filtered or unexported fields
}

Dao dao

func New

func New(c *conf.Config) (d *Dao)

New dao new

func (*Dao) Activity

func (d *Dao) Activity(c context.Context) (resp map[int64]*model.Activity, err error)

Activity .

func (*Dao) AddApply

func (d *Dao) AddApply(c context.Context, mid int64, content, category string) (err error)

AddApply add new apply

func (*Dao) AddArtDraft

func (d *Dao) AddArtDraft(c context.Context, a *artmdl.Draft) (id int64, err error)

AddArtDraft add article draft .

func (*Dao) AddArticleContentCache

func (d *Dao) AddArticleContentCache(c context.Context, id int64, content string) (err error)

AddArticleContentCache add article content cache

func (*Dao) AddArticleKeywordsCache

func (d *Dao) AddArticleKeywordsCache(c context.Context, id int64, keywords string) (err error)

AddArticleKeywordsCache add article keywords cache.

func (*Dao) AddArticleStatsCache

func (d *Dao) AddArticleStatsCache(c context.Context, id int64, v *model.Stats) (err error)

AddArticleStatsCache batch set article cache.

func (*Dao) AddArticlesMetaCache

func (d *Dao) AddArticlesMetaCache(c context.Context, vs ...*model.Meta) (err error)

AddArticlesMetaCache add articles meta cache

func (*Dao) AddAudioCardsCache

func (d *Dao) AddAudioCardsCache(c context.Context, vs map[int64]*model.AudioCard) (err error)

AddAudioCardsCache .

func (*Dao) AddAuthor

func (d *Dao) AddAuthor(c context.Context, mid int64) (err error)

AddAuthor add author

func (*Dao) AddBangumiCardsCache

func (d *Dao) AddBangumiCardsCache(c context.Context, vs map[int64]*model.BangumiCard) (err error)

AddBangumiCardsCache .

func (*Dao) AddBangumiEpCardsCache

func (d *Dao) AddBangumiEpCardsCache(c context.Context, vs map[int64]*model.BangumiCard) (err error)

AddBangumiEpCardsCache .

func (*Dao) AddCacheAidsByTag

func (d *Dao) AddCacheAidsByTag(c context.Context, id int64, val *model.TagArts) (err error)

AddCacheAidsByTag Set data to mc

func (*Dao) AddCacheArtsListID

func (d *Dao) AddCacheArtsListID(c context.Context, values map[int64]int64) (err error)

AddCacheArtsListID Set data to mc

func (*Dao) AddCacheAuthor

func (d *Dao) AddCacheAuthor(c context.Context, id int64, val *model.AuthorLimit) (err error)

AddCacheAuthor 增加作者状态缓存

func (*Dao) AddCacheHotspot

func (d *Dao) AddCacheHotspot(c context.Context, id int64, val *model.Hotspot) (err error)

AddCacheHotspot Set data to mc

func (*Dao) AddCacheHotspotArts

func (d *Dao) AddCacheHotspotArts(c context.Context, typ int8, id int64, arts [][2]int64, replace bool) (err error)

AddCacheHotspotArts .

func (*Dao) AddCacheHotspots

func (d *Dao) AddCacheHotspots(c context.Context, val []*model.Hotspot) (err error)

AddCacheHotspots Set data to mc

func (*Dao) AddCacheList

func (d *Dao) AddCacheList(c context.Context, id int64, val *model.List) (err error)

AddCacheList Set data to mc

func (*Dao) AddCacheListArts

func (d *Dao) AddCacheListArts(c context.Context, id int64, val []*model.ListArtMeta) (err error)

AddCacheListArts 增加文集含有的文章列表缓存

func (*Dao) AddCacheListArtsId

func (d *Dao) AddCacheListArtsId(c context.Context, id string, val *model.ArticleViewList) (err error)

AddCacheListArtsId Set data to mc

func (*Dao) AddCacheListReadCount

func (d *Dao) AddCacheListReadCount(c context.Context, id int64, val int64) (err error)

AddCacheListReadCount Set data to mc

func (*Dao) AddCacheLists

func (d *Dao) AddCacheLists(c context.Context, values map[int64]*model.List) (err error)

AddCacheLists Set data to mc

func (*Dao) AddCacheListsArts

func (d *Dao) AddCacheListsArts(c context.Context, values map[int64][]*model.ListArtMeta) (err error)

AddCacheListsArts Set data to mc

func (*Dao) AddCacheUpLists

func (d *Dao) AddCacheUpLists(c context.Context, id int64, val []int64) (err error)

AddCacheUpLists Set data to mc

func (*Dao) AddCacheUpStatDaily

func (d *Dao) AddCacheUpStatDaily(c context.Context, id int64, val *model.UpStat) (err error)

AddCacheUpStatDaily Set data to mc

func (*Dao) AddCheatFilter

func (d *Dao) AddCheatFilter(c context.Context, aid int64, lv int) (err error)

AddCheatFilter .

func (*Dao) AddComplaint

func (d *Dao) AddComplaint(c context.Context, aid, mid, ctype int64, reason, imageUrls string) (err error)

AddComplaint add complaint.

func (*Dao) AddComplaintCount

func (d *Dao) AddComplaintCount(c context.Context, aid int64) (err error)

AddComplaintCount .

func (*Dao) AddListArticle

func (d *Dao) AddListArticle(c context.Context, listID int64, aid int64, position int) (err error)

AddListArticle add list article

func (*Dao) AddMallCardsCache

func (d *Dao) AddMallCardsCache(c context.Context, vs map[int64]*model.MallCard) (err error)

AddMallCardsCache .

func (*Dao) AddRankCache

func (d *Dao) AddRankCache(c context.Context, cid int64, arts model.RankResp) (err error)

AddRankCache add rank cache

func (*Dao) AddReadPingSet

func (d *Dao) AddReadPingSet(c context.Context, buvid string, aid int64, mid int64, ip string, cur int64, source string) (err error)

AddReadPingSet 添加新的阅读记录

func (*Dao) AddSortCache

func (d *Dao) AddSortCache(c context.Context, categoryID int64, field int, aid, score int64) (err error)

AddSortCache add sort articles cache

func (*Dao) AddSubmitCache

func (d *Dao) AddSubmitCache(c context.Context, mid int64, title string) (err error)

AddSubmitCache add submit cache into mc.

func (*Dao) AddTicketCardsCache

func (d *Dao) AddTicketCardsCache(c context.Context, vs map[int64]*model.TicketCard) (err error)

AddTicketCardsCache .

func (*Dao) AddUpperCache

func (d *Dao) AddUpperCache(c context.Context, mid, aid int64, ptime int64) (err error)

AddUpperCache adds passed article of upper.

func (*Dao) AddUpperCaches

func (d *Dao) AddUpperCaches(c context.Context, idsm map[int64][][2]int64) (err error)

AddUpperCaches batch add passed article of upper.

func (*Dao) AllArticleMeta

func (d *Dao) AllArticleMeta(c context.Context, id int64) (res *artmdl.Meta, err error)

AllArticleMeta 所有状态/删除 的文章

func (*Dao) AllRecommendCount

func (d *Dao) AllRecommendCount(c context.Context, t time.Time) (res int64, err error)

AllRecommendCount .

func (*Dao) AllRecommends

func (d *Dao) AllRecommends(c context.Context, t time.Time, pn, ps int) (res []int64, err error)

AllRecommends .

func (*Dao) ApplyCount

func (d *Dao) ApplyCount(c context.Context) (count int64, err error)

ApplyCount get today apply count

func (*Dao) ArtDraft

func (d *Dao) ArtDraft(c context.Context, mid, aid int64) (res *artmdl.Draft, err error)

ArtDraft get draft by article_id

func (*Dao) ArtList

func (d *Dao) ArtList(c context.Context, aid int64) (res *model.List, err error)

ArtList article list

func (*Dao) Article

func (d *Dao) Article(c context.Context, aid int64) (res *artmdl.Article, err error)

Article gets article's meta and content.

func (*Dao) ArticleContent

func (d *Dao) ArticleContent(c context.Context, id int64) (res string, err error)

ArticleContent get article content

func (*Dao) ArticleContentCache

func (d *Dao) ArticleContentCache(c context.Context, id int64) (res string, err error)

ArticleContentCache article content cache

func (*Dao) ArticleKeywords

func (d *Dao) ArticleKeywords(c context.Context, id int64) (res string, err error)

ArticleKeywords get article keywords

func (*Dao) ArticleKeywordsCache

func (d *Dao) ArticleKeywordsCache(c context.Context, id int64) (res string, err error)

ArticleKeywordsCache article Keywords cache

func (*Dao) ArticleListCache

func (d *Dao) ArticleListCache(c context.Context, id int64) (res int64, err error)

ArticleListCache 获取文章所属文集

func (*Dao) ArticleMeta

func (d *Dao) ArticleMeta(c context.Context, id int64) (res *artmdl.Meta, err error)

ArticleMeta get article meta

func (*Dao) ArticleMetaCache

func (d *Dao) ArticleMetaCache(c context.Context, aid int64) (res *model.Meta, err error)

ArticleMetaCache gets article's meta cache.

func (*Dao) ArticleMetas

func (d *Dao) ArticleMetas(c context.Context, aids []int64) (res map[int64]*artmdl.Meta, err error)

ArticleMetas get article metats

func (*Dao) ArticleRemainCount

func (d *Dao) ArticleRemainCount(c context.Context, mid int64) (count int, err error)

ArticleRemainCount returns the number that user could be use to posting new articles.

func (*Dao) ArticleStats

func (d *Dao) ArticleStats(c context.Context, id int64) (res *model.Stats, err error)

ArticleStats get article stats

func (*Dao) ArticleStatsCache

func (d *Dao) ArticleStatsCache(c context.Context, id int64) (res *model.Stats, err error)

ArticleStatsCache article stats cache

func (*Dao) ArticleVersion

func (d *Dao) ArticleVersion(c context.Context, aid int64) (a *artmdl.Article, err error)

ArticleVersion .

func (*Dao) ArticlesMetaCache

func (d *Dao) ArticlesMetaCache(c context.Context, ids []int64) (cached map[int64]*model.Meta, missed []int64, err error)

ArticlesMetaCache articles meta cache

func (*Dao) ArticlesStats

func (d *Dao) ArticlesStats(c context.Context, ids []int64) (res map[int64]*model.Stats, err error)

ArticlesStats get articles stats

func (*Dao) ArticlesStatsCache

func (d *Dao) ArticlesStatsCache(c context.Context, ids []int64) (cached map[int64]*model.Stats, missed []int64, err error)

ArticlesStatsCache articles stats cache

func (*Dao) ArtsList

func (d *Dao) ArtsList(c context.Context, aids []int64) (res map[int64]*model.List, err error)

ArtsList get article's read list

func (*Dao) ArtsListID

func (d *Dao) ArtsListID(c context.Context, keys []int64) (res map[int64]int64, err error)

ArtsListID get data from cache if miss will call source method, then add to cache.

func (*Dao) AudioCard

func (d *Dao) AudioCard(c context.Context, ids []int64) (resp map[int64]*model.AudioCard, err error)

AudioCard .

func (*Dao) AudioCardsCache

func (d *Dao) AudioCardsCache(c context.Context, ids []int64) (vs map[int64]*model.AudioCard, err error)

AudioCardsCache .

func (*Dao) Author

func (d *Dao) Author(c context.Context, id int64) (res *model.AuthorLimit, err error)

Author get data from cache if miss will call source method, then add to cache.

func (*Dao) AuthorMostCategories

func (d *Dao) AuthorMostCategories(c context.Context, mid int64) (categories []int64, err error)

AuthorMostCategories .

func (*Dao) Authors

func (d *Dao) Authors(c context.Context) (res map[int64]*artmdl.AuthorLimit, err error)

Authors loads author list who are permitted to post articles.

func (*Dao) BangumiCard

func (d *Dao) BangumiCard(c context.Context, seasonIDs []int64, episodeIDs []int64) (resp map[int64]*model.BangumiCard, err error)

BangumiCard .

func (*Dao) BangumiCardsCache

func (d *Dao) BangumiCardsCache(c context.Context, ids []int64) (vs map[int64]*model.BangumiCard, err error)

BangumiCardsCache .

func (*Dao) BangumiEpCardsCache

func (d *Dao) BangumiEpCardsCache(c context.Context, ids []int64) (vs map[int64]*model.BangumiCard, err error)

BangumiEpCardsCache .

func (*Dao) BeginTran

func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error)

BeginTran begin transaction.

func (*Dao) BerserkerTagArts

func (d *Dao) BerserkerTagArts(c context.Context, tags []int64) (aids []int64, err error)

BerserkerTagArts .

func (*Dao) CacheAidsByTag

func (d *Dao) CacheAidsByTag(c context.Context, id int64) (res *model.TagArts, err error)

CacheAidsByTag get data from mc

func (*Dao) CacheAnniversary

func (d *Dao) CacheAnniversary(c context.Context, id int64) (res *model.AnniversaryInfo, err error)

CacheAnniversary get data from mc

func (*Dao) CacheArtsListID

func (d *Dao) CacheArtsListID(c context.Context, ids []int64) (res map[int64]int64, err error)

CacheArtsListID get data from mc

func (*Dao) CacheAuthor

func (d *Dao) CacheAuthor(c context.Context, id int64) (res *model.AuthorLimit, err error)

CacheAuthor get data from mc

func (*Dao) CacheHotspot

func (d *Dao) CacheHotspot(c context.Context, id int64) (res *model.Hotspot, err error)

CacheHotspot get data from mc

func (*Dao) CacheHotspots

func (d *Dao) CacheHotspots(c context.Context) (res []*model.Hotspot, err error)

CacheHotspots .

func (*Dao) CacheList

func (d *Dao) CacheList(c context.Context, id int64) (res *model.List, err error)

CacheList get data from mc

func (*Dao) CacheListArts

func (d *Dao) CacheListArts(c context.Context, id int64) (res []*model.ListArtMeta, err error)

CacheListArts 获取文集文章列表缓存

func (*Dao) CacheListArtsId

func (d *Dao) CacheListArtsId(c context.Context, id string) (res *model.ArticleViewList, err error)

CacheListArtsId get data from mc

func (*Dao) CacheListReadCount

func (d *Dao) CacheListReadCount(c context.Context, id int64) (res int64, err error)

CacheListReadCount get data from mc

func (*Dao) CacheLists

func (d *Dao) CacheLists(c context.Context, ids []int64) (res map[int64]*model.List, err error)

CacheLists get data from mc

func (*Dao) CacheListsArts

func (d *Dao) CacheListsArts(c context.Context, ids []int64) (res map[int64][]*model.ListArtMeta, err error)

CacheListsArts get data from mc

func (*Dao) CacheListsReadCount

func (d *Dao) CacheListsReadCount(c context.Context, ids []int64) (res map[int64]int64, err error)

CacheListsReadCount get data from mc

func (*Dao) CacheUpLists

func (d *Dao) CacheUpLists(c context.Context, id int64) (res []int64, err error)

CacheUpLists get data from mc

func (*Dao) CacheUpStatDaily

func (d *Dao) CacheUpStatDaily(c context.Context, id int64) (res *model.UpStat, err error)

CacheUpStatDaily get data from mc

func (*Dao) Capture

func (d *Dao) Capture(c context.Context, url string) (loc string, size int, err error)

Capture performs a HTTP Get request for the image url and upload bfs.

func (*Dao) Categories

func (d *Dao) Categories(c context.Context) (res map[int64]*model.Category, err error)

Categories get Categories

func (*Dao) CategoryAuthors

func (d *Dao) CategoryAuthors(c context.Context, category int64, count int) (authors []int64, err error)

CategoryAuthors .

func (*Dao) Close

func (d *Dao) Close()

Close close resource.

func (*Dao) ComplaintExist

func (d *Dao) ComplaintExist(c context.Context, aid, mid int64) (exist bool, err error)

ComplaintExist .

func (*Dao) ComplaintProtected

func (d *Dao) ComplaintProtected(c context.Context, aid int64) (protected bool, err error)

ComplaintProtected .

func (*Dao) CountUpperDraft

func (d *Dao) CountUpperDraft(c context.Context, mid int64) (count int, err error)

CountUpperDraft count upper's draft

func (*Dao) CreationArticleContent

func (d *Dao) CreationArticleContent(c context.Context, aid int64) (res string, err error)

CreationArticleContent gets article's content.

func (*Dao) CreationArticleMeta

func (d *Dao) CreationArticleMeta(c context.Context, id int64) (am *artmdl.Meta, err error)

CreationArticleMeta querys article's meta info for creation center by aid.

func (*Dao) CreativeArticles

func (d *Dao) CreativeArticles(c context.Context, aids []int64) (res map[int64]*model.ListArtMeta, err error)

CreativeArticles get up all state articles

func (*Dao) CreativeCategoryArticles

func (d *Dao) CreativeCategoryArticles(c context.Context, mid int64) (res []*model.ListArtMeta, err error)

CreativeCategoryArticles can add articles

func (*Dao) CreativeCountArticles

func (d *Dao) CreativeCountArticles(c context.Context, mid int64, cids []int64) (res int64, err error)

CreativeCountArticles novel count

func (*Dao) CreativeListAdd

func (d *Dao) CreativeListAdd(c context.Context, mid int64, name, imageURL, summary string, publishTime xtime.Time, words int64) (res int64, err error)

CreativeListAdd add list

func (*Dao) CreativeListArticles

func (d *Dao) CreativeListArticles(c context.Context, listID int64) (res []*model.ListArtMeta, err error)

CreativeListArticles .

func (*Dao) CreativeListDel

func (d *Dao) CreativeListDel(c context.Context, id int64) (err error)

CreativeListDel del list

func (*Dao) CreativeListDelAllArticles

func (d *Dao) CreativeListDelAllArticles(c context.Context, id int64) (err error)

CreativeListDelAllArticles del list

func (*Dao) CreativeListUpdate

func (d *Dao) CreativeListUpdate(c context.Context, id int64, name, imageURL, summary string, publishTime xtime.Time, words int64) (err error)

CreativeListUpdate update list

func (*Dao) CreativeListUpdateTime

func (d *Dao) CreativeListUpdateTime(c context.Context, id int64, t time.Time) (err error)

CreativeListUpdateTime update list time

func (*Dao) CreativeListsArticles

func (d *Dao) CreativeListsArticles(c context.Context, listIDs []int64) (res map[int64][]*model.ListArtMeta, err error)

CreativeListsArticles .

func (*Dao) CreativeUpLists

func (d *Dao) CreativeUpLists(c context.Context, mid int64) (res []*model.List, err error)

CreativeUpLists get article lists

func (*Dao) DelActivity

func (d *Dao) DelActivity(c context.Context, aid int64, ip string) (err error)

DelActivity delete activity

func (*Dao) DelArtDraft

func (d *Dao) DelArtDraft(c context.Context, mid, aid int64) (err error)

DelArtDraft deletes article draft.

func (*Dao) DelArticleContentCache

func (d *Dao) DelArticleContentCache(c context.Context, id int64) (err error)

DelArticleContentCache delete article content cache

func (*Dao) DelArticleMetaCache

func (d *Dao) DelArticleMetaCache(c context.Context, id int64) (err error)

DelArticleMetaCache delete article meta cache

func (*Dao) DelArticleStatsCache

func (d *Dao) DelArticleStatsCache(c context.Context, id int64) (err error)

DelArticleStatsCache delete article stats cache

func (*Dao) DelCacheAuthor

func (d *Dao) DelCacheAuthor(c context.Context, id int64) (err error)

DelCacheAuthor delete data from mc

func (*Dao) DelCacheHotspots

func (d *Dao) DelCacheHotspots(c context.Context) (err error)

DelCacheHotspots delete data from mc

func (*Dao) DelCacheListArtsId

func (d *Dao) DelCacheListArtsId(c context.Context, id string) (err error)

DelCacheListArtsId delete data from mc

func (*Dao) DelCheatFilter

func (d *Dao) DelCheatFilter(c context.Context, aid int64) (err error)

DelCheatFilter .

func (*Dao) DelHotspotArtsCache

func (d *Dao) DelHotspotArtsCache(c context.Context, typ int8, hid int64, aid int64) (err error)

DelHotspotArtsCache .

func (*Dao) DelListArticle

func (d *Dao) DelListArticle(c context.Context, listID int64, aid int64) (err error)

DelListArticle delete list article

func (*Dao) DelRecommend

func (d *Dao) DelRecommend(c context.Context, aid int64) (err error)

DelRecommend delete recommend

func (*Dao) DelScore

func (d *Dao) DelScore(c context.Context, aid, mediaID, mid int64) (err error)

DelScore get media score.

func (*Dao) DelSortCache

func (d *Dao) DelSortCache(c context.Context, categoryID int64, field int, aid int64) (err error)

DelSortCache delete sort cache

func (*Dao) DelSubmitCache

func (d *Dao) DelSubmitCache(c context.Context, mid int64, title string) (err error)

DelSubmitCache del submit cache into mc.

func (*Dao) DelUpperCache

func (d *Dao) DelUpperCache(c context.Context, mid int64, aid int64) (err error)

DelUpperCache delete article of upper cache.

func (*Dao) DynamicCount

func (d *Dao) DynamicCount(c context.Context, aid int64) (count int64, err error)

DynamicCount get dynamic count from api

func (*Dao) EditTimes

func (d *Dao) EditTimes(c context.Context, id int64) (count int, err error)

EditTimes count times of article edited.

func (*Dao) ExpireHotspotArtsCache

func (d *Dao) ExpireHotspotArtsCache(c context.Context, typ int8, id int64) (ok bool, err error)

ExpireHotspotArtsCache .

func (*Dao) ExpireMaxLikeCache

func (d *Dao) ExpireMaxLikeCache(c context.Context, aid int64) (res bool, err error)

ExpireMaxLikeCache expire max like cache

func (*Dao) ExpireRankCache

func (d *Dao) ExpireRankCache(c context.Context, cid int64) (res bool, err error)

ExpireRankCache expire rank cache

func (*Dao) ExpireSortCache

func (d *Dao) ExpireSortCache(c context.Context, categoryID int64, field int) (ok bool, err error)

ExpireSortCache expire sort cache

func (*Dao) ExpireUpperCache

func (d *Dao) ExpireUpperCache(c context.Context, mid int64) (ok bool, err error)

ExpireUpperCache expire the upper key.

func (*Dao) ExpireUppersCache

func (d *Dao) ExpireUppersCache(c context.Context, mids []int64) (res map[int64]bool, err error)

ExpireUppersCache expire the upper key.

func (*Dao) GetsetReadPing

func (d *Dao) GetsetReadPing(c context.Context, buvid string, aid int64, cur int64) (last int64, err error)

GetsetReadPing 设置并获取上次阅读心跳时间,不存在则返回0

func (*Dao) HandleActivity

func (d *Dao) HandleActivity(c context.Context, mid, aid, actID int64, state int, ip string) (err error)

HandleActivity add or delete activity

func (*Dao) HotspotArtsCache

func (d *Dao) HotspotArtsCache(c context.Context, typ int8, id int64, start, end int) (res []int64, err error)

HotspotArtsCache .

func (*Dao) HotspotArtsCacheCount

func (d *Dao) HotspotArtsCacheCount(c context.Context, typ int8, id int64) (res int64, err error)

HotspotArtsCacheCount .

func (*Dao) Hotspots

func (d *Dao) Hotspots(c context.Context) (res []*model.Hotspot, err error)

Hotspots .

func (*Dao) Identify

func (d *Dao) Identify(c context.Context, mid int64) (res *artmdl.Identify, err error)

Identify gets user verify info.

func (*Dao) IsDraftDeleted

func (d *Dao) IsDraftDeleted(c context.Context, mid, aid int64) (deleted bool, err error)

IsDraftDeleted judges is draft has been deleted.

func (*Dao) LastReason

func (d *Dao) LastReason(c context.Context, id int64, state int32) (res string, err error)

LastReason return last reason from article_versions by aid and state.

func (*Dao) List

func (d *Dao) List(c context.Context, id int64) (res *model.List, err error)

List get data from cache if miss will call source method, then add to cache.

func (*Dao) ListArts

func (d *Dao) ListArts(c context.Context, id int64) (res []*model.ListArtMeta, err error)

ListArts get data from cache if miss will call source method, then add to cache.

func (*Dao) ListArtsCacheMap

func (d *Dao) ListArtsCacheMap(c context.Context, id int64) (res map[int64]*model.ListArtMeta, err error)

ListArtsCacheMap get read list articles cache

func (*Dao) Lists

func (d *Dao) Lists(c context.Context, keys []int64) (res map[int64]*model.List, err error)

Lists get data from cache if miss will call source method, then add to cache.

func (*Dao) ListsArts

func (d *Dao) ListsArts(c context.Context, keys []int64) (res map[int64][]*model.ListArtMeta, err error)

ListsArts get data from cache if miss will call source method, then add to cache.

func (*Dao) MallCard

func (d *Dao) MallCard(c context.Context, ids []int64) (resp map[int64]*model.MallCard, err error)

MallCard .

func (*Dao) MallCardsCache

func (d *Dao) MallCardsCache(c context.Context, ids []int64) (vs map[int64]*model.MallCard, err error)

MallCardsCache .

func (*Dao) MaxLikeCache

func (d *Dao) MaxLikeCache(c context.Context, aid int64) (res int64, err error)

MaxLikeCache max like cache

func (*Dao) Media

func (d *Dao) Media(c context.Context, mediaID, mid int64) (res *model.MediaResult, err error)

Media get media score.

func (*Dao) MediaArticle

func (d *Dao) MediaArticle(c context.Context, mediaID int64, mid int64) (id int64, err error)

MediaArticle .

func (*Dao) MediaIDByID

func (d *Dao) MediaIDByID(c context.Context, aid int64) (id int64, err error)

MediaIDByID .

func (*Dao) MoreArtsCaches

func (d *Dao) MoreArtsCaches(c context.Context, mid, ptime int64, num int) (before []int64, after []int64, err error)

MoreArtsCaches batch get early articles of upper by publish time.

func (*Dao) NewArticleCount

func (d *Dao) NewArticleCount(c context.Context, ptime int64) (res int64, err error)

NewArticleCount get new article count

func (*Dao) NoticeState

func (d *Dao) NoticeState(c context.Context, mid int64) (res int64, err error)

NoticeState .

func (*Dao) Notices

func (d *Dao) Notices(c context.Context, t time.Time) (res []*model.Notice, err error)

Notices notice .

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) (err error)

Ping check connection success.

func (*Dao) PubShare

func (d *Dao) PubShare(c context.Context, mid int64, aid int64, ip string) (err error)

PubShare add share count

func (*Dao) PubView

func (d *Dao) PubView(c context.Context, mid int64, aid int64, ip string, cheat *artmdl.CheatInfo) (err error)

PubView adds a view count.

func (*Dao) Rank

func (d *Dao) Rank(c context.Context, cid int64, ip string) (res model.RankResp, err error)

Rank get rank from bigdata

func (*Dao) RankCache

func (d *Dao) RankCache(c context.Context, cid int64) (res model.RankResp, err error)

RankCache get rank cache

func (*Dao) RawAllLists

func (d *Dao) RawAllLists(c context.Context) (res []*model.List, err error)

RawAllLists get lists from db

func (*Dao) RawAllListsEx

func (d *Dao) RawAllListsEx(c context.Context, start int, size int) (res []*model.List, err error)

RawAllListsEx get lists from db

func (*Dao) RawArtsListID

func (d *Dao) RawArtsListID(c context.Context, aids []int64) (res map[int64]int64, err error)

RawArtsListID get articles list from db

func (*Dao) RawAuthor

func (d *Dao) RawAuthor(c context.Context, mid int64) (res *artmdl.AuthorLimit, err error)

RawAuthor get author's info.

func (*Dao) RawList

func (d *Dao) RawList(c context.Context, id int64) (res *model.List, err error)

RawList get list from db

func (*Dao) RawListArts

func (d *Dao) RawListArts(c context.Context, listID int64) (res []*model.ListArtMeta, err error)

RawListArts .

func (*Dao) RawListReadCount

func (d *Dao) RawListReadCount(c context.Context, id int64) (res int64, err error)

RawListReadCount .

func (*Dao) RawLists

func (d *Dao) RawLists(c context.Context, ids []int64) (res map[int64]*model.List, err error)

RawLists get lists from db

func (*Dao) RawListsArts

func (d *Dao) RawListsArts(c context.Context, ids []int64) (res map[int64][]*model.ListArtMeta, err error)

RawListsArts .

func (*Dao) RawUpLists

func (d *Dao) RawUpLists(c context.Context, mid int64) (res []int64, err error)

RawUpLists .

func (*Dao) RebuildListReadCountCache

func (d *Dao) RebuildListReadCountCache(c context.Context, id int64) (err error)

RebuildListReadCountCache .

func (*Dao) RebuildUpListsCache

func (d *Dao) RebuildUpListsCache(c context.Context, mid int64) (err error)

RebuildUpListsCache .

func (*Dao) RecommendAuthors

func (d *Dao) RecommendAuthors(c context.Context, platform string, mobiApp string, device string, build int, clientIP string, userID int64, buvid string, recType string, serviceArea string, _rapagesizen int, mid int64) (res []*model.RecommendAuthor, err error)

RecommendAuthors .

func (*Dao) RecommendByCategory

func (d *Dao) RecommendByCategory(c context.Context, categoryID int64) (res []*artmdl.Recommend, err error)

RecommendByCategory find recommend by category

func (*Dao) SearchArts

func (d *Dao) SearchArts(c context.Context, ptime int64) (res []*model.SearchArt, err error)

SearchArts get articles publish time after ptime

func (*Dao) SendMessage

func (d *Dao) SendMessage(c context.Context, tid, mid, aid int64, title, msg string) (err error)

SendMessage .

func (*Dao) SetArticleListCache

func (d *Dao) SetArticleListCache(c context.Context, listID int64, arts []*model.ListArtMeta) (err error)

SetArticleListCache set article list cache

func (*Dao) SetArticlesListCache

func (d *Dao) SetArticlesListCache(c context.Context, values map[int64]int64) (err error)

SetArticlesListCache 增加文章所属文集缓存

func (*Dao) SetMaxLikeCache

func (d *Dao) SetMaxLikeCache(c context.Context, aid int64, value int64) (err error)

SetMaxLikeCache set max like cache

func (*Dao) SetScore

func (d *Dao) SetScore(c context.Context, score, aid, mediaID, mid int64) (err error)

SetScore set media score.

func (*Dao) Settings

func (d *Dao) Settings(c context.Context) (res map[string]string, err error)

Settings gets article settings.

func (*Dao) SkyHorse

func (d *Dao) SkyHorse(c context.Context, mid int64, build int, buvid string, plat int8, ps int) (res *model.SkyHorseResp, err error)

SkyHorse sky horse

func (*Dao) SortCache

func (d *Dao) SortCache(c context.Context, categoryID int64, field int, start, end int) (res []int64, err error)

SortCache get sort cache

func (*Dao) SortCacheByValue

func (d *Dao) SortCacheByValue(c context.Context, categoryID int64, field int, value, score int64, ps int) (res []int64, err error)

SortCacheByValue get new articles cache by aid

func (*Dao) SubmitCache

func (d *Dao) SubmitCache(c context.Context, mid int64, title string) (exist bool, err error)

SubmitCache get user submit cache.

func (*Dao) TagArticles

func (d *Dao) TagArticles(c context.Context, tags []int64) (aids []int64, err error)

TagArticles .

func (*Dao) ThirtyDayArticle

func (d *Dao) ThirtyDayArticle(c context.Context, mid int64) (res []*model.ThirtyDayArticle, err error)

ThirtyDayArticle for Read/Reply/Like/Fav/Coin for article 30 days.

func (*Dao) TicketCard

func (d *Dao) TicketCard(c context.Context, ids []int64) (resp map[int64]*model.TicketCard, err error)

TicketCard get ticket card from api

func (*Dao) TicketCardsCache

func (d *Dao) TicketCardsCache(c context.Context, ids []int64) (vs map[int64]*model.TicketCard, err error)

TicketCardsCache .

func (*Dao) TxAddArticleContent

func (d *Dao) TxAddArticleContent(c context.Context, tx *xsql.Tx, aid int64, content string, tags []string) (err error)

TxAddArticleContent adds article's body via transaction.

func (*Dao) TxAddArticleMeta

func (d *Dao) TxAddArticleMeta(c context.Context, tx *xsql.Tx, a *artmdl.Meta, actID int64) (id int64, err error)

TxAddArticleMeta adds article's meta via transaction.

func (*Dao) TxAddArticleVersion

func (d *Dao) TxAddArticleVersion(c context.Context, tx *xsql.Tx, id int64, a *artmdl.Article, actID int64) (err error)

TxAddArticleVersion adds article version.

func (*Dao) TxAddListArticle

func (d *Dao) TxAddListArticle(c context.Context, tx *xsql.Tx, listID int64, aid int64, position int) (err error)

TxAddListArticle tx add list article

func (*Dao) TxDelArticleList

func (d *Dao) TxDelArticleList(tx *xsql.Tx, aid int64) (err error)

TxDelArticleList .

func (*Dao) TxDelArticleVersion

func (d *Dao) TxDelArticleVersion(c context.Context, tx *xsql.Tx, aid int64) (err error)

TxDelArticleVersion deletes article version.

func (*Dao) TxDelFilteredArtContent

func (d *Dao) TxDelFilteredArtContent(c context.Context, tx *xsql.Tx, aid int64) (err error)

TxDelFilteredArtContent delete filtered article content

func (*Dao) TxDelFilteredArtMeta

func (d *Dao) TxDelFilteredArtMeta(c context.Context, tx *xsql.Tx, aid int64) (err error)

TxDelFilteredArtMeta delete filetered article meta

func (*Dao) TxDelListArticle

func (d *Dao) TxDelListArticle(c context.Context, tx *xsql.Tx, listID int64, aid int64) (err error)

TxDelListArticle tx del list article

func (*Dao) TxDeleteArticleContent

func (d *Dao) TxDeleteArticleContent(c context.Context, tx *xsql.Tx, aid int64) (err error)

TxDeleteArticleContent deletes article's meta via transaction.

func (*Dao) TxDeleteArticleDraft

func (d *Dao) TxDeleteArticleDraft(c context.Context, tx *xsql.Tx, mid, aid int64) (err error)

TxDeleteArticleDraft deletes article draft via transaction.

func (*Dao) TxDeleteArticleMeta

func (d *Dao) TxDeleteArticleMeta(c context.Context, tx *xsql.Tx, aid int64) (err error)

TxDeleteArticleMeta deletes article's meta via transaction.

func (*Dao) TxUpdateArticleContent

func (d *Dao) TxUpdateArticleContent(c context.Context, tx *xsql.Tx, aid int64, content string, tags []string) (err error)

TxUpdateArticleContent updates article's body via transaction.

func (*Dao) TxUpdateArticleMeta

func (d *Dao) TxUpdateArticleMeta(c context.Context, tx *xsql.Tx, a *artmdl.Meta) (err error)

TxUpdateArticleMeta updates article's meta via transaction.

func (*Dao) TxUpdateArticleState

func (d *Dao) TxUpdateArticleState(c context.Context, tx *xsql.Tx, aid int64, state int32) (err error)

TxUpdateArticleState updates article's state.

func (*Dao) TxUpdateArticleStateApplyTime

func (d *Dao) TxUpdateArticleStateApplyTime(c context.Context, tx *xsql.Tx, aid int64, state int32) (err error)

TxUpdateArticleStateApplyTime updates article's state and apply time.

func (*Dao) TxUpdateArticleVersion

func (d *Dao) TxUpdateArticleVersion(c context.Context, tx *xsql.Tx, id int64, a *artmdl.Article, actID int64) (err error)

TxUpdateArticleVersion updates article version.

func (*Dao) UpLists

func (d *Dao) UpLists(c context.Context, id int64) (res []int64, err error)

UpLists get data from cache if miss will call source method, then add to cache.

func (*Dao) UpStat

func (d *Dao) UpStat(c context.Context, mid int64) (stat model.UpStat, err error)

UpStat get the stat of article.

func (*Dao) UpdateArticleState

func (d *Dao) UpdateArticleState(c context.Context, aid int64, state int) (err error)

UpdateArticleState updates article's state.

func (*Dao) UpdateNoticeState

func (d *Dao) UpdateNoticeState(c context.Context, mid int64, state int64) (err error)

UpdateNoticeState update notice state

func (*Dao) UploadImage

func (d *Dao) UploadImage(c context.Context, fileType string, bs []byte) (location string, err error)

UploadImage upload bfs.

func (*Dao) UpperArticleCount

func (d *Dao) UpperArticleCount(c context.Context, mid int64) (res int, err error)

UpperArticleCount get upper article count

func (*Dao) UpperArticlesMeta

func (d *Dao) UpperArticlesMeta(c context.Context, mid int64, group, category int) (as []*artmdl.Meta, err error)

UpperArticlesMeta gets article list by mid.

func (*Dao) UpperArticlesTypeCount

func (d *Dao) UpperArticlesTypeCount(c context.Context, mid int64) (res *artmdl.CreationArtsType, err error)

UpperArticlesTypeCount gets article count by type.

func (*Dao) UpperArtsCountCache

func (d *Dao) UpperArtsCountCache(c context.Context, mid int64) (res int, err error)

UpperArtsCountCache get upper articles count

func (*Dao) UpperDrafts

func (d *Dao) UpperDrafts(c context.Context, mid int64, start, ps int) (res []*artmdl.Draft, err error)

UpperDrafts batch get draft by mid.

func (*Dao) UpperPassed

func (d *Dao) UpperPassed(c context.Context, mid int64) (aids [][2]int64, err error)

UpperPassed upper passed articles

func (*Dao) UppersCaches

func (d *Dao) UppersCaches(c context.Context, mids []int64, start, end int) (res map[int64][]int64, err error)

UppersCaches batch get new articles of uppers by cache.

func (*Dao) UppersPassed

func (d *Dao) UppersPassed(c context.Context, mids []int64) (aidm map[int64][][2]int64, err error)

UppersPassed uppers passed articles

Jump to

Keyboard shortcuts

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