thirdp

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DBeiPGC is dangbei pgc typeC
	DBeiPGC = "pgc"
	// DBeiUGC is dangbei ugc typeC
	DBeiUGC = "ugc"
)
View Source
const (

	// MangoPGC is mango pgc typeC
	MangoPGC = "mango_pgc"
	// MangoUGC is mango ugc typeC
	MangoUGC = "mango_ugc"
)

Variables

This section is empty.

Functions

func KeyThirdp

func KeyThirdp(typeC string) (key string, err error)

KeyThirdp returns the key in Redis according to the type input

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao .

func New

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

New .

func (*Dao) DBeiPages

func (d *Dao) DBeiPages(ctx context.Context, req *thirdp.ReqDBeiPages) (sids []int64, myLast int64, err error)

DBeiPages picks a page for dangbei api, lastID is the last page's biggest ID

func (*Dao) GetSnCnt

func (d *Dao) GetSnCnt(c context.Context, isPGC bool, sid int64) (cnt int, err error)

GetSnCnt get season/archive count cache.

func (*Dao) GetThirdpCnt

func (d *Dao) GetThirdpCnt(c context.Context, typeC string) (count int, err error)

GetThirdpCnt get dangbei pgc data count

func (*Dao) LoadPageID

func (d *Dao) LoadPageID(c context.Context, req *thirdp.ReqDBeiPages) (biggestID int64, err error)

LoadPageID picks the last page's biggest ID

func (*Dao) LoadSnCnt

func (d *Dao) LoadSnCnt(ctx context.Context, isPGC bool, sid int64) (cnt int, err error)

LoadSnCnt loads season's ep cnt, or archive's video cnt

func (*Dao) MangoOrder

func (d *Dao) MangoOrder(c context.Context) (s []int64, err error)

MangoOrder gets mango recom data.

func (*Dao) MangoPages

func (d *Dao) MangoPages(ctx context.Context, req *thirdp.ReqDBeiPages) (sids []*thirdp.RespSid, myLast int64, err error)

MangoPages picks a page for dangbei api, lastID is the last page's biggest ID

func (*Dao) MangoRecom

func (d *Dao) MangoRecom(c context.Context, ids []int64) (data []*model.MangoRecom, err error)

MangoRecom picks the mango recom data from DB

func (*Dao) MangoSnCnt

func (d *Dao) MangoSnCnt(ctx context.Context, isPGC bool, sid int64) (cnt int, err error)

MangoSnCnt counts ep/video number from DB

func (*Dao) MangoSnOffset

func (d *Dao) MangoSnOffset(ctx context.Context, isPGC bool, sid int64, pageN, pagesize int) (epids []*thirdp.RespSid, err error)

MangoSnOffset picks season or arc's detail info by page ( limit + offset )

func (*Dao) SetPageID

func (d *Dao) SetPageID(c context.Context, req *thirdp.ReqPageID) (err error)

SetPageID is used to record each dangbei page's biggest ID, it's to ease the next page's pickup

func (*Dao) SetSnCnt

func (d *Dao) SetSnCnt(c context.Context, isPGC bool, sid int64, cnt int) (err error)

SetSnCnt save season/archive count

func (*Dao) SetThirdpCnt

func (d *Dao) SetThirdpCnt(c context.Context, count int, typeC string) (err error)

SetThirdpCnt is used to record dangbei pgc data count

func (*Dao) ThirdpCnt

func (d *Dao) ThirdpCnt(ctx context.Context, typeC string) (count int, err error)

ThirdpCnt counts the number of pgc/ugc data to display for dangbei

Jump to

Keyboard shortcuts

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