feed

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area2

type Area2 struct {
	ID       int64  `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	Children *Area2 `json:"children,omitempty"`
}

type Button

type Button struct {
	Name        string `json:"name,omitempty"`
	URI         string `json:"uri,omitempty"`
	RedirectURI string `json:"redirect_uri,omitempty"`
}

type Card

type Card struct {
	Title  string   `json:"-"`
	Desc   string   `json:"-"`
	Button []string `json:"-"`
}

type Category

type Category struct {
	ID       int64     `json:"id,omitempty"`
	Name     string    `json:"name,omitempty"`
	Children *Category `json:"children,omitempty"`
}

type Config

type Config struct {
	Column          cdm.ColumnStatus `json:"column"`
	AutoplayCard    int8             `json:"autoplay_card"`
	FeedCleanAbtest int8             `json:"feed_clean_abtest"`
	FollowMode      *FollowMode      `json:"follow_mode,omitempty"`
}

type ConvergeParam

type ConvergeParam struct {
	ID        int64  `form:"id" validate:"required,min=1"`
	MobiApp   string `form:"mobi_app"`
	Device    string `form:"device"`
	Build     int    `form:"build"`
	Qn        int    `form:"qn" default:"0"`
	Fnver     int    `form:"fnver" default:"0"`
	Fnval     int    `form:"fnval" default:"0"`
	ForceHost int    `form:"force_host"`
}

type Dimension

type Dimension struct {
	Width  int64 `json:"width,omitempty"`
	Height int64 `json:"height,omitempty"`
	Rotate int64 `json:"rotate,omitempty"`
}

type FollowMode

type FollowMode struct {
	Title        string    `json:"title,omitempty"`
	Option       []*Option `json:"option,omitempty"`
	Card         *Card     `json:"-"`
	ToastMessage string    `json:"toast_message,omitempty"`
}

type IndexParam

type IndexParam struct {
	Build    int    `form:"build"`
	Platform string `form:"platform"`
	MobiApp  string `form:"mobi_app"`
	Device   string `form:"device"`
	Network  string `form:"network"`
	// idx, err := strconv.ParseInt(idxStr, 10, 64)
	// if err != nil || idx < 0 {
	// 	idx = 0
	// }
	Idx int64 `form:"idx" default:"0"`
	// pull, err := strconv.ParseBool(pullStr)
	// if err != nil {
	// 	pull = true
	// }
	Pull   bool             `form:"pull" default:"true"`
	Column cdm.ColumnStatus `form:"column"`
	// loginEvent, err := strconv.Atoi(loginEventStr)
	// if err != nil {
	// 	loginEvent = 0
	// }
	LoginEvent   int    `form:"login_event" default:"0"`
	OpenEvent    string `form:"open_event"`
	BannerHash   string `form:"banner_hash"`
	AdExtra      string `form:"ad_extra"`
	Qn           int    `form:"qn" default:"0"`
	Interest     string `form:"interest"`
	Flush        int    `form:"flush"`
	AutoPlayCard int    `form:"autoplay_card"`
	Fnver        int    `form:"fnver" default:"0"`
	Fnval        int    `form:"fnval" default:"0"`
	DeviceType   int    `form:"device_type"`
	ParentMode   int    `form:"parent_mode"`
	ForceHost    int    `form:"force_host"`
	RecsysMode   int    `form:"recsys_mode"`
}

type Infoc

type Infoc struct {
	UserFeature   json.RawMessage
	IsRcmd        bool
	NewUser       bool
	Code          int
	AutoPlayInfoc string
}

type Item

type Item struct {
	Title      string      `json:"title,omitempty"`
	Subtitle   string      `json:"subtitle,omitempty"`
	Cover      string      `json:"cover,omitempty"`
	URI        string      `json:"uri,omitempty"`
	Redirect   string      `json:"redirect,omitempty"`
	Param      string      `json:"param,omitempty"`
	Goto       string      `json:"goto,omitempty"`
	Desc       string      `json:"desc,omitempty"`
	Play       int         `json:"play,omitempty"`
	Danmaku    int         `json:"danmaku,omitempty"`
	Reply      int         `json:"reply,omitempty"`
	Fav        int         `json:"favorite,omitempty"`
	Coin       int         `json:"coin,omitempty"`
	Share      int         `json:"share,omitempty"`
	Like       int         `json:"like,omitempty"`
	Dislike    int         `json:"dislike,omitempty"`
	Duration   int64       `json:"duration,omitempty"`
	Count      int         `json:"count,omitempty"`
	Status     int8        `json:"status,omitempty"`
	Type       int8        `json:"type,omitempty"`
	Badge      string      `json:"badge,omitempty"`
	StatType   int8        `json:"stat_type,omitempty"`
	RcmdReason *RcmdReason `json:"rcmd_reason,omitempty"`
	Item       []*Item     `json:"item,omitempty"`
	// sortedset index
	Idx int64 `json:"idx,omitempty"`
	// av
	Cid             int64                     `json:"cid,omitempty"`
	Rid             int32                     `json:"tid,omitempty"`
	TName           string                    `json:"tname,omitempty"`
	Tag             *Tag                      `json:"tag,omitempty"`
	Button          *Button                   `json:"button,omitempty"`
	DisklikeReasons []*dislike.DisklikeReason `json:"dislike_reasons,omitempty"`
	CTime           xtime.Time                `json:"ctime,omitempty"`
	Autoplay        int32                     `json:"autoplay,omitempty"`
	// upper
	Mid      int64         `json:"mid,omitempty"`
	Name     string        `json:"name,omitempty"`
	Face     string        `json:"face,omitempty"`
	IsAtten  int8          `json:"is_atten,omitempty"`
	Fans     int64         `json:"fans,omitempty"`
	RecCnt   int           `json:"recent_count,omitempty"`
	Recent   []*Item       `json:"recent,omitempty"`
	Official *OfficialInfo `json:"official,omitempty"`
	// live
	Online int    `json:"online,omitempty"`
	Area   string `json:"area,omitempty"`
	AreaID int    `json:"area_id,omitempty"`
	Area2  *Area2 `json:"area2,omitempty"`
	// bangumi
	Index       string `json:"index,omitempty"`
	IndexTitle  string `json:"index_title,omitempty"`
	CoverMark   string `json:"cover_mark,omitempty"`
	Finish      bool   `json:"finish,omitempty"`
	LatestIndex string `json:"last_index,omitempty"`
	// bangumi ai
	Updates int `json:"updates,omitempty"`
	// live or bangumi
	From int8 `json:"from,omitempty"`
	// adviertisement
	RequestID  string          `json:"request_id,omitempty"`
	CreativeID int64           `json:"creative_id,omitempty"`
	SrcID      int             `json:"src_id,omitempty"`
	IsAd       bool            `json:"is_ad,omitempty"`
	IsAdLoc    bool            `json:"is_ad_loc,omitempty"`
	AdCb       string          `json:"ad_cb,omitempty"`
	ShowURL    string          `json:"show_url,omitempty"`
	ClickURL   string          `json:"click_url,omitempty"`
	ClientIP   string          `json:"client_ip,omitempty"`
	CmMark     int64           `json:"cm_mark,omitempty"`
	AdIndex    int             `json:"ad_index,omitempty"`
	Extra      json.RawMessage `json:"extra,omitempty"`
	CardIndex  int             `json:"card_index,omitempty"`
	// tag
	Tags []*tag.Tag `json:"tags,omitempty"`
	// rank
	Cover1 string `json:"cover1,omitempty"`
	Cover2 string `json:"cover2,omitempty"`
	Cover3 string `json:"cover3,omitempty"`
	// banner
	BannerItem []*banner.Banner `json:"banner_item,omitempty"`
	Hash       string           `json:"hash,omitempty"`
	// article
	Covers    []string  `json:"covers,omitempty"`
	Template  int       `json:"template,omitempty"`
	Temple    int       `json:"temple,omitempty"`
	Category  *Category `json:"category,omitempty"`
	BannerURL string    `json:"banner_url,omitempty"`
	// game download
	Download int32  `json:"download,omitempty"`
	BigCover string `json:"big_cover,omitempty"`
	// special
	HideBadge bool    `json:"hide_badge,omitempty"`
	Ratio     float64 `json:"ratio,omitempty"`
	// shopping
	City   string `json:"city,omitempty"`
	PType  string `json:"ptype,omitempty"`
	Price  string `json:"price,omitempty"`
	Square string `json:"square,omitempty"`
	STime  string `json:"stime,omitempty"`
	ETime  string `json:"etime,omitempty"`
	// news
	Content string `json:"content,omitempty"`
	// subscribe
	Kind string `json:"kind,omitempty"`
	// audio
	SongTitle string `json:"song_title,omitempty"`
	// bigdata source
	Source    string          `json:"-"`
	AvFeature json.RawMessage `json:"-"`
	// common
	GotoOrg string `json:"-"`
	// rank score
	Score string `json:"score,omitempty"`
	// ai recommend
	AI *ai.Item `json:"-"`
	// abtest
	AutoplayCard int `json:"autoplay_card,omitempty"`
}

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

func (*Item) FromAdAv

func (i *Item) FromAdAv(adInfo *cm.AdInfo, a *archive.ArchiveWithPlayer)

func (*Item) FromAdLarge

func (i *Item) FromAdLarge(adInfo *cm.AdInfo)

func (*Item) FromAdWeb

func (i *Item) FromAdWeb(adInfo *cm.AdInfo)

func (*Item) FromAdWebS

func (i *Item) FromAdWebS(adInfo *cm.AdInfo)

func (*Item) FromArticleS

func (i *Item) FromArticleS(m *article.Meta)

func (*Item) FromAudio

func (i *Item) FromAudio(a *audio.Audio)

func (*Item) FromAv

func (i *Item) FromAv(a *archive.ArchiveWithPlayer)

func (*Item) FromBangumiRcmd

func (i *Item) FromBangumiRcmd(u *bangumi.Update)

func (*Item) FromBanner

func (i *Item) FromBanner(bs []*banner.Banner, hash string)

func (*Item) FromChannelRcmd

func (i *Item) FromChannelRcmd(r *operate.Follow, am map[int64]*archive.ArchiveWithPlayer, tagm map[int64]*bustag.Tag)

func (*Item) FromConverge

func (i *Item) FromConverge(c *operate.Converge, am map[int64]*archive.ArchiveWithPlayer, rm map[int64]*live.Room, artm map[int64]*article.Meta)

func (*Item) FromDislikeReason

func (i *Item) FromDislikeReason(plat int8, build int)

func (*Item) FromGameDownloadS

func (i *Item) FromGameDownloadS(d *operate.Download, plat int8, build int)

func (*Item) FromLive

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

func (*Item) FromLiveUpRcmd

func (i *Item) FromLiveUpRcmd(id int64, cs []*live.Card, card map[int64]*account.Card)

func (*Item) FromLogin

func (i *Item) FromLogin()

func (*Item) FromNews

func (i *Item) FromNews(r *operate.Active)

func (*Item) FromPGCSeason

func (i *Item) FromPGCSeason(s *episodegrpc.EpisodeCardsProto)

func (*Item) FromPlayer

func (i *Item) FromPlayer(a *archive.ArchiveWithPlayer)

func (*Item) FromPlayerAv

func (i *Item) FromPlayerAv(a *archive.ArchiveWithPlayer)

func (*Item) FromPlayerLive

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

func (*Item) FromRank

func (i *Item) FromRank(ranks []*rank.Rank, am map[int64]*archive.ArchiveWithPlayer)

func (*Item) FromRcmd

func (i *Item) FromRcmd(r *ai.Item)

func (*Item) FromRcmdReason

func (i *Item) FromRcmdReason(r *ai.RcmdReason)

func (*Item) FromSeason

func (i *Item) FromSeason(b *bangumi.Season)

func (*Item) FromShoppingS

func (i *Item) FromShoppingS(c *show.Shopping)

func (*Item) FromSpecial

func (i *Item) FromSpecial(id int64, title, cover, desc, url string, typ int, badge string, size string)

func (*Item) FromSpecialS

func (i *Item) FromSpecialS(id int64, title, cover, square, desc, url string, typ int, badge string)

func (*Item) FromSubscribe

func (i *Item) FromSubscribe(r *operate.Follow, card map[int64]*account.Card, follow map[int64]bool, statm map[int64]*relation.Stat, tagm map[int64]*bustag.Tag)

最多配10张卡片 取3个未关注的 不足则不显示该卡片

func (*Item) FromTabBanner

func (i *Item) FromTabBanner(r *operate.Active)

func (*Item) FromTabCards

func (i *Item) FromTabCards(r *operate.Active, am map[int64]*archive.ArchiveWithPlayer, downm map[int64]*operate.Download, sm map[int64]*bangumi.Season, rm map[int64]*live.Room, metam map[int64]*article.Meta, spm map[int64]*operate.Special)

func (*Item) FromTabTags

func (i *Item) FromTabTags(r *operate.Active, am map[int64]*archive.ArchiveWithPlayer, tagm map[int64]*tag.Tag)

func (*Item) FromUpArticle

func (i *Item) FromUpArticle(m *article.Meta)

func (*Item) FromUpBangumi

func (i *Item) FromUpBangumi(p *feed.Bangumi)

func (*Item) FromUpLive

func (i *Item) FromUpLive(f *livemdl.Feed)

func (*Item) FromWeb

func (i *Item) FromWeb(title, cover, uri string)

type OfficialInfo

type OfficialInfo struct {
	Role  int8   `json:"role,omitempty"`
	Title string `json:"title,omitempty"`
	Desc  string `json:"desc,omitempty"`
}

type Option

type Option struct {
	Title string `json:"title,omitempty"`
	Desc  string `json:"desc,omitempty"`
	Value int8   `json:"value"`
}

type RcmdReason

type RcmdReason struct {
	ID           int    `json:"id,omitempty"`
	Content      string `json:"content,omitempty"`
	BgColor      string `json:"bg_color,omitempty"`
	IconLocation string `json:"icon_location,omitempty"`
	Message      string `json:"message,omitempty"`
}

type Tag

type Tag struct {
	// new
	ID      int64  `json:"id,omitempty"`
	Name    string `json:"name,omitempty"`
	Face    string `json:"face,omitempty"`
	Fans    int    `json:"fans,omitempty"`
	IsAtten int8   `json:"is_atten,omitempty"`
	URI     string `json:"uri,omitempty"`

	// old
	TagID   int64     `json:"tag_id,omitempty"`
	TagName string    `json:"tag_name,omitempty"`
	Count   *TagCount `json:"count,omitempty"`
}

type TagCount

type TagCount struct {
	Atten int `json:"atten,omitempty"`
}

Jump to

Keyboard shortcuts

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