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

Documentation

Index

Constants

View Source
const (
	// CopyrightOrigin 自制
	CopyrightOrigin = int64(1)
	// CopyrightReprint 转载
	CopyrightReprint = int64(2)
	// TagPredictFromWeb web tag推荐
	TagPredictFromWeb = int8(0)
	// TagPredictFromAPP app tag推荐
	TagPredictFromAPP = int8(1)
	// TagPredictFromWindows windows tag推荐
	TagPredictFromWindows = int8(2)
)
View Source
const (
	// attribute yes and no
	AttrYes = int32(1)
	AttrNo  = int32(0)
	// attribute bit
	AttrBitNoRank       = uint(0)
	AttrBitNoDynamic    = uint(1)
	AttrBitNoWeb        = uint(2)
	AttrBitNoMobile     = uint(3)
	AttrBitNoSearch     = uint(4)
	AttrBitOverseaLock  = uint(5)
	AttrBitNoRecommend  = uint(6)
	AttrBitNoReprint    = uint(7)
	AttrBitHasHD5       = uint(8)
	AttrBitIsPGC        = uint(9)
	AttrBitAllowBp      = uint(10)
	AttrBitIsBangumi    = uint(11)
	AttrBitIsPorder     = uint(12)
	AttrBitLimitArea    = uint(13)
	AttrBitAllowTag     = uint(14)
	AttrBitIsFromArcAPI = uint(15) // TODO: delete
	AttrBitJumpURL      = uint(16)
	AttrBitIsMovie      = uint(17)
	AttrBitBadgepay     = uint(18)
	AttrBitIsJapan      = uint(19) //日文稿件
	AttrBitNoPushBplus  = uint(20) //是否动态禁止
	AttrBitParentMode   = uint(21) //家长模式
	AttrBitUGCPay       = uint(22) //UGC付费
	AttrBitHasBGM       = uint(23) //稿件带有BGM
	AttrBitIsCoop       = uint(24) //联合投稿
)

Const State

View Source
const (
	WebType = int8(1)
	AppType = int8(2)
)

const client type values

View Source
const (
	PlatformWeb     = "web"
	PlatformWindows = "windows"
	PlatformH5      = "h5"
	PlatformAndroid = "android"
	PlatformIOS     = "ios"
)

Platform const

View Source
const VoteType int8 = 2

VoteType 投票业务

Variables

View Source
var RulesForApp = map[int16]int16{
	160: 1,
	4:   2,
	129: 3,
	3:   4,
	155: 5,
	5:   6,
	36:  7,
	188: 8,
	1:   9,
	181: 10,
	119: 11,
	167: 12,
	165: 13,
	177: 14,
	11:  15,
	13:  16,
	23:  17,
}

RulesForApp var

View Source
var RulesForWeb = map[int16]int16{
	4:   1,
	160: 2,
	5:   3,
	181: 4,
	3:   5,
	36:  6,
	188: 7,
	1:   8,
	155: 9,
	129: 10,
	13:  11,
	177: 12,
	119: 13,
	165: 14,
	167: 15,
	11:  16,
	23:  17,
}

RulesForWeb var

View Source
var (
	// VjInfo 审核当前拥挤状态的数据映射
	VjInfo = map[int8]*VideoJam{
		0: {
			Level:   0,
			State:   "状态正在计算中",
			Comment: "状态正在计算中",
		},
		1: {
			Level:   1,
			State:   "畅通",
			Comment: "预计稿件过审时间小于20分钟(剧集、活动投稿除外)",
		},
		2: {
			Level:   2,
			State:   "繁忙",
			Comment: "预计稿件过审时间小于40分钟(剧集、活动投稿除外)",
		},
		3: {
			Level:   3,
			State:   "拥挤",
			Comment: "预计稿件过审时间小于60分钟(剧集、活动投稿除外)",
		},
		4: {
			Level:   4,
			State:   "爆满",
			Comment: "预计稿件过审时间小于120分钟(剧集、活动投稿除外)",
		},
		5: {
			Level:   5,
			State:   "阻塞",
			Comment: "预计稿件过审时间大于120分钟(剧集、活动投稿除外)",
		},
	}
)

Functions

func CopyrightForCreatorAdd

func CopyrightForCreatorAdd(tid int16) bool

CopyrightForCreatorAdd fn 0,不限制;1,只允许自制;2,只允许转载 音乐-OP/ED/OST 54 番剧-完结动画 32 番剧-连载动画 33 番剧-资讯 51 电影-其他国家 83 电影-欧美电影 145 电影-日本电影 146 电影-国产电影 147 纪录片-人文历史 37

func ForbidSubTypesForAppAdd

func ForbidSubTypesForAppAdd(tid int16) bool

ForbidSubTypesForAppAdd fn 不允许投稿的分区: 连载剧集->15,完结剧集->34,电视剧相关->128,电影相关->82 原不能投多P的分区,创作姬统一不允许投稿: 欧美电影->145,日本电影->146,国产电影->147,其他国家->83

func ForbidTopTypesForAll

func ForbidTopTypesForAll(tid int16) bool

ForbidTopTypesForAll fn 175=>ASMR

func ForbidTopTypesForAppAdd

func ForbidTopTypesForAppAdd(tid int16) bool

ForbidTopTypesForAppAdd fn 不允许APP投稿顶级分区: 纪录片->177,电视剧->11,番剧->13

func InMovieType

func InMovieType(tid int16) bool

InMovieType judge type for pubdate

func IsCloseState

func IsCloseState(s int) bool

IsCloseState judge arc state.

func NeedPoi

func NeedPoi(s string) (needPOI int)

NeedPoi fn

func NeedVote

func NeedVote(s string) (needVote int)

NeedVote fn

func ShortDesc

func ShortDesc(desc string) string

ShortDesc cut down to short desc for adapter app and windows clients

func SortRulesForTopTypes

func SortRulesForTopTypes(types []*Type, clientType int8)

SortRulesForTopTypes fn

func StatePanel

func StatePanel(s int8) (st int)

StatePanel judge archive state for app panel.

func ToLang

func ToLang(langStr string) (lang int8)

ToLang str to int8.

Types

type AdInfo

type AdInfo struct {
	Nation string `json:"nation"`
	Provin string `json:"province"`
	Distri string `json:"district"`
	City   string `json:"city"`
}

AdInfo str

type Ancestor

type Ancestor struct {
	POI  string `json:"poi"`
	Type int32  `json:"type"`
}

Ancestor str

type AppFormat

type AppFormat struct {
	ID        int64 `json:"id"`
	Copyright int8  `json:"copyright"`
	TypeID    int64 `json:"typeid"`
}

AppFormat app format.

type ArcHistory

type ArcHistory struct {
	ID      int64     `json:"id,omitempty"`
	Aid     int64     `json:"aid,omitempty"`
	Mid     int64     `json:"mid,omitempty"`
	Tag     string    `json:"tag,omitempty"`
	Title   string    `json:"title,omitempty"`
	Content string    `json:"content,omitempty"`
	Cover   string    `json:"cover,omitempty"`
	CTime   time.Time `json:"ctime,omitempty"`
	Video   []*Video  `json:"videos,omitempty"`
}

ArcHistory archive of history

type ArcPorder

type ArcPorder struct {
	FlowID     int64  `json:"flow_id"`
	IndustryID int64  `json:"industry_id"`
	BrandID    int64  `json:"brand_id"`
	BrandName  string `json:"brand_name"`
	Official   int8   `json:"official"`
	ShowType   string `json:"show_type"`
	// for admin operation
	Advertiser string `json:"advertiser"`
	Agent      string `json:"agent"`
	//state 0 自首  1  审核添加
	State int8 `json:"state"`
}

ArcPorder str

type ArcVideo

type ArcVideo struct {
	Archive *Archive
	Videos  []*Video
}

ArcVideo str

type ArcVideoAudit

type ArcVideoAudit struct {
	*ArcVideo
	Stat        *api.Stat `json:"stat"`
	StatePanel  int       `json:"state_panel"`
	ParentTName string    `json:"parent_tname"`
	TypeName    string    `json:"typename"`
	OpenAppeal  int64     `json:"open_appeal"`
}

ArcVideoAudit archive video audit.

func (*ArcVideoAudit) AttrVal

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

AttrVal get attribute.

func (*ArcVideoAudit) IsOwner

func (a *ArcVideoAudit) IsOwner(mid int64) int8

IsOwner fn

type Archive

type Archive struct {
	Aid          int64  `json:"aid"`
	Mid          int64  `json:"mid"`
	TypeID       int16  `json:"tid"`
	HumanRank    int    `json:"-"`
	Title        string `json:"title"`
	Author       string `json:"author"`
	Cover        string `json:"cover"`
	RejectReason string `json:"reject_reason"`
	Tag          string `json:"tag"`
	Duration     int64  `json:"duration"`
	Copyright    int8   `json:"copyright"`
	NoReprint    int8   `json:"no_reprint"`
	UgcPay       int8   `json:"ugcpay"`
	OrderID      int64  `json:"order_id"`
	OrderName    string `json:"order_name"`
	Desc         string `json:"desc"`
	MissionID    int64  `json:"mission_id"`
	MissionName  string `json:"mission_name"`
	Round        int8   `json:"-"`
	Forward      int64  `json:"-"`
	Attribute    int32  `json:"attribute"`
	Access       int16  `json:"-"`
	State        int8   `json:"state"`
	StateDesc    string `json:"state_desc"`
	StatePanel   int    `json:"state_panel"`
	Source       string `json:"source"`
	DescFormatID int64  `json:"desc_format_id"`
	Attrs        *Attrs `json:"attrs"`
	// feature: private orders
	Porder  *ArcPorder `json:"porder"`
	Dynamic string     `json:"dynamic"`
	PoiObj  *PoiObj    `json:"poi_object"`
	// time
	DTime      time.Time    `json:"dtime"`
	PTime      time.Time    `json:"ptime"`
	CTime      time.Time    `json:"ctime"`
	MTime      time.Time    `json:"-"`
	UgcPayInfo *UgcPayInfo  `json:"ugcpay_info"`
	Staffs     []*StaffView `json:"staffs"`
	Vote       *Vote        `json:"vote"`
}

Archive is archive model.

func (*Archive) NilPoiObj

func (arc *Archive) NilPoiObj(platform string)

NilPoiObj fn 防止非APP端的地理位置信息泄露

func (*Archive) NilVote

func (arc *Archive) NilVote()

NilVote fn

type Attrs

type Attrs struct {
	IsCoop  int8 `json:"is_coop"`
	IsOwner int8 `json:"is_owner"`
}

Attrs str

type BIZ

type BIZ struct {
	ID     int64     `json:"id"`
	Type   int32     `json:"type"`
	Aid    int64     `json:"aid"`
	Uid    int64     `json:"uid"`
	State  int8      `json:"state"`
	Remark string    `json:"remark"`
	Data   string    `json:"data"`
	Ctime  time.Time `json:"ctime"`
	Mtime  time.Time `json:"mtime"`
}

BIZ business

type Commercial

type Commercial struct {
	AID      int64 `json:"aid"`
	POrderID int64 `json:"porder_id"` // 私
	OrderID  int64 `json:"order_id"`  // 商
	GameID   int64 `json:"game_id"`
}

Commercial type

type DescFormat

type DescFormat struct {
	ID         int64  `json:"id"`
	Copyright  int8   `json:"copyright"`
	TypeID     int64  `json:"typeid"`
	Components string `json:"components"`
	Lang       int8   `json:"lang"`
}

DescFormat is archive type.

type Dpub

type Dpub struct {
	Deftime    time.Time `json:"deftime"`
	DeftimeEnd time.Time `json:"deftime_end"`
	DeftimeMsg string    `json:"deftime_msg"`
}

Dpub str

type Flow

type Flow struct {
	ID     uint   `json:"id"`
	Remark string `json:"remark"`
}

Flow type

type Location

type Location struct {
	Lat float64 `json:"lat"`
	Lng float64 `json:"lng"`
}

Location str

type OldArchiveVideoAudit

type OldArchiveVideoAudit struct {
	*api.Arc
	RejectReson string           `json:"reject,omitempty"`
	Dtime       time.Time        `json:"dtime,omitempty"`
	VideoAudits []*OldVideoAudit `json:"video_audit,omitempty"`
	StateDesc   string           `json:"state_desc"`
	StatePanel  int              `json:"state_panel"`
	ParentTName string           `json:"parent_tname"`
	Attrs       *Attrs           `json:"attrs"`
	UgcPay      int8             `json:"ugcpay"`
}

OldArchiveVideoAudit archive with audit. NOTE: old struct, will delete!!!

type OldVideoAudit

type OldVideoAudit struct {
	Reason     string `json:"reason,omitempty"`
	Eptitle    string `json:"eptitle,omitempty"`
	IndexOrder int    `json:"index_order"`
}

OldVideoAudit video audit. NOTE: old struct, will delete!!!

type PayAct

type PayAct struct {
	Reason string `json:"reason"`
	State  int8   `json:"state"`
}

PayAct str

type PayAsset

type PayAsset struct {
	Price         int            `json:"price"`
	PlatformPrice map[string]int `json:"platform_price"`
}

PayAsset str

type PoiObj

type PoiObj struct {
	POI           string      `json:"poi"`
	Type          int32       `json:"type"`
	Addr          string      `json:"address"`
	Title         string      `json:"title"`
	ShowTitle     string      `json:"show_title"`
	AdInfo        *AdInfo     `json:"ad_info"`
	Ancestors     []*Ancestor `json:"ancestors"`
	Distance      float64     `json:"distance"`
	ShowDistrance string      `json:"show_distance"`
	Location      *Location   `json:"location"`
}

PoiObj str

type Porder

type Porder struct {
	ID         int64     `json:"id"`
	AID        int64     `json:"aid"`
	IndustryID int64     `json:"industry_id"`
	BrandID    int64     `json:"brand_id"`
	BrandName  string    `json:"brand_name"`
	Official   int8      `json:"is_official"`
	ShowType   string    `json:"show_type"`
	Advertiser string    `json:"advertiser"`
	Agent      string    `json:"agent"`
	Ctime      time.Time `json:"ctime,omitempty"`
	Mtime      time.Time `json:"mtime,omitempty"`
}

Porder type

type RecoArch

type RecoArch struct {
	Aid   int64  `json:"aid"`
	Title string `json:"title"`
	Owner string `json:"owner"`
}

RecoArch is simple archive information for recommend

type SimpleArchive

type SimpleArchive struct {
	Aid   int64  `json:"aid"`
	Title string `json:"title"`
}

SimpleArchive is simple model for videos

type SimpleArchiveVideos

type SimpleArchiveVideos struct {
	Archive   *SpArchive `json:"archive"`
	SpVideos  []*SpVideo `json:"part_list"`
	AcceptAss bool       `json:"accept_ass"`
}

SimpleArchiveVideos str

type SimpleVideo

type SimpleVideo struct {
	Cid   int64  `json:"cid"`
	Index int    `json:"index"`
	Title string `json:"title"`
}

SimpleVideo is simple model for videos

type SpArchive

type SpArchive struct {
	Aid   int64  `json:"aid"`
	Title string `json:"title"`
	Mid   int64  `json:"mid,omitempty"`
}

SpArchive str

type SpVideo

type SpVideo struct {
	Cid        int64     `json:"cid"`
	Index      int       `json:"part_id"`
	Title      string    `json:"part_name"`
	Status     int16     `json:"status"`
	DmActive   int       `json:"dm_active"`
	DmModified time.Time `json:"dm_modified"`
}

SpVideo is a simple model with danmu status

type Staff

type Staff struct {
	ID         int64  `json:"id"`
	AID        int64  `json:"aid"`
	MID        int64  `json:"mid"`
	StaffMID   int64  `json:"staff_mid"`
	StaffTitle string `json:"staff_title"`
}

Staff type

type StaffApply

type StaffApply struct {
	ID            int64  `json:"id"`
	Type          int8   `json:"apply_type"`
	ASID          int64  `json:"apply_as_id"`
	ApplyAID      int64  `json:"apply_aid"`
	ApplyUpMID    int64  `json:"apply_up_mid"`
	ApplyStaffMID int64  `json:"apply_staff_mid"`
	ApplyTitle    string `json:"apply_title"`
	ApplyTitleID  int64  `json:"apply_title_id"`
	State         int8   `json:"apply_state"`
	StaffState    int8   `json:"staff_state"`
	StaffTitle    string `json:"staff_title"`
}

StaffApply type

type StaffView

type StaffView struct {
	ID         int64  `json:"id"`
	ApMID      int64  `json:"apply_staff_mid"`
	ApName     string `json:"apply_staff_name"`
	ApTitle    string `json:"apply_title"`
	ApAID      int64  `json:"apply_aid"`
	ApType     int    `json:"apply_type"`
	ApState    int    `json:"apply_state"`
	ApStaffID  int64  `json:"apply_asid"` //Staff表的主键ID
	StaffState int    `json:"staff_state"`
	StaffTitle string `json:"staff_title"`
}

StaffView Archive staff

type Type

type Type struct {
	ID        int16   `json:"id"`
	Lang      string  `json:"-"`
	Parent    int16   `json:"parent"`
	Name      string  `json:"name"`
	Desc      string  `json:"description"`
	Descapp   string  `json:"desc"`
	Count     int64   `json:"-"`              // top type count
	Original  string  `json:"intro_original"` // second type original
	IntroCopy string  `json:"intro_copy"`     // second type copy
	Notice    string  `json:"notice"`         // second type notice
	AppNotice string  `json:"-"`              // app notice
	CopyRight int8    `json:"copy_right"`
	Show      bool    `json:"show"`
	Rank      int16   `json:"-"`
	Children  []*Type `json:"children,omitempty"`
}

Type is archive type.

type UgcPayInfo

type UgcPayInfo struct {
	Acts  map[string]*PayAct `json:"acts"`
	Asset *PayAsset          `json:"asset"`
}

UgcPayInfo str

type Vcover

type Vcover struct {
	Filename string `json:"filename"`
	BFSPath  string `json:"bfs_path"`
}

Vcover muti cover for video.

type Video

type Video struct {
	ID           int64     `json:"-"`
	Aid          int64     `json:"aid"`
	Title        string    `json:"title"`
	Desc         string    `json:"desc"`
	Filename     string    `json:"filename"`
	SrcType      string    `json:"-"`
	Cid          int64     `json:"cid"`
	Duration     int64     `json:"duration"`
	Filesize     int64     `json:"-"`
	Resolutions  string    `json:"-"`
	Index        int       `json:"index"`
	Playurl      string    `json:"-"`
	Status       int16     `json:"status"`
	StatusDesc   string    `json:"status_desc"`
	RejectReason string    `json:"reject_reason"`
	FailCode     int8      `json:"fail_code"`
	FailDesc     string    `json:"fail_desc"`
	XcodeState   int8      `json:"-"`
	Attribute    int32     `json:"-"`
	CTime        time.Time `json:"ctime"`
	MTime        time.Time `json:"-"`
}

Video is videos model.

type VideoJam

type VideoJam struct {
	Level   int8   `json:"level"`
	State   string `json:"state"`
	Comment string `json:"comment"`
}

VideoJam is video traffic jam info for frontend

type ViewBGM

type ViewBGM struct {
	SID     int64  `json:"sid"`
	MID     int64  `json:"mid"`
	Title   string `json:"title"`
	Author  string `json:"author"`
	JumpURL string `json:"jump_url"`
}

ViewBGM bgm view

type ViewPoint

type ViewPoint struct {
	Type    int8   `json:"type"`
	From    int    `json:"from"`
	To      int    `json:"to"`
	Content string `json:"content"`
	State   int8   `json:"state"`
}

ViewPoint viewpoint struct

type ViewPointRow

type ViewPointRow struct {
	ID     int64        `json:"id"`
	AID    int64        `json:"aid"`
	CID    int64        `json:"cid"`
	Points []*ViewPoint `json:"points"`
	State  int32        `json:"state"`
	CTime  string       `json:"ctime"`
	MTime  string       `json:"mtime"`
}

ViewPointRow video highlight viewpoint

type Vote

type Vote struct {
	VoteID    int64  `json:"vote_id"`
	VoteTitle string `json:"vote_title"`
}

Vote str

type WhiteList

type WhiteList struct {
	Mid int64 `json:"mid"`
	Tp  int   `json:"type"`
}

WhiteList str

Jump to

Keyboard shortcuts

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