show

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ext

type Ext struct {
	LiveCnt int `json:"live_count,omitempty"`
}
type Head struct {
	ID        int    `json:"-"`
	CardID    int    `json:"card_id,omitempty"`
	Plat      int8   `json:"-"`
	Param     string `json:"param"`
	Type      string `json:"type"`
	Style     string `json:"style"`
	Title     string `json:"title"`
	Rank      int    `json:"-"`
	Build     int    `json:"-"`
	Condition string `json:"-"`
	Language  string `json:"-"`
	Date      int64  `json:"date,omitempty"`
	Cover     string `json:"cover,omitempty"`
	URI       string `json:"uri,omitempty"`
	Goto      string `json:"goto,omitempty"`
}

Head is show head.

func (*Head) FillBuildURI

func (h *Head) FillBuildURI(plat int8, build int)

type Item

type Item struct {
	Sid    int    `json:"-"`
	Title  string `json:"title"`
	Cover  string `json:"cover"`
	URI    string `json:"uri"`
	NewURI string `json:"-"`
	Param  string `json:"param"`
	Goto   string `json:"goto"`
	Random int    `json:"-"`
	// av
	Play    int    `json:"play,omitempty"`
	Danmaku int    `json:"danmaku,omitempty"`
	Area    string `json:"area,omitempty"`
	AreaID  int    `json:"area_id,omitempty"`
	Rname   string `json:"rname,omitempty"`
	// av stat
	Duration int64 `json:"duration,omitempty"`
	// live and feed
	Name string `json:"name,omitempty"`
	Face string `json:"face,omitempty"`
	// only live
	Online int `json:"online,omitempty"`
	// only feed
	CTime int64 `json:"ctime,omitempty"`
	// bangumi
	Finish     int8   `json:"finish,omitempty"`
	Index      string `json:"index,omitempty"`
	TotalCount string `json:"total_count,omitempty"`
	MTime      string `json:"mtime,omitempty"`
	// movie and bangumi badge
	Status    int8   `json:"status,omitempty"`
	CoverMark string `json:"cover_mark,omitempty"`
	Fav       int    `json:"favourite,omitempty"`
	// rank
	Rank int `json:"-"`
	// cpm
	RequestId   string `json:"request_id,omitempty"`
	CreativeId  int    `json:"creative_id,omitempty"`
	SrcId       int    `json:"src_id,omitempty"`
	IsAd        bool   `json:"is_ad"`
	IsAdReplace bool   `json:"-"`
	IsAdLoc     bool   `json:"is_ad_loc,omitempty"`
	CmMark      int    `json:"cm_mark"`
	AdCb        string `json:"ad_cb,omitempty"`
	ShowUrl     string `json:"show_url,omitempty"`
	ClickUrl    string `json:"click_url,omitempty"`
	ClientIp    string `json:"client_ip,omitempty"`
	// article
	CateID     int      `json:"cate_id,omitempty"`
	CateName   string   `json:"cate_name,omitempty"`
	Summary    string   `json:"summary,omitempty"`
	Covers     []string `json:"covers,omitempty"`
	Reply      int      `json:"reply,omitempty"`
	TemplateID int      `json:"template_id,omitempty"`
	BannerURL  string   `json:"banner_url,omitempty"`
	//new manager
	Desc  string `json:"desc,omitempty"`
	Stime string `json:"stime,omitempty"`
	Etime string `json:"etime,omitempty"`
	// rank
	Pts      int64   `json:"pts,omitempty"`
	Children []*Item `json:"children,omitempty"`
	Like     int     `json:"like,omitempty"`
	// region
	Rid  int `json:"rid,omitempty"`
	Reid int `json:"reid,omitempty"`
}

Item is show item, contains av, bangumi, live, banner, feed...

func (*Item) FromActivity

func (i *Item) FromActivity(a *activity.Activity, now time.Time)

FromActivity

func (*Item) FromArc

func (i *Item) FromArc(r *recommend.Arc)

FromArc from recommend arc.

func (*Item) FromArchivePB

func (i *Item) FromArchivePB(a *api.Arc)

FromArchivePB from archive archive.

func (*Item) FromArchivePBBangumi

func (i *Item) FromArchivePBBangumi(a *api.Arc, season *seasongrpc.CardInfoProto, bangumiType int)

FromArchivePBBangumi from archive archive.

func (*Item) FromArchiveRank

func (i *Item) FromArchiveRank(a *api.Arc, scores map[int64]int64)

FromArchiveRank from archive archive.

func (*Item) FromBangumi

func (i *Item) FromBangumi(b *bangumi.Bangumi)

FromBangumi from bangumi.

func (*Item) FromLive

func (i *Item) FromLive(r *live.Room)

FromLive from live.

func (*Item) FromTopic

func (i *Item) FromTopic(a *activity.Activity)

FromTopic

func (*Item) IsRandom

func (i *Item) IsRandom() bool

IsRandom check item whether or not random.

type Show

type Show struct {
	*Head
	Body   []*Item                     `json:"body"`
	Banner map[string][]*banner.Banner `json:"banner,omitempty"`
	Ext    *Ext                        `json:"ext,omitempty"`
}

Show is module.

type Slice

type Slice []*Show

Slice is for sort.

func (Slice) Len

func (ss Slice) Len() int

func (Slice) Less

func (ss Slice) Less(i, j int) bool

func (Slice) Swap

func (ss Slice) Swap(i, j int)

Jump to

Keyboard shortcuts

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