model

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

Documentation

Index

Constants

View Source
const (
	// ads plat
	VdoAdsPC      = int8(0)
	VdoAdsIPhone  = int8(1)
	VdoAdsAndroid = int8(2)
	VdoAdsIPad    = int8(3)
	// ads type
	VdoAdsTypeBangumi = int8(0)
	VdoAdsTypeNologin = int8(1)
	VdoAdsTypeNothing = int8(2)
	VdoAdsTypeOther   = int8(3)
	// ads target
	VdoAdsTargetArchive = int8(1)
	VdoAdsTargetBangumi = int8(2)
	VdoAdsTargetType    = int8(3)
)

ads const

View Source
const (
	// StateOpen 开放浏览
	StateOpen = int8(0)
	// StateOrange 橙色通过
	StateOrange = int8(1)
	// StateForbidWait 待审
	StateForbidWait = int8(-1)
	// StateForbidRecycle 被打回
	StateForbidRecycle = int8(-2)
	// StateForbidPolice 网警锁定
	StateForbidPolice = int8(-3)
	// StateForbidLock 被锁定
	StateForbidLock = int8(-4)
	// StateForbidFackLock 管理员锁定(可浏览)
	StateForbidFackLock = int8(-5)
	// StateForbidFixed 修复待审
	StateForbidFixed = int8(-6)
	// StateForbidLater 暂缓审核
	StateForbidLater = int8(-7)
	// StateForbidPatched 补档待审
	StateForbidPatched = int8(-8)
	// StateForbidWaitXcode 等待转码
	StateForbidWaitXcode = int8(-9)
	// StateForbidAdminDelay 延迟审核
	StateForbidAdminDelay = int8(-10)
	// StateForbidFixing 视频源待修
	StateForbidFixing = int8(-11)
	// StateForbidStorageFail 转储失败
	StateForbidStorageFail = int8(-12)
	// StateForbidOnlyComment 允许评论待审
	StateForbidOnlyComment = int8(-13)
	// StateForbidTmpRecicle 临时回收站
	StateForbidTmpRecicle = int8(-14)
	// StateForbidDispatch 分发中
	StateForbidDispatch = int8(-15)
	// StateForbidXcodeFail 转码失败
	StateForbidXcodeFail = int8(-16)
	// StateForbitUpLoad 创建未提交
	StateForbitUpLoad = int8(-20) // NOTE:spell body can judge to change state
	// StateForbidSubmit 创建已提交
	StateForbidSubmit = int8(-30)
	// StateForbidUserDelay 定时发布
	StateForbidUserDelay = int8(-40)
	// StateForbidUpDelete 用户删除
	StateForbidUpDelete = int8(-100)

	// resource apply
	ApplyFirstAudit   = 0  // 待一审
	ApplySecondAudit  = 1  // 待二审
	ApplyNoAssignment = 2  // 未投放
	ApplyAssignment   = 3  // 已投放
	ApplyReject       = -1 // 已驳回
	ApplyRecall       = -2 // 已撤回
)

resource archive const

View Source
const (
	// PlatAndroid is int8 for android.
	PlatAndroid = int8(0)
	// PlatIPhone is int8 for iphone.
	PlatIPhone = int8(1)
	// PlatIPad is int8 for ipad.
	PlatIPad = int8(2)
	// PlatWPhone is int8 for wphone.
	PlatWPhone = int8(3)
	// PlatAndroidG is int8 for Android Googleplay.
	PlatAndroidG = int8(4)
	// PlatIPhoneI is int8 for Iphone Global.
	PlatIPhoneI = int8(5)
	// PlatIPadI is int8 for IPAD Global.
	PlatIPadI = int8(6)
	// PlatAndroidTV is int8 for AndroidTV Global.
	PlatAndroidTV = int8(7)
	// PlatAndroidI is int8 for Android Global.
	PlatAndroidI = int8(8)
	// PlatAndroidB is int8 for Android Bule.
	PlatAndroidB = int8(9)
	// PlatWEB is int8 for web.
	PlatWEB = int8(99)

	// goto
	GotoAv          = "av"
	GotoWeb         = "web"
	GotoBangumi     = "bangumi"
	GotoBangumiWeb  = "bangumi_web"
	GotoSp          = "sp"
	GotoLive        = "live"
	GotoGame        = "game"
	GotoArticle     = "article"
	GotoActivity    = "activity_new"
	GotoTopic       = "topic_new"
	GotoDaily       = "daily"
	GotoRank        = "rank"
	GotoCard        = "card"
	GotoVeidoCard   = "video_card"
	GotoSpecialCard = "special_card"
	GotoTagCard     = "tag_card"
	GotoColumn      = "column"
	GotoColumnStage = "column_stage"
	GotoTagID       = "tag_id"

	CardGotoAv       = int8(1)
	CardGotoTopic    = int8(2)
	CardGotoActivity = int8(3)
)

resource const

View Source
const (
	RouteFirstRoundForbid = "first_round_forbid"
	RouteSecondRound      = "second_round"
	RouteAutoOpen         = "auto_open"
	RouteDelayOpen        = "delay_open"
	RouteDeleteArchive    = "delete_archive"
	RouteForceSync        = "force_sync"
)

databus const

View Source
const (
	IconTypeFix     = 1
	IconTypeRandom  = 2
	IconTypeBangumi = 3

	NoCategory = 0
	IsCategory = 1

	AsgTypePic   = int8(0)
	AsgTypeVideo = int8(1)
	// pgc mobile
	AsgTypeURL     = int8(2)
	AsgTypeBangumi = int8(3)
	AsgTypeLive    = int8(4)
	AsgTypeGame    = int8(5)
	AsgTypeAv      = int8(6)
)

resource const

Variables

View Source
var IconTypes = map[int]string{
	IconTypeFix:     "fix",
	IconTypeRandom:  "random",
	IconTypeBangumi: "bangumi",
}

IconTypes icon_type

Functions

func FillURI

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

FillURI deal app schema.

func InvalidBuild

func InvalidBuild(srcBuild, cfgBuild int, cfgCond string) bool

InvalidBuild check source build is not allow by config build and condition. eg: when condition is gt, means srcBuild must gt cfgBuild, otherwise is invalid srcBuild.

func InvalidChannel

func InvalidChannel(plat int8, srcCh, cfgCh string) bool

InvalidChannel check source channel is not allow by config channel.

func PasterPlat

func PasterPlat(plat int8) int8

PasterPlat exchange plat to video_ads

func Plat

func Plat(mobiApp, device string) int8

Plat return plat by platStr or mobiApp

Types

type ADIndex

type ADIndex struct {
	Index  int     `json:"index"`
	Info   *ADInfo `json:"ad_info"`
	IsAd   bool    `json:"is_ad"`
	CmMark int     `json:"cm_mark"`
}

ADIndex cpm type

type ADInfo

type ADInfo struct {
	CreativeID      int `json:"creative_id"`
	CreativeType    int `json:"creative_type"`
	CreativeContent struct {
		Title    string `json:"title"`
		Desc     string `json:"description"`
		VideoID  int64  `json:"video_id"`
		UserName string `json:"username"`
		ImageURL string `json:"image_url"`
		ImageMD5 string `json:"image_md5"`
		LogURL   string `json:"log_url"`
		LogMD5   string `json:"log_md5"`
		URL      string `json:"url"`
		ClickURL string `json:"click_url"`
		ShowURL  string `json:"show_url"`
	} `json:"creative_content"`
	AdCb  string          `json:"ad_cb"`
	Extra json.RawMessage `json:"extra"`
}

ADInfo cpm type

type ADRequest

type ADRequest struct {
	RequestID string                         `json:"request_id"`
	ADIndexs  map[string]map[string]*ADIndex `json:"ads_info"`
}

ADRequest cpm type

func (*ADRequest) ConvertBanner

func (adr *ADRequest) ConvertBanner(ip, mobiApp string, build int) (banners map[int]map[int]*Banner)

ConvertBanner expair cpm type

type AbTest

type AbTest struct {
	ID          int64  `json:"groupId"`
	Name        string `json:"groupName"`
	Threshold   int64  `json:"flowPercent"`
	ParamValues string `json:"-"`
	UTime       int64  `json:"-"`
}

AbTest struct

func (*AbTest) AbTestIn

func (ab *AbTest) AbTestIn(buvid string) (ok bool)

AbTestIn check build in test

type Archive

type Archive struct {
	ID        int64  `json:"id"`
	Mid       int64  `json:"mid"`
	TypeID    int16  `json:"typeid"`
	HumanRank int    `json:"humanrank"`
	Duration  int    `json:"duration"`
	Title     string `json:"title"`
	Cover     string `json:"cover"`
	Content   string `json:"content"`
	Tag       string `json:"tag"`
	Attribute int32  `json:"attribute"`
	Copyright int8   `json:"copyright"`
	AreaLimit int8   `json:"arealimit"`
	State     int8   `json:"state"`
	Author    string `json:"author"`
	Access    int    `json:"access"`
	Forward   int    `json:"forward"`
	PubTime   string `json:"pubtime"`
	Reason    string `json:"reject_reason"`
	Round     int8   `json:"round"`
	CTime     string `json:"ctime"`
	MTime     string `json:"mtime"`
}

Archive archive struct

type ArgAbTest

type ArgAbTest struct {
	Groups string
	IP     string
}

ArgAbTest for abTest

type ArgBanner

type ArgBanner struct {
	Plat      int8
	Build     int
	AID       int64
	MID       int64
	ResIDs    string
	Channel   string
	IP        string
	Buvid     string
	Network   string
	MobiApp   string
	Device    string
	IsAd      bool
	OpenEvent string
	AdExtra   string
	Version   string
}

ArgBanner for banner func

type ArgCmtbox

type ArgCmtbox struct {
	ID int64
}

ArgCmtbox for ctmbox

type ArgPaster

type ArgPaster struct {
	Platform int8
	AdType   int8
	Aid      string
	TypeId   string
	TypeID   string
	Buvid    string
}

ArgPaster for paster func

type ArgRes

type ArgRes struct {
	ResID int
}

ArgRes for resource func

type ArgRess

type ArgRess struct {
	ResIDs []int
}

ArgRess for resources func

type Assignment

type Assignment struct {
	ID             int        `json:"id"`
	AsgID          int        `json:"-"`
	Name           string     `json:"name"`
	ContractID     string     `json:"contract_id"`
	ResID          int        `json:"resource_id"`
	Pic            string     `json:"pic"`
	LitPic         string     `json:"litpic"`
	URL            string     `json:"url"`
	Rule           string     `json:"rule"`
	Weight         int        `json:"weight"`
	Agency         string     `json:"agency"`
	Price          float32    `json:"price"`
	State          int        `json:"state"`
	Atype          int8       `json:"atype"`
	Username       string     `json:"username"`
	PlayerCategory int8       `json:"player_category"`
	ApplyGroupID   int        `json:"-"`
	STime          xtime.Time `json:"stime"`
	ETime          xtime.Time `json:"etime"`
	CTime          xtime.Time `json:"ctime"`
	MTime          xtime.Time `json:"mtime"`
}

Assignment struct

type Banner struct {
	ID           int             `json:"id"`
	ParentID     int             `json:"-"`
	Plat         int8            `json:"-"`
	Module       string          `json:"-"`
	Position     string          `json:"-"`
	Title        string          `json:"title"`
	Image        string          `json:"image"`
	Hash         string          `json:"hash"`
	URI          string          `json:"uri"`
	Goto         string          `json:"-"`
	Value        string          `json:"-"`
	Param        string          `json:"-"`
	Channel      string          `json:"-"`
	Build        int             `json:"-"`
	Condition    string          `json:"-"`
	Area         string          `json:"-"`
	Rank         int             `json:"-"`
	Rule         string          `json:"-"`
	Type         int8            `json:"-"`
	Start        xtime.Time      `json:"stime"`
	End          xtime.Time      `json:"-"`
	MTime        xtime.Time      `json:"-"`
	ResourceID   int             `json:"resource_id"`
	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"`
	Index        int             `json:"index"`
	ServerType   int             `json:"server_type"`
	Extra        json.RawMessage `json:"extra"`
	CreativeType int             `json:"creative_type"`
}

Banner struct

func (*Banner) BannerChange

func (b *Banner) BannerChange()

BannerChange change banner

type Banners

type Banners struct {
	Banner  map[int][]*Banner
	Version string
}

Banners struct

type Card

type Card struct {
	ID        int    `json:"-"`
	Tab       int    `json:"-"`
	RegionID  int    `json:"-"`
	Type      int    `json:"-"`
	Title     string `json:"-"`
	Cover     string `json:"-"`
	Rtype     int    `json:"-"`
	Rvalue    string `json:"-"`
	PlatVer   string `json:"-"`
	Plat      int8   `json:"-"`
	Build     int    `json:"-"`
	Condition string `json:"-"`
	TypeStr   string `json:"-"`
	Goto      string `json:"-"`
	Param     string `json:"-"`
	URI       string `json:"-"`
	Desc      string `json:"-"`
	TagID     int    `json:"-"`
}

Card audio card struct

func (*Card) CardPlatChange

func (c *Card) CardPlatChange() (platlinits []*PlatLimit)

CardPlatChange audio card change plat

type Cmtbox

type Cmtbox struct {
	ID          int64      `json:"id"`
	LoadCID     int64      `json:"load_cid"`
	Server      string     `json:"server"`
	Port        string     `json:"port"`
	SizeFactor  string     `json:"size_factor"`
	SpeedFactor string     `json:"speed_factor"`
	MaxOnscreen string     `json:"max_onscreen"`
	Style       string     `json:"style"`
	StyleParam  string     `json:"style_param"`
	TopMargin   string     `json:"top_margin"`
	State       string     `json:"state"`
	CTime       xtime.Time `json:"ctime"`
	MTime       xtime.Time `json:"mtime"`
}

Cmtbox live danmaku box

type Content

type Content struct {
	ID     int    `json:"-"`
	Module int    `json:"-"`
	RecID  int    `json:"-"`
	Type   int8   `json:"-"`
	Value  string `json:"-"`
	Title  string `json:"-"`
	TagID  int    `json:"-"`
}

Content audio content struct

type Head struct {
	CardID    int         `json:"card_id,omitempty"`
	Title     string      `json:"title,omitempty"`
	Cover     string      `json:"cover,omitempty"`
	Type      string      `json:"type,omitempty"`
	Date      int64       `json:"date,omitempty"`
	Plat      int8        `json:"-"`
	Build     int         `json:"-"`
	Condition string      `json:"-"`
	URI       string      `json:"uri,omitempty"`
	Goto      string      `json:"goto,omitempty"`
	Param     string      `json:"param,omitempty"`
	Body      []*ShowItem `json:"body,omitempty"`
}

Head audio struct

func (*Head) FillBuildURI

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

FillBuildURI fill url by plat build

type IndexIcon

type IndexIcon struct {
	ID       int64      `json:"id"`
	Type     int        `json:"type"`
	Title    string     `json:"title"`
	State    int        `json:"state"`
	Links    []string   `json:"links"`
	Icon     string     `json:"icon"`
	Weight   int        `json:"weight"`
	UserName string     `json:"-"`
	StTime   xtime.Time `json:"sttime"`
	EndTime  xtime.Time `json:"endtime"`
	DelTime  xtime.Time `json:"deltime"`
	CTime    xtime.Time `json:"ctime"`
	MTime    xtime.Time `json:"mtime"`
}

IndexIcon struct

type JSONBanner

type JSONBanner struct {
	Area         string `json:"area"`
	Hash         string `json:"hash"`
	Build        int    `json:"build"`
	Condition    string `json:"cond"`
	Channel      string `json:"channel"`
	CreativeType int    `json:"creative_type"`
}

JSONBanner bilibili_assignment rule

type JSONLimit

type JSONLimit struct {
	Limit int      `json:"limit"`
	Resrc []string `json:"resrc"`
}

JSONLimit limit

type Limit

type Limit struct {
	Rule string `json:"-"`
}

Limit limit

func (*Limit) LimitChange

func (l *Limit) LimitChange() (data map[int]int)

LimitChange change limit

type Message

type Message struct {
	Action string          `json:"action"`
	Table  string          `json:"table"`
	New    json.RawMessage `json:"new"`
	Old    json.RawMessage `json:"old"`
}

Message databus

type OfficialVerify

type OfficialVerify struct {
	Type int    `json:"type"`
	Desc string `json:"desc"`
}

OfficialVerify audio verify struct

type Paster

type Paster struct {
	AID       int64  `json:"aid"`
	CID       int64  `json:"cid"`
	Duration  int64  `json:"duration"`
	Type      int8   `json:"type"`
	AllowJump int8   `json:"allow_jump"`
	URL       string `json:"url"`
}

Paster struct

type PlatLimit

type PlatLimit struct {
	Plat      int8   `json:"plat"`
	Build     int    `json:"build"`
	Condition string `json:"conditions"`
}

PlatLimit audio plat limit struct

type PlayerIcon

type PlayerIcon struct {
	URL1  string     `json:"url1"`
	Hash1 string     `json:"hash1"`
	URL2  string     `json:"url2"`
	Hash2 string     `json:"hash2"`
	CTime xtime.Time `json:"ctime"`
}

PlayerIcon struct

type Relate

type Relate struct {
	ID          int64               `json:"id,omitempty"`
	Param       int64               `json:"param,omitempty"`
	Goto        string              `json:"goto,omitempty"`
	Title       string              `json:"title,omitempty"`
	ResourceIDs string              `json:"resource_ids,omitempty"`
	TagIDs      string              `json:"tag_ids,omitempty"`
	ArchiveIDs  string              `json:"archive_ids,omitempty"`
	RecReason   string              `json:"rec_reason,omitempty"`
	Position    int32               `json:"position,omitempty"`
	STime       xtime.Time          `json:"stime,omitempty"`
	ETime       xtime.Time          `json:"etime,omitempty"`
	Versions    map[int8][]*Version `json:"versions,omitempty"`
	PgcIDs      string
}

Relate relate card

type ResWarnInfo

type ResWarnInfo struct {
	AID            int64
	URL            string
	AssignmentID   int
	AssignmentName string
	ResourceName   string
	ResourceID     int
	MaterialID     int
	UserName       string
	STime          xtime.Time `json:"stime"`
	ETime          xtime.Time `json:"etime"`
	ApplyGroupID   int
}

ResWarnInfo for email

type Resource

type Resource struct {
	ID          int           `json:"id"`
	Platform    int           `json:"platform"`
	Name        string        `json:"name"`
	Parent      int           `json:"parent"`
	State       int           `json:"-"`
	Counter     int           `json:"counter"`
	Position    int           `json:"position"`
	Rule        string        `json:"rule"`
	Size        string        `json:"size"`
	Previce     string        `json:"preview"`
	Desc        string        `json:"description"`
	Mark        string        `json:"mark"`
	Assignments []*Assignment `json:"assignments"`
	CTime       xtime.Time    `json:"ctime"`
	MTime       xtime.Time    `json:"mtime"`
	Level       int64         `json:"level"`
	Type        int           `json:"type"`
	IsAd        int           `json:"is_ad"`
}

Resource struct

type Rule

type Rule struct {
	Cover int32  `json:"is_cover"`
	Style int32  `json:"style"`
	Label string `json:"label"`
	Intro string `json:"intro"`
}

Rule resource_assignmen rule

type ShowItem

type ShowItem struct {
	Title  string `json:"title"`
	Cover  string `json:"cover"`
	URI    string `json:"uri"`
	NewURI string `json:"-"`
	Param  string `json:"param"`
	Goto   string `json:"goto"`
	// up
	Mid            int64           `json:"mid,omitempty"`
	Name           string          `json:"name,omitempty"`
	Face           string          `json:"face,omitempty"`
	Follower       int             `json:"follower,omitempty"`
	Attribute      int             `json:"attribute,omitempty"`
	OfficialVerify *OfficialVerify `json:"official_verify,omitempty"`
	// stat
	Play    int `json:"play,omitempty"`
	Danmaku int `json:"danmaku,omitempty"`
	Reply   int `json:"reply,omitempty"`
	Fav     int `json:"favourite,omitempty"`
	// movie and bangumi badge
	Status    int8   `json:"status,omitempty"`
	CoverMark string `json:"cover_mark,omitempty"`
	// ranking
	Pts      int64       `json:"pts,omitempty"`
	Children []*ShowItem `json:"children,omitempty"`
	// av
	PubDate xtime.Time `json:"pubdate"`
	// av stat
	Duration int64 `json:"duration,omitempty"`
	// region
	Rid   int    `json:"rid,omitempty"`
	Rname string `json:"rname,omitempty"`
	Reid  int    `json:"reid,omitempty"`
	//new manager
	Desc  string `json:"desc,omitempty"`
	Stime string `json:"stime,omitempty"`
	Etime string `json:"etime,omitempty"`
	Like  int    `json:"like,omitempty"`
}

ShowItem audio show item struct

func (*ShowItem) FromArchivePB

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

FromArchivePB from archive archive.

type SideBar struct {
	ID           int64      `json:"id,omitempty"`
	Tip          int        `json:"tip,omitempty"`
	Rank         int        `json:"rank,omitempty"`
	LogoWhite    string     `json:"logo_white,omitempty"`
	Name         string     `json:"name,omitempty"`
	Param        string     `json:"param,omitempty"`
	Module       int        `json:"module,omitempty"`
	Plat         int8       `json:"-"`
	Build        int        `json:"-"`
	Conditions   string     `json:"-"`
	OnlineTime   xtime.Time `json:"online_time"`
	NeedLogin    int8       `json:"need_login,omitempty"`
	WhiteURL     string     `json:"white_url,omitempty"`
	Menu         int8       `json:"menu,omitempty"`
	LogoSelected string     `json:"logo_selected,omitempty"`
	TabID        string     `json:"tab_id,omitempty"`
	Red          string     `json:"red_dot_url,omitempty"`
	Language     string     `json:"language,omitempty"`
}

SideBar for side bar

type SideBarLimit

type SideBarLimit struct {
	ID        int64  `json:"-"`
	Build     int    `json:"-"`
	Condition string `json:"-"`
}

SideBarLimit side bar limit

type SideBars struct {
	SideBar []*SideBar                `json:"sidebar,omitempty"`
	Limit   map[int64][]*SideBarLimit `json:"limit,omitempty"`
}

SideBars for side bars

type Version

type Version struct {
	Plat      int8   `json:"plat,omitempty"`
	Build     int    `json:"build,omitempty"`
	Condition string `json:"conditions,omitempty"`
}

Version app version

type VideoAD

type VideoAD struct {
	Name          string     `json:"name"`
	ContractID    string     `json:"contract_id"`
	Aid           int64      `json:"aid"`
	SeasonID      int        `json:"season_id"`
	TypeID        int16      `json:"type _id"`
	AdCid         int64      `json:"ad_cid"`
	AdStrategy    int        `json:"ad_strategy"`
	AdURL         string     `json:"ad_url"`
	AdOrder       int        `json:"ad_order"`
	Skipable      int8       `json:"skipable"`
	Note          string     `json:"note"`
	AgencyName    string     `json:"agency_name"`
	AgencyCountry int        `json:"agency_country"`
	AgencyArea    int        `json:"agency_area"`
	Price         float32    `json:"price"`
	Verified      int        `json:"verified"`
	State         int        `json:"state"`
	FrontAid      int64      `json:"front_aid"`
	Target        int8       `json:"target"`
	Platform      int8       `json:"platform"`
	Type          int8       `json:"type"`
	UserSet       int8       `json:"user_set"`
	PlayCount     int64      `json:"play_count"`
	MTime         xtime.Time `json:"mtime"`
	Aids          string     `json:"-"`
}

VideoAD is Ads of videos.

type Videoup

type Videoup struct {
	Route     string `json:"route"`
	Timestamp int64  `json:"timestamp"`
	Aid       int64  `json:"aid"`
}

Videoup message for videoup2BVC

Jump to

Keyboard shortcuts

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