service

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	TVAppInfo *conf.TVApp // tv app basic info
	// memory
	HomeData     *model.Homepage                  // homepage data
	ZoneData     map[int][]*model.Card            // zone list data for homepage
	RankData     map[int]map[string][]*model.Card // zone pages data
	HeaderSids   map[int]int                      // use to remove duplicated ones
	ZoneSids     map[int]map[int]int              // same use as HeaderSids
	ZonesInfo    map[int]*conf.PageCfg            // zones information data
	PGCOrigins   map[int][]*model.Card            // pgc zone list data
	UGCOrigins   map[int][]*model.Card            // pgc types data
	PGCIndexShow map[int64]string                 // pgc index show data
	ModPages     map[int][]*model.Module          // module pages
	IdxIntervs   *seaMdl.IdxIntervSave            // index intervention storage
	RegionInfo   []*model.Region                  // region all
	MaxTime      int64
	// contains filtered or unexported fields
}

Service .

func New

func New(c *conf.Config) *Service

New .

func (*Service) EpMsg

func (s *Service) EpMsg(epid, build int64) (ok bool, msg string, err error)

EpMsg returns the ep and its season auth msg

func (*Service) EsPgcIdx

func (s *Service) EsPgcIdx(ctx context.Context, req *search.ReqPgcIdx) (res *search.EsPager, err error)

EsPgcIdx returns the elastic search index page result

func (*Service) EsUgcIdx

func (s *Service) EsUgcIdx(ctx context.Context, req *search.ReqUgcIdx) (res *search.EsPager, err error)

EsUgcIdx def.

func (*Service) FollowData

func (s *Service) FollowData(ctx context.Context, accessKey string) (res []*model.Follow)

FollowData gets the follow data from pgc api

func (*Service) HomeFollow

func (s *Service) HomeFollow(ctx context.Context, req *model.ReqHomeFollow) (data *model.Homepage, err error)

HomeFollow picks the homepage with follow data

func (*Service) HomeJP

func (s *Service) HomeJP(zoneData []*model.Card) (latest []*model.Card, list []*model.Card)

HomeJP picks the JP resources to fill the latest part and the list part

func (*Service) HomeList

func (s *Service) HomeList() (list map[string][]*model.Card, latest []*model.Card)

HomeList gets the five zones' list for the homepage

func (*Service) HomeRecom

func (s *Service) HomeRecom(ctx context.Context) (homeRecom []*model.Card, err error)

HomeRecom for the Homepage header, merge the rank data and the intervention data and gets the final header data

func (*Service) LoadZoneIdx

func (s *Service) LoadZoneIdx(page int, category int) (idxSns []*model.IdxSeason, pager *model.IdxPager, err error)

LoadZoneIdx loads zone index page data

func (*Service) ModHome

func (s *Service) ModHome() (homepage []*model.Module, err error)

ModHome load modularized homepage

func (*Service) PageFollow

func (s *Service) PageFollow(c context.Context, req *model.ReqPageFollow) (res []*model.Module, err error)

PageFollow serves the http level, it picks the follow location and fill in with follow data and then output

func (*Service) PgcCards

func (s *Service) PgcCards(ids []int64) (res map[int64]string, err error)

PgcCards treat the slice of int, and call the PGC api

func (*Service) RecomFilter

func (s *Service) RecomFilter(sid string, stype string) (res []*model.Recom, err error)

RecomFilter gets the recommend data from PGC API and filter the not passed seasons

func (*Service) Regions

func (s *Service) Regions(ctx context.Context) (res []*model.Region, err error)

Regions .

func (*Service) SearchTypes

func (s *Service) SearchTypes() (res []*model.ArcType, err error)

SearchTypes return the ugc types

func (*Service) SnMsg

func (s *Service) SnMsg(sid int64) (ok bool, msg string, err error)

SnMsg returns the season auth msg

Jump to

Keyboard shortcuts

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