ugc

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArcAllow

type ArcAllow struct {
	Aid       int64
	State     int32
	Ugcpay    int32
	Typeid    int32
	Copyright int32
}

ArcAllow is the struct used to check whether the arc is allowed to enter TV database

func (*ArcAllow) CanPlay

func (a *ArcAllow) CanPlay() bool

CanPlay distinguishes whether an archive can play or not

func (*ArcAllow) FromArcFull

func (a *ArcAllow) FromArcFull(full *ArcFull)

FromArcFull takes info from arcFull structure ( db )

func (*ArcAllow) FromArcReply

func (a *ArcAllow) FromArcReply(reply *v1.Arc)

FromArcReply takes info from grpc result

func (*ArcAllow) FromArchive

func (a *ArcAllow) FromArchive(arc *Archive)

FromArchive takes info from DB

func (*ArcAllow) FromArcmdl

func (a *ArcAllow) FromArcmdl(mdl *v1.Arc)

FromArcmdl takes info from gorpc result

func (*ArcAllow) FromDatabus

func (a *ArcAllow) FromDatabus(db *ArchDatabus)

FromDatabus takes info from databus result ( archive-notify T )

func (*ArcAllow) IsOrigin

func (a *ArcAllow) IsOrigin() bool

IsOrigin distinguishes whether an archive is original or not

type ArcCMS

type ArcCMS struct {
	// Media Info
	Title   string
	AID     int64
	Content string
	Cover   string
	TypeID  int32
	Pubtime time.Time
	Videos  int
	// Auth Info
	Valid   int
	Deleted int
	Result  int
}

ArcCMS represents the archive data structure in MC

type ArcFull

type ArcFull struct {
	ArcCMS
	Copyright int32
	State     int32
	MID       int64
	Duration  int64
}

ArcFull is the plus version of ArcCMS

func (*ArcFull) ToSimple

func (arc *ArcFull) ToSimple() *SimpleArc

ToSimple transforms an arcFull to SimpleArc

type ArcMedia

type ArcMedia struct {
	Title   string
	AID     int64
	Cover   string
	TypeID  int32
	Pubtime time.Time
	Videos  int64
	Deleted int
}

ArcMedia is the archive media struct in MC

type ArcMsg

type ArcMsg struct {
	Action string       `json:"action"`
	Table  string       `json:"table"`
	Old    *ArchDatabus `json:"old"`
	New    *ArchDatabus `json:"new"`
}

ArcMsg reprensents the archive Notify-T message structure

type ArchDatabus

type ArchDatabus struct {
	Aid       int64  `json:"aid"`
	Mid       int64  `json:"mid"`
	TypeID    int32  `json:"typeid"`
	Videos    int64  `json:"videos"`
	Duration  int    `json:"duration"`
	Title     string `json:"title"`
	Cover     string `json:"cover"`
	Content   string `json:"content"`
	Attribute int32  `json:"attribute"`
	Copyright int32  `json:"copyright"`
	State     int32  `json:"state"`
	Access    int    `json:"access"`
	PubTime   string `json:"pubtime"`
}

ArchDatabus model ( we pick the fields that we need )

type Archive

type Archive struct {
	ID        int
	AID       int64
	MID       int64
	TypeID    int32
	Videos    int64
	Title     string
	Cover     string
	Content   string
	Duration  int64
	Copyright int32
	Pubtime   time.Time
	Ctime     time.Time
	Mtime     time.Time
	State     int32
	Manual    int
	Valid     int
	Submit    int
	Retry     int
	Result    int
	Deleted   int
}

Archive archive def. corresponding to our table structure

func (*Archive) FromArcReply

func (a *Archive) FromArcReply(arc *v1.Arc)

FromArcReply def

func (*Archive) ToSimple

func (a *Archive) ToSimple() *SimpleArc

ToSimple def.

type CidReq

type CidReq struct {
	CID int64 `json:"cid"`
}

CidReq reprensents the structure for reporting cid

type CidResp

type CidResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

CidResp represents the structure of cid reporting API's response

type DatabusArc

type DatabusArc struct {
	Old *MarkArc `json:"old"`
	New *MarkArc `json:"new"`
}

DatabusArc is the struct of message for the modification of ugc_archive

type DatabusVideo

type DatabusVideo struct {
	New *MarkVideo `json:"new"`
	Old *MarkVideo `json:"old"`
}

DatabusVideo is the struct of message for the modification of ugc_Video

type DelVideos

type DelVideos struct {
	AID  int64
	CIDs []int64
}

DelVideos is used to delete videos of an archive

type EasyUp

type EasyUp struct {
	MID  int64
	Name string
	Face string
}

EasyUp is the simple version of upper

func (*EasyUp) ToUpper

func (u *EasyUp) ToUpper(ori *Upper) *Upper

ToUpper transform an EasyUp to Upper

type LicSke

type LicSke struct {
	Arc    *SimpleArc
	Videos []*SimpleVideo
}

LicSke represents the skeleton of a license audit message

type MarkArc

type MarkArc struct {
	ID         int    `json:"id"`
	AID        int64  `json:"aid"`
	MID        int    `json:"mid"`
	TypeID     int32  `json:"typeid"`
	Videos     int    `json:"videos"`
	Title      string `json:"title"`
	Cover      string `json:"cover"`
	Content    string `json:"content"`
	Duration   int    `json:"duration"`
	Copyright  int    `json:"copyright"`
	Pubtime    string `json:"pubtime"`
	Ctime      string `json:"ctime"`
	Mtime      string `json:"mtime"`
	State      int    `json:"state"`
	Manual     int    `json:"manual"`
	Valid      int    `json:"valid"`
	Submit     int    `json:"submit"`
	Retry      int    `json:"retry"`
	Result     int    `json:"result"`
	Deleted    int    `json:"deleted"`
	InjectTime string `json:"inject_time"`
	Reason     string `json:"reason"`
}

MarkArc contains the main fields that we want to pick up from databus message

func (MarkArc) IsPass

func (a MarkArc) IsPass() bool

IsPass returns whether the arc is able to play

type MarkVideo

type MarkVideo struct {
	Mark       int    `json:"mark"`
	Deleted    int    `json:"deleted"`
	CID        int64  `json:"cid"`
	AID        int64  `json:"aid"`
	EPTitle    string `json:"eptitle"`
	IndexOrder int    `json:"index_order"`
	Valid      int    `json:"valid"`
	Result     int    `json:"result"`
	Submit     int    `json:"submit"`
	Transcoded int    `json:"transcoded"`
	Retry      int64  `json:"retry"`
}

MarkVideo contains the main fields that we want to pick up from databus message

func (*MarkVideo) CanPlay

func (vm *MarkVideo) CanPlay() bool

CanPlay tells whether a video can play or not

func (*MarkVideo) ToAudit

func (vm *MarkVideo) ToAudit(criCID int64) bool

ToAudit distinguishes whether the CID need to be reported to the license owner

func (*MarkVideo) ToCMS

func (vm *MarkVideo) ToCMS() *VideoCMS

ToCMS transforms a databus video to CMS info

func (*MarkVideo) ToReport

func (vm *MarkVideo) ToReport(criCID int64) bool

ToReport distinguishes whether the CID need to be reported to video cloud

type ReqSetUp

type ReqSetUp struct {
	Value  string
	MID    int64
	UpType int
}

ReqSetUp is the structure of request to function in Dao, set upper value

type SimpleArc

type SimpleArc struct {
	AID      int64
	MID      int64
	TypeID   int32
	Videos   int64
	Title    string
	Cover    string
	Content  string
	Duration int64
	Pubtime  string
}

SimpleArc provides the fields for license owner sync

type SimpleVideo

type SimpleVideo struct {
	ID          int
	CID         int64
	IndexOrder  int64
	Eptitle     string
	Duration    int64
	Description string
}

SimpleVideo provides the fields for license owner sync

type Upper

type Upper struct {
	MID     int64
	Toinit  int
	Submit  int    // 1=need report
	OriName string // original name
	CMSName string // cms intervened name
	OriFace string // original face
	CMSFace string // cms intervened face
	Valid   int    // auth info: 1=online,0=hidden
	Deleted int
}

Upper reprensents the uppers

func (*Upper) IsSame

func (u *Upper) IsSame(name, face string) (f bool, n bool)

IsSame returns whether the upper is the same

type VideoCMS

type VideoCMS struct {
	// Media Info
	CID        int
	Title      string
	AID        int
	IndexOrder int
	// Auth Info
	Valid   int
	Deleted int
	Result  int
}

VideoCMS represents the video data structure in MC

type VideoDiff

type VideoDiff struct {
	Aid     int64
	Equal   []int64 // totally equal
	New     []int64 // new added videos
	Updated []*arcmdl.Page
	Removed []int64
}

VideoDiff reprensents the result of videos comparison

Jump to

Keyboard shortcuts

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