archive

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

Documentation

Index

Constants

View Source
const (
	//UpFromPGC pgc
	UpFromPGC = 1
	//UpFromPGCSecret pgc secret
	UpFromPGCSecret = 5
	//UpFromCoopera pgc cooperate
	UpFromCoopera = 6
)
View Source
const (
	//StateOpen state open
	StateOpen = 0
	//StateOrange 橙色通过
	StateOrange = 1

	//StateForbidWait 待审
	StateForbidWait = -1
	//StateForbidRecicle 打回
	StateForbidRecicle = -2
	//StateForbidPolice 网警锁定
	StateForbidPolice = -3
	//StateForbidLock 锁定
	StateForbidLock = -4
	//StateForbidFixed 修复待审
	StateForbidFixed = -6
	//StateForbidLater 暂缓待审
	StateForbidLater = -7
	//StateForbidXcodeFail 转码失败
	StateForbidXcodeFail = -16
	//StateForbidSubmit 创建提交
	StateForbidSubmit = -30
	//StateForbidUserDelay 定时
	StateForbidUserDelay = -40
	//StateForbidUpDelete 删除
	StateForbidUpDelete = -100
	//RoundBegin 开始流转
	RoundBegin = 0
	//RoundAuditSecond 二审:选定分区的多P稿件 及 PGC/活动的单P多P稿件
	RoundAuditSecond = 10
	//RoundAuditThird 三审:选定分区/PGC/活动 的单P多P稿件
	RoundAuditThird = 20
	//RoundReviewFirst 分区回查:粉丝小于配置阈值 如 5000 且 指定分区
	RoundReviewFirst = 30
	//RoundReviewFirstWaitTrigger 点击/粉丝 等待触发中间状态,7天内达到阈值进列表,未达到自动变99
	RoundReviewFirstWaitTrigger = 31
	//RoundReviewSecond 社区回查:粉丝大于配置阈值 如 5000 或 优质高危up
	RoundReviewSecond = 40
	//RoundTriggerFans  粉丝回查:粉丝量达到配置阈值
	RoundTriggerFans = 80
	//RoundTriggerClick 点击回查:点击量达到配置阈值
	RoundTriggerClick = 90
	//RoundEnd 流转结束
	RoundEnd = 99
	//AccessDefault access
	AccessDefault = int16(0)
	//AccessMember 会员可见
	AccessMember = int16(10000)
	//CopyrightUnknow copyright
	CopyrightUnknow = 0
	//CopyrightOriginal 原创
	CopyrightOriginal = 1
	//CopyrightCopy 转载
	CopyrightCopy = 2

	//AttrYes attribute yes
	AttrYes = int32(1)
	//AttrNo attribute no
	AttrNo = int32(0)
	//AttrBitNoRank 禁止排序
	AttrBitNoRank = uint(0)
	//AttrBitNoDynamic 禁止动态
	AttrBitNoDynamic = uint(1)
	//AttrBitNoWeb 禁止web
	AttrBitNoWeb = uint(2)
	//AttrBitNoMobile 禁止手机端
	AttrBitNoMobile = uint(3)
	//AttrBitNoSearch 禁止搜索
	AttrBitNoSearch = uint(4)
	//AttrBitOverseaLock 禁止海外
	AttrBitOverseaLock = uint(5)
	//AttrBitNoRecommend 禁止推荐
	AttrBitNoRecommend = uint(6)

	//AttrBitHasHD5 是否高清
	AttrBitHasHD5 = uint(8)

	//AttrBitAllowBp 允许承包
	AttrBitAllowBp = uint(10)
	//AttrBitIsBangumi 番剧
	AttrBitIsBangumi = uint(11)
	//AttrBitIsPOrder 是否私单
	AttrBitIsPOrder = uint(12)

	//AttrBitHideClick 点击
	AttrBitHideClick = uint(13)
	//AttrBitAllowTag 允许操作tag
	AttrBitAllowTag = uint(14)

	//AttrBitJumpURL 跳转
	AttrBitJumpURL = uint(16)
	//AttrBitIsMovie is movie
	AttrBitIsMovie = uint(17)
	//AttrBitBadgepay 付费
	AttrBitBadgepay = uint(18)

	//ReplyDefault 默认评论状态
	ReplyDefault = int64(-1)
	//ReplyOn 开评论
	ReplyOn = int64(0)
	//ReplyOff 关评论
	ReplyOff = int64(1)

	//LogBusJob 稿件后台任务日志bus
	LogBusJob = 211
	//LogTypeReply 稿件后台任务type评论
	LogTypeReply = 1
)
View Source
const (
	//RouteFirstRound 一转
	RouteFirstRound = "first_round"
	//RouteUGCFirstRound 一转
	RouteUGCFirstRound = "ugc_first_round"
	//RouteSecondRound 二转
	RouteSecondRound = "second_round"
	//RouteAddArchive 新增稿件
	RouteAddArchive = "add_archive"
	//RouteModifyArchive 稿件编辑
	RouteModifyArchive = "modify_archive"
	//RouteAutoOpen 自动开放
	RouteAutoOpen = "auto_open"
	//RouteDelayOpen 定时开放
	RouteDelayOpen = "delay_open"
	//RoutePostFirstRound first_round后续处理
	RoutePostFirstRound = "post_first_round"
)
View Source
const (
	DelayTypeForAdmin = int8(1)
	DelayTypeForUser  = int8(2)
)

定时发布类型

View Source
const (
	//FlowPoolRecheck 回查pool(含热门回查、频道回查)
	FlowPoolRecheck = 4
	//FLowGroupIDChannel 频道回查的流量控制分组id
	FLowGroupIDChannel = 23
	//FlowGroupIDHot 热门回查的流量控制分组id
	FlowGroupIDHot = 24

	//FlowOpen 开启
	FlowOpen = int8(0)
	//FlowDelete 取消
	FlowDelete = int8(1)

	//FlowLogAdd 流量添加日志
	FlowLogAdd = int8(1)
	//FlowLogUpdate 流量更新日志
	FlowLogUpdate = int8(2)
	//FlowLogDel 流量删除日志
	FlowLogDel = int8(3)

	//PoolArc 稿件流量
	PoolArc = int8(0)
	//PoolUp up主流量
	PoolUp = int8(1)
	//PoolPrivateOrder 私单流量
	PoolPrivateOrder = int8(2)
	//PoolArticle 专栏流量
	PoolArticle = int8(3)
	//PoolArcForbid 稿件禁止流量
	PoolArcForbid = int8(4)
)
View Source
const (
	//OperTypeNoChannel oper type
	OperTypeNoChannel = int8(1)
	// OperStyleOne 操作展示类型1:[%s]从[%v]设为[%v]
	OperStyleOne = int8(1)
	// OperStyleTwo 操作展示类型2:[%s]%v:%v
	OperStyleTwo = int8(2)
)
View Source
const (
	//TypeHotRecheck 热门回查
	TypeHotRecheck = 1
	//TypeChannelRecheck 频道回查
	TypeChannelRecheck = 0
	//TypeExcitationRecheck 激励回查
	TypeExcitationRecheck = 2
	//RecheckStateWait  待回查
	RecheckStateWait = int8(-1)
	//RecheckStateNoForbid 已回查,且没有禁止(热门)  已回查(频道)
	RecheckStateNoForbid = int8(0)
	//RecheckStateForbid 已回查,且禁止(热门)
	RecheckStateForbid = int8(1)

	//RecheckStateIgnore 被忽略不需要回查的状态
	RecheckStateIgnore = int8(-2)

	// FromListChannelReview 从频道回查列表提交的数据
	FromListChannelReview = "channel_review"
	// FromListHotReview 从热门回查列表提交的数据
	FromListHotReview = "hot_review"

	// FromListExcitation 从激励回查列表提交的数据
	FromListExcitation = "excitation_list"
)
View Source
const (
	//VideoUploadInfo 转码 创建上传
	VideoUploadInfo = 0
	//VideoXcodeSDFail 一转失败
	VideoXcodeSDFail = 1
	//VideoXcodeSDFinish 一转成功
	VideoXcodeSDFinish = 2
	//VideoXcodeHDFail 二转失败
	VideoXcodeHDFail = 3
	//VideoXcodeHDFinish 二转成功
	VideoXcodeHDFinish = 4
	//VideoDispatchRunning 分发中
	VideoDispatchRunning = 5
	//VideoDispatchFinish 分发成功
	VideoDispatchFinish = 6

	//XcodeFailZero fail zero
	XcodeFailZero = 0

	//VideoStatusOpen 开放浏览
	VideoStatusOpen = int16(0)
	//VideoStatusAccess 会员可见
	VideoStatusAccess = int16(10000)
	//VideoStatusWait 待审
	VideoStatusWait = int16(-1)
	//VideoStatusRecicle 打回
	VideoStatusRecicle = int16(-2)
	//VideoStatusLock 锁定
	VideoStatusLock = int16(-4)
	//VideoStatusXcodeFail 转码失败
	VideoStatusXcodeFail = int16(-16)
	//VideoStatusSubmit 创建提交
	VideoStatusSubmit = int16(-30)
	//VideoStatusDelete 删除
	VideoStatusDelete = int16(-100)

	// VideoStatusRecycle video status which be recycled
	VideoStatusRecycle = int16(-2)

	//VideoRelationBind video relation state
	VideoRelationBind = int16(0)
)

Variables

View Source
var (
	ReportArchiveRound     = map[int8]string{30: "30", 40: "40", 90: "90"}
	ReportTypeTookMinute   = int8(1)
	ReportTypeTookHalfHour = int8(2)
	ReportTypeVideoAudit   = int8(3)
	ReportTypeArcMoveType  = int8(4)
	ReportTypeArcRoundFlow = int8(5)
	ReportTypeXcode        = int8(6) //video sd_finish,hd_finish,dispatch take time
	ReportTypeTraffic      = int8(7) //视频审核耗时统计。10分钟聚合的一转、一审、二转、分发耗时结果
)

1 耗时 2 耗时(30分钟) 3 视频进审/过审分布

View Source
var (
	// TookTypeMinute video task took time in 1 minute
	TookTypeMinute = int8(1)
	// TookTypeHalfHour video task took time in 10 minutes
	TookTypeHalfHour = int8(2)
	// TaskStateUnclaimed video task belongs to nobody
	TaskStateUnclaimed = int8(0)
	// TaskStateUntreated video task not submit
	TaskStateUntreated = int8(1)
	// TaskStateCompleted video task completed
	TaskStateCompleted = int8(2)
	// TaskStateDelayed video task delayed
	TaskStateDelayed = int8(3)
	// TaskStateClosed video task closed
	TaskStateClosed = int8(4)
)
View Source
var (
	//FlowOperType type
	FlowOperType = map[int64]int8{
		FLowGroupIDChannel: OperTypeNoChannel,
	}
)
View Source
var ReplyDesc = map[int64]string{
	ReplyDefault: "未知状态",
	ReplyOn:      "开",
	ReplyOff:     "关",
}

ReplyDesc 评论状态描述

View Source
var ReplyState = []int64{
	ReplyDefault,
	ReplyOn,
	ReplyOff,
}

ReplyState 评论开关状态

View Source
var StateMean = map[int]string{
	StateOpen:   "开放浏览",
	StateOrange: "橙色通过",

	StateForbidWait:    "待审",
	StateForbidRecicle: "打回",
	StateForbidPolice:  "网警锁定",
	StateForbidLock:    "锁定稿件",
	StateForbidFixed:   "修复待审",
	StateForbidLater:   "暂缓审核",

	StateForbidXcodeFail: "转码失败",
	StateForbidSubmit:    "创建提交",
	StateForbidUserDelay: "用户定时发布",
	StateForbidUpDelete:  "UP主删除",
}

StateMean the mean for archive state

Functions

func NormalState

func NormalState(state int) bool

NormalState normal state

func Operformat

func Operformat(tagID int8, old, new interface{}, style int8) (cont string)

Operformat oper format.

func RecheckType

func RecheckType(tp int) (str string)

RecheckType get recheck type name

Types

type Addit

type Addit struct {
	ID          int64
	Aid         int64
	Source      string
	RedirectURL string
	MissionID   int64
	UpFrom      int8
	OrderID     int
	Dynamic     string
}

Addit addit struct

func (*Addit) IsPGC

func (addit *Addit) IsPGC() bool

IsPGC is archive from pgc

type ArcMoveTypeCache

type ArcMoveTypeCache struct {
	Data map[int8]map[int16]map[string]int
	sync.Mutex
}

ArcMoveTypeCache archive move typeid count

type ArcRoundFlowCache

type ArcRoundFlowCache struct {
	Data map[int8]map[int64]map[string]int
	sync.Mutex
}

ArcRoundFlowCache archive round flow record

type Archive

type Archive struct {
	ID        int64  `json:"id"`
	AID       int64  `json:"aid"` //result库binlog={id:0,aid:xxx}
	Mid       int64  `json:"mid"`
	TypeID    int16  `json:"typeid"`
	HumanRank int    `json:"humanrank"`
	Duration  int    `json:"duration"`
	Desc      string `json:"desc"`
	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     int    `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"`
	PTime     string `json:"ptime"`
}

Archive archive

func (*Archive) AttrVal

func (a *Archive) AttrVal(bit uint) int32

AttrVal get attribute value.

func (*Archive) IsSyncState

func (a *Archive) IsSyncState() bool

IsSyncState can archive sync

type ArgStat

type ArgStat struct {
	Aid    int64
	Field  int
	Value  int
	RealIP string
}

ArgStat arg state

type Delay

type Delay struct {
	ID    int64
	Aid   int64
	DTime time.Time
	Type  int8
	State int8
}

Delay 定时发布结构

type Flow

type Flow struct {
	ID     int64           `json:"id"`
	Remark string          `json:"remark"`
	Rank   int64           `json:"rank"`
	Type   int8            `json:"type"`
	Value  json.RawMessage `json:"value"`
	CTime  time.Time       `json:"ctime"`
	Pool   int8            `json:"pool"`
	State  int8            `json:"state"`
}

Flow info

type FlowData

type FlowData struct {
	ID         int64     `json:"id"`
	Pool       int8      `json:"pool"`
	OID        int64     `json:"oid"`
	UID        int64     `json:"uid"`
	Parent     int8      `json:"parent"`
	GroupID    int64     `json:"group_id"`
	Remark     string    `json:"remark"`
	State      int8      `json:"state"`
	CTime      time.Time `json:"ctime"`
	MTime      time.Time `json:"mtime"`
	GroupValue []byte    `json:"group_value"`
}

FlowData Flow data

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 message

type Mosaic

type Mosaic struct {
	X     int64 `json:"x"`
	Y     int64 `json:"y"`
	W     int64 `json:"w"`
	H     int64 `json:"h"`
	Start int64 `json:"start"`
	End   int64 `json:"end"`
}

Mosaic 马赛克

type Oper

type Oper struct {
	ID        int64     `json:"id"`
	AID       int64     `json:"aid"`
	UID       int64     `json:"uid"`
	TypeID    int16     `json:"typeid"`
	State     int       `json:"state"`
	Content   string    `json:"-"`
	Round     int8      `json:"round"`
	Attribute int32     `json:"attribute"`
	LastID    int64     `json:"last_id"`
	Remark    string    `json:"-"`
	CTime     time.Time `json:"ctime"`
	MTime     time.Time `json:"mtime"`
}

Oper is archive operate model.

type Recheck

type Recheck struct {
	ID     int64     `json:"id"`
	Type   int       `json:"type"`
	Aid    int64     `json:"aid"`
	UID    int64     `json:"uid"`
	State  int8      `json:"state"`
	Remark string    `json:"remark"`
	CTime  time.Time `json:"ctime"`
	MTime  time.Time `json:"mtime"`
}

Recheck archive recheck

type Report

type Report struct {
	ID      int64           `json:"-"`
	TypeID  int8            `json:"type"`
	Content json.RawMessage `json:"content"`
	CTime   time.Time       `json:"ctime"`
	MTime   time.Time       `json:"mtime"`
}

Report struct

type Task

type Task struct {
	ID      int64     `json:"id"`
	Subject int8      `json:"subject"`
	Adminid int64     `json:"adminid"`
	Pool    int8      `json:"pool"`
	Aid     int64     `json:"aid"`
	Cid     int64     `json:"cid"`
	State   int8      `json:"state"`
	Ctime   time.Time `json:"ctime"`
	Mtime   time.Time `json:"-"`
}

Task video task entity

type TaskCache

type TaskCache struct {
	Task  map[int64]*Task
	Took  []*TaskTook
	Sort  []int
	Mtime time.Time
	sync.Mutex
}

TaskCache store task video

type TaskTook

type TaskTook struct {
	ID     int64     `json:"id"`
	M90    int       `json:"m90"`
	M80    int       `json:"m80"`
	M60    int       `json:"m60"`
	M50    int       `json:"m50"`
	TypeID int8      `json:"type"`
	Ctime  time.Time `json:"ctime"`
	Mtime  time.Time `json:"-"`
}

TaskTook video task take time

type Track

type Track struct {
	// common values
	Timestamp time.Time `json:"timestamp"`
	// archive stat
	State int `json:"state"`
	Round int `json:"round"`
	// AID    int64  `json:"aid,omitempty"`
	Remark    string `json:"remark,omitempty"`
	Attribute int32  `json:"attribute"`
}

Track archive track info

type Type

type Type struct {
	ID   int16  `json:"id"`
	PID  int16  `json:"pid"`
	Name string `json:"name"`
}

Type archive_type

type UpInfo

type UpInfo struct {
	Nw  *Archive
	Old *Archive
}

UpInfo up info

type Video

type Video struct {
	ID          int64  `json:"id"`
	Filename    string `json:"filename"`
	Cid         int64  `json:"cid"`
	Aid         int64  `json:"aid"`
	Title       string `json:"eptitle"`
	Desc        string `json:"description"`
	SrcType     string `json:"src_type"`
	Duration    int64  `json:"duration"`
	Filesize    int64  `json:"filesize"`
	Resolutions string `json:"resolutions"`
	Playurl     string `json:"playurl"`
	FailCode    int8   `json:"failinfo"`
	Index       int    `json:"index_order"`
	Attribute   int32  `json:"attribute"`
	XcodeState  int8   `json:"xcode_state"`
	State       int8   `json:"state"`
	Status      int16  `json:"status"`
	CTime       string `json:"ctime"`
	MTime       string `json:"mtime"`
}

Video struct

func (*Video) AttrVal

func (v *Video) AttrVal(bit uint) int32

AttrVal get attribute value.

type VideoAuditCache

type VideoAuditCache struct {
	Data map[int16]map[string]int
	sync.Mutex
}

VideoAuditCache video audit count

type VideoDesign

type VideoDesign struct {
	Mosaic    []*Mosaic    `json:"mosaic,omitempty"`
	WaterMark []*WaterMark `json:"watermark,omitempty"`
}

VideoDesign 自定义马赛克和水印

type VideoOper

type VideoOper struct {
	AID       int64
	UID       int64
	VID       int64
	Status    int
	Content   string
	Attribute int32
	LastID    int64
	Remark    string
}

VideoOper 视频审核记录结构

type VideoTrack

type VideoTrack struct {
	// common values
	Timestamp  time.Time `json:"timestamp"`
	XCodeState int8      `json:"xcode_state"`
	// video status
	Status int16  `json:"status"`
	AID    int64  `json:"aid,omitempty"`
	Remark string `json:"remark,omitempty"`
}

VideoTrack video track info

type VideoUpInfo

type VideoUpInfo struct {
	Nw  *Video
	Old *Video
}

VideoUpInfo info

type VideoupMsg

type VideoupMsg struct {
	Route     string `json:"route"`
	Filename  string `json:"filename"`
	Timestamp int64  `json:"timestamp"`
	// cid
	Cid       int64  `json:"cid,omitempty"`
	DMIndex   string `json:"dm_index,omitempty"`
	SendEmail bool   `json:"send_email"`
	// encode
	Xcode          int8         `json:"xcode"`
	EncodePurpose  string       `json:"encode_purpose,omitempty"`
	EncodeRegionID int16        `json:"encode_region_id,omitempty"`
	EncodeTypeID   int16        `json:"encode_type_id,omitempty"`
	VideoDesign    *VideoDesign `json:"video_design,omitempty"`
	Status         int16        `json:"status,omitempty"`
	// add or modify archive
	Aid         int64 `json:"aid,omitempty"`
	EditArchive bool  `json:"edit_archive,omitempty"`
	EditVideo   bool  `json:"edit_video,omitempty"`
	// ChangeTypeID
	ChangeTypeID bool `json:"change_typeid"`
	// ChangeCopyright
	ChangeCopyright bool `json:"change_copyright"`
	// ChangeCover
	ChangeCover bool `json:"change_cover"`
	// ChangeTitle
	ChangeTitle bool `json:"change_title"`
	// Notify
	Notify bool `json:"send_notify"`
	// MissionID
	MissionID int64 `json:"mission_id,omitempty"`
	// AdminChange
	AdminChange bool   `json:"admin_change,omitempty"`
	FromList    string `json:"from_list"`
	TagChange   bool   `json:"tag_change,omitempty"`
	AddVideos   bool   `json:"add_videos,omitempty"`
}

VideoupMsg msg

type WaterMark

type WaterMark struct {
	LOC   int8   `json:"loc,omitempty"`
	URL   string `json:"url,omitempty"`
	MD5   string `json:"md5,omitempty"`
	Start int64  `json:"start,omitempty"`
	End   int64  `json:"end,omitempty"`
	X     int64  `json:"x,omitempty"`
	Y     int64  `json:"y,omitempty"`
}

WaterMark 水印

type XcodeTimeCache

type XcodeTimeCache struct {
	Data map[int8][]int
	sync.Mutex
}

XcodeTimeCache store video xcode time list

Jump to

Keyboard shortcuts

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