view

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

Documentation

Index

Constants

View Source
const (
	GotoAv       = "av"
	GotoWeb      = "web"
	GotoBangumi  = "bangumi"
	GotoLive     = "live"
	GotoGame     = "game"
	GotoArticle  = "article"
	GotoSpecial  = "special"
	GotoAudio    = "audio"
	GotoSong     = "song"
	GotoAudioTag = "audio_tag"
	GotoAlbum    = "album"
	GotoClip     = "clip"
	GotoDaily    = "daily"
)

Goto

Variables

View Source
var AvHandler = func(a *arcwar.Arc) func(uri string) string {
	return func(uri string) string {
		if a == nil {
			return uri
		}
		if a.Dimension.Height != 0 || a.Dimension.Width != 0 {
			return fmt.Sprintf("%s?player_width=%d&player_height=%d&player_rotate=%d", uri, a.Dimension.Width, a.Dimension.Height, a.Dimension.Rotate)
		}
		return uri
	}
}

AvHandler logic

Functions

func FillURI

func FillURI(gt, param string, f func(uri string) string) (uri string)

FillURI deal app schema.

Types

type Button

type Button struct {
	Title string `json:"title,omitempty"`
	URI   string `json:"uri,omitempty"`
}

Button .

type History

type History struct {
	Cid      int64 `json:"cid"`
	Progress int64 `json:"progress"`
}

History struct

type Meta

type Meta struct {
	Quality int    `json:"quality"`
	Format  string `json:"format"`
	Size    int64  `json:"size"`
}

Meta .

type Page

type Page struct {
	*arcwar.Page
	Metas []*Meta `json:"metas"`
}

Page .

type Relate

type Relate struct {
	Aid        int64         `json:"aid,omitempty"`
	Pic        string        `json:"pic,omitempty"`
	Title      string        `json:"title,omitempty"`
	Author     arcwar.Author `json:"owner,omitempty"`
	Stat       arcwar.Stat   `json:"stat,omitempty"`
	Duration   int64         `json:"duration,omitempty"`
	Goto       string        `json:"goto,omitempty"`
	Param      string        `json:"param,omitempty"`
	URI        string        `json:"uri,omitempty"`
	Rating     float64       `json:"rating,omitempty"`
	Reserve    string        `json:"reserve,omitempty"`
	From       string        `json:"from,omitempty"`
	Desc       string        `json:"desc,omitempty"`
	RcmdReason string        `json:"rcmd_reason,omitempty"`
	Badge      string        `json:"badge,omitempty"`
	Cid        int64         `json:"cid,omitempty"`
	// cm ad
	AdIndex      int             `json:"ad_index,omitempty"`
	CmMark       int             `json:"cm_mark,omitempty"`
	SrcID        int64           `json:"src_id,omitempty"`
	RequestID    string          `json:"request_id,omitempty"`
	CreativeID   int64           `json:"creative_id,omitempty"`
	CreativeType int64           `json:"creative_type,omitempty"`
	Type         int             `json:"type,omitempty"`
	Cover        string          `json:"cover,omitempty"`
	ButtonTitle  string          `json:"button_title,omitempty"`
	View         int             `json:"view,omitempty"`
	Danmaku      int             `json:"danmaku,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"`
	Extra        json.RawMessage `json:"extra,omitempty"`
	Button       *Button         `json:"button,omitempty"`
	CardIndex    int             `json:"card_index,omitempty"`
}

Relate .

func (*Relate) FromAv

func (r *Relate) FromAv(a *arcwar.Arc, from string)

FromAv treatment

type ReqUser

type ReqUser struct {
	Attention int  `json:"attention"`
	Favorite  int8 `json:"favorite"`
	Like      int8 `json:"like"`
	Dislike   int8 `json:"dislike"`
	Coin      int8 `json:"coin"`
}

ReqUser struct

type Static

type Static struct {
	*arcwar.Arc
	Pages []*Page `json:"pages,omitempty"`
}

Static .

type View

type View struct {
	*Static           // relate data
	ReqUser *ReqUser  `json:"req_user,omitempty"` // now user
	History *History  `json:"history,omitempty"`
	Relates []*Relate `json:"relates,omitempty"`
	PID     int32     `json:"category"` // father level partition ID
}

View view+relates

Jump to

Keyboard shortcuts

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