service

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRPCEmpty = errors.New("rpc reply empty")
)

ERROR

Functions

func InSliceIface

func InSliceIface(v interface{}, sl []interface{}) bool

InSliceIface checks given interface in interface slice.

func Slice2Interface

func Slice2Interface(slice []string) (uniqueslice []interface{})

Slice2Interface convert slice to interface

func Slice2String

func Slice2String(slice []interface{}) (uniqueslice []string)

Slice2String convert slice to string

func SliceUnique

func SliceUnique(slice []interface{}) (uniqueslice []interface{})

SliceUnique cleans repeated values in slice.

func StringHandler

func StringHandler(s1 string, s2 string, delimiter string, subtraction bool) string

StringHandler handle two strings 以s1顺序为准

Types

type Service

type Service struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

Service is service.

func New

func New(c *conf.Config) (s *Service)

New is videoup-admin service implementation.

func (*Service) AITrack

func (s *Service) AITrack(c context.Context, aid []int64) (aids string, err error)

AITrack .

func (*Service) AddPolicies

func (s *Service) AddPolicies(c *bm.Context, uid, gid int64, items []*oversea.PolicyParams) (err error)

AddPolicies add policies

func (*Service) AddPolicyGroup

func (s *Service) AddPolicyGroup(c *bm.Context, group *oversea.PolicyGroup) (err error)

AddPolicyGroup add policy group

func (*Service) AddWeightConf

func (s *Service) AddWeightConf(c context.Context, cfg *archive.WeightConf, uid int64, uname string) (err error)

AddWeightConf 配置权重

func (*Service) AllEditHistory

func (s *Service) AllEditHistory(c context.Context, aid int64) (hs []*archive.EditHistory, err error)

AllEditHistory 根据aid获取 其所有的用户编辑历史

func (*Service) ArchiveGroups

func (s *Service) ArchiveGroups(c *bm.Context, aid int64) (groups []*oversea.PolicyGroup, err error)

ArchiveGroups get policy group by archive id

func (*Service) BatchArchive

func (s *Service) BatchArchive(c context.Context, aps []*archive.ArcParam, action string) (err error)

BatchArchive batch async archive audit.

func (*Service) BatchUpTag

func (s *Service) BatchUpTag(c context.Context, uid int64, pm *archive.BatchTagParam) (warning string, err error)

BatchUpTag batch update archive tag

func (*Service) BatchVideo

func (s *Service) BatchVideo(c context.Context, vps []*archive.VideoParam, action string) (err error)

BatchVideo batch async video audit.

func (*Service) ChangeIndex

func (s *Service) ChangeIndex(c context.Context, lo *archive.IndexParam) (err error)

ChangeIndex change archive_video index.

func (*Service) ChannelNamesByAids

func (s *Service) ChannelNamesByAids(c context.Context, aids []int64) (aidMap map[int64][]string)

ChannelNamesByAids .

func (*Service) CheckArchive

func (s *Service) CheckArchive(aps []*archive.ArcParam) bool

CheckArchive check typeid

func (*Service) CheckGroup

func (s *Service) CheckGroup(c context.Context, uid int64) (role int8, err error)

CheckGroup 检查用户组权限

func (*Service) CheckOnline

func (s *Service) CheckOnline(c context.Context, uid int64) (on bool)

CheckOnline 检查在线状态

func (*Service) CheckOwner

func (s *Service) CheckOwner(c context.Context, tid, uid int64) (err error)

CheckOwner 检查任务状态修改权限

func (*Service) CheckStaff

func (s *Service) CheckStaff(vps []*archive.StaffParam) bool

CheckStaff check

func (*Service) CheckVideo

func (s *Service) CheckVideo(vps []*archive.VideoParam) bool

CheckVideo check video

func (*Service) Close

func (s *Service) Close()

Close consumer close.

func (*Service) DelPolices

func (s *Service) DelPolices(c *bm.Context, uid, gid int64, ids []int64) (err error)

DelPolices soft delete policies

func (*Service) DelVideo

func (s *Service) DelVideo(c context.Context, vp *archive.VideoParam) (err error)

DelVideo delete archive_video.

func (*Service) DelWeightConf

func (s *Service) DelWeightConf(c context.Context, id int64) (err error)

DelWeightConf 删除配置项

func (*Service) Delay

func (s *Service) Delay(c context.Context, id, uid int64, reason string) (err error)

Delay 申请延迟

func (*Service) EditHistory

func (s *Service) EditHistory(c context.Context, hid int64) (h *archive.EditHistory, err error)

EditHistory 根据稿件的某条编辑历史id,获取当时完整的稿件、分p视频编辑历史

func (*Service) Free

func (s *Service) Free(c context.Context, uid int64) (rows int64)

Free 任务释放(有uid为主动释放,没有uid为被动释放)(先查再释放,有可能记录冗余释放信息)

func (*Service) GetChannelInfo

func (s *Service) GetChannelInfo(c context.Context, aids []int64) (info map[int64]*archive.ChannelInfo, err error)

GetChannelInfo get channel info & hit_rules & need review

func (*Service) GetUID

func (s *Service) GetUID(c context.Context, name string) (uid int64, err error)

GetUID 获取uid,有时候cookie没有uid

func (*Service) HandsOff

func (s *Service) HandsOff(c context.Context, uid int64, fuid int64) (err error)

HandsOff 签出

func (*Service) HandsUp

func (s *Service) HandsUp(c context.Context, uid int64, uname string) (err error)

HandsUp 签入

func (*Service) HitFlowGroups

func (s *Service) HitFlowGroups(c context.Context, oid int64, includePools []int8) (res map[string]int, err error)

HitFlowGroups 命中哪些指定的流量套餐

func (*Service) InOutList

func (s *Service) InOutList(c context.Context, unames string, bt, et string) (l []*archive.InQuit, err error)

InOutList 用户登入登出历史

func (*Service) Info

func (s *Service) Info(c context.Context, tid int64) (task *archive.Task, err error)

Info 查询任务信息

func (*Service) KneadArchiveResult

func (s *Service) KneadArchiveResult(c *bm.Context, result *search.ArchiveResultData, p *search.ArchiveParams, additMap map[int64]*archive.Addit) (err error)

KneadArchiveResult 拼接稿件数据

func (*Service) List

func (s *Service) List(c context.Context, uid int64, pn, ps int, ltype, leader int8) (tasks []*archive.Task, err error)

List 查看任务列表

func (*Service) ListWeightConf

func (s *Service) ListWeightConf(c context.Context, v *archive.Confs) (cfg []*archive.WCItem, err error)

ListWeightConf 列出配置

func (*Service) ListWeightLogs

func (s *Service) ListWeightLogs(c context.Context, taskid int64, page int) (cfg []*archive.TaskWeightLog, items int64, err error)

ListWeightLogs 权重变更日志

func (*Service) LockByPGC

func (s *Service) LockByPGC(c context.Context, aid int64) (err error)

LockByPGC update pgc archive state to StateForbidLock.

func (*Service) MaxWeight

func (s *Service) MaxWeight(c context.Context) (max int64, err error)

MaxWeight 当前的权重最大值, 供用户配置做参考

func (*Service) ModifyByPGC

func (s *Service) ModifyByPGC(c context.Context, aid int64, gid int64, attrs map[uint]int32, redirectURL string) (err error)

ModifyByPGC update pgc archive attributes.

func (*Service) MoniStayOids

func (s *Service) MoniStayOids(c context.Context, tp, bid int8, id int64) (total int, oidMap map[int64]int, qualiKeys []string, err error)

MoniStayOids 获取监控范围内,滞留的oids

func (*Service) MonitorCheckVideoStatus

func (s *Service) MonitorCheckVideoStatus(c context.Context, tp int8, id int64) (err error)

MonitorCheckVideoStatus 检查视频的稿件状态,如果是-100则剔除SortedSet的数据

func (*Service) MonitorNotifyResult

func (s *Service) MonitorNotifyResult(c context.Context) (res []*monitor.RuleResultData, err error)

MonitorNotifyResult 获取达到了报警阀值的数据

func (*Service) MonitorResult

func (s *Service) MonitorResult(c context.Context, p *monitor.RuleResultParams) (res []*monitor.RuleResultData, err error)

MonitorResult 获取监控业务的统计结果列表

func (*Service) MonitorRuleUpdate

func (s *Service) MonitorRuleUpdate(c context.Context, rule *monitor.Rule) (err error)

MonitorRuleUpdate 更新监控规则

func (*Service) MonitorStats

func (s *Service) MonitorStats(c context.Context, rule *monitor.Rule) (stats *monitor.Stats, err error)

MonitorStats 根据business和rule获取统计结果

func (*Service) MonitorStayOids

func (s *Service) MonitorStayOids(c context.Context, id int64) (oidMap map[int64]int, err error)

MonitorStayOids 获取监控范围内,滞留的oids

func (*Service) Next

func (s *Service) Next(c context.Context, uid int64) (task *archive.Task, err error)

Next 领取任务

func (*Service) Online

func (s *Service) Online(c context.Context) (cms []*archive.Consumers, err error)

Online 用户列表

func (*Service) PGCListLogic

func (s *Service) PGCListLogic(c *bm.Context, lnStr string, pState string, froms []int8, eReq *elastic.Request) (err error)

PGCListLogic PGC列表查询相关逻辑

func (*Service) PGCWhite

func (s *Service) PGCWhite(mid int64) bool

PGCWhite whether mid in pgcwhite list

func (*Service) PassByPGC

func (s *Service) PassByPGC(c context.Context, aid int64, gid int64, attrs map[uint]int32, redirectURL string, now time.Time) (err error)

PassByPGC update pgc archive state to StateOpen.

func (*Service) Ping

func (s *Service) Ping(c context.Context) (err error)

Ping check server ok.

func (*Service) PolicyGroups

func (s *Service) PolicyGroups(c *bm.Context, uid, groupID int64, gType, state int8, count, page int64, order, sort string) (data *oversea.PolicyGroupData, err error)

PolicyGroups get policy group

func (*Service) PolicyItems

func (s *Service) PolicyItems(c *bm.Context, gid int64) (items []*oversea.PolicyItem, err error)

PolicyItems get polices by group id

func (*Service) RuleQualifiedKeys

func (s *Service) RuleQualifiedKeys(c context.Context, rule *monitor.Rule) (qualiKeys []string, err error)

RuleQualifiedKeys 获取监控业务中符合监控条件的Redis key

func (*Service) SearchArchive

func (s *Service) SearchArchive(c *bm.Context, p *search.ArchiveParams) (result *search.ArchiveResultData, err error)

SearchArchive 稿件搜索列表

func (*Service) SearchCopyright

func (s *Service) SearchCopyright(c context.Context, kw string) (result *search.CopyrightResultData, err error)

SearchCopyright search video copyright

func (*Service) SearchVideo

func (s *Service) SearchVideo(c context.Context, p *search.VideoParams) (result *search.VideoResultData, err error)

SearchVideo search video

func (*Service) SendMusicLog

func (s *Service) SendMusicLog(c *bm.Context, clientType int, ap *music.LogParam) (err error)

SendMusicLog send to log archive music

func (*Service) SetWeightVC

func (s *Service) SetWeightVC(c context.Context, wvc *archive.WeightVC) (err error)

SetWeightVC 设置权重配置

func (*Service) ShowWeightVC

func (s *Service) ShowWeightVC(c context.Context) (wvc *archive.WeightVC, err error)

ShowWeightVC 展示权重配置值

func (*Service) SplitInts

func (s *Service) SplitInts(str string) ([]int64, error)

SplitInts 去掉id字符串中的空白字符

func (*Service) StaffApplyBatchSubmit

func (s *Service) StaffApplyBatchSubmit(c context.Context, ap *archive.StaffBatchParam) (err error)

StaffApplyBatchSubmit func

func (*Service) Staffs

func (s *Service) Staffs(c context.Context, aid int64) (data []*archive.Staff, err error)

Staffs fn

func (*Service) StatsPoints

func (s *Service) StatsPoints(c context.Context, stime, etime time.Time, typeInt int8) (points []*archive.StatsPoint, err error)

StatsPoints get stats point

func (*Service) Submit

func (s *Service) Submit(c context.Context, ap *archive.ArcParam) (err error)

Submit second_round submit,update archive_addit\archive_delay\archive.

func (*Service) TaskSubmit

func (s *Service) TaskSubmit(c context.Context, id int64, uid int64, status int64) (err error)

TaskSubmit 提交审核结果

func (*Service) TaskTooksByHalfHour

func (s *Service) TaskTooksByHalfHour(c context.Context, stime, etime time.Time) (tooks []*archive.TaskTook, err error)

TaskTooksByHalfHour get task books by ctime

func (*Service) TrackArchive

func (s *Service) TrackArchive(c context.Context, aid int64) (archive []*track.Archive, err error)

TrackArchive get archive list.

func (*Service) TrackArchiveInfo

func (s *Service) TrackArchiveInfo(c context.Context, aid int64) (info *track.ArcTrackInfo, err error)

TrackArchiveInfo 稿件信息追踪

func (*Service) TrackHistoryDetail

func (s *Service) TrackHistoryDetail(c context.Context, hid int64) (h *archive.EditHistory, err error)

TrackHistoryDetail 稿件某条编辑历史的详细情况

func (*Service) TrackVideo

func (s *Service) TrackVideo(c context.Context, filename string, aid int64) (video []*track.Video, err error)

TrackVideo get video process.

func (*Service) TxUpArchiveAttr

func (s *Service) TxUpArchiveAttr(c context.Context, tx *sql.Tx, a *archive.Archive, aid, uid int64, attrs map[uint]int32, forbidAttrs map[string]map[uint]int32, redirectURL string) (conts []string, err error)

TxUpArchiveAttr update archive attr by aid.

func (*Service) TxUpPorder

func (s *Service) TxUpPorder(tx *sql.Tx, ap *archive.ArcParam) (err error)

TxUpPorder .

func (*Service) TypeTopParent

func (s *Service) TypeTopParent(tid int16) (tp *archive.Type, err error)

TypeTopParent get archive type's first level type

func (*Service) UpAccess

func (s *Service) UpAccess(c context.Context, ap *archive.ArcParam) (err error)

UpAccess update access.

func (*Service) UpArcDtime

func (s *Service) UpArcDtime(c context.Context, aid int64, dtime time.Time) (err error)

UpArcDtime update archive dtime by aid.

func (*Service) UpArcTag

func (s *Service) UpArcTag(c context.Context, uid int64, pm *archive.TagParam) (err error)

UpArcTag 保存tag

func (*Service) UpArchiveAttr

func (s *Service) UpArchiveAttr(c context.Context, aid, uid int64, attrs map[uint]int32, forbidAttrs map[string]map[uint]int32, redirectURL string) (err error)

UpArchiveAttr update archive attr by aid.

func (*Service) UpAuther

func (s *Service) UpAuther(c context.Context, ap *archive.ArcParam) (err error)

UpAuther update owner.

func (*Service) UpVideo

func (s *Service) UpVideo(c context.Context, vp *archive.VideoParam) (err error)

UpVideo update archive_video title && desc

func (s *Service) UpWebLink(c context.Context, vp *archive.VideoParam) (err error)

UpWebLink update archive_video weblink

func (*Service) UpdatePolicyGroup

func (s *Service) UpdatePolicyGroup(c *bm.Context, id int64, attrs map[string]interface{}) (err error)

UpdatePolicyGroup update policy group

func (*Service) UpdatePolicyGroups

func (s *Service) UpdatePolicyGroups(c *bm.Context, ids []int64, attrs map[string]interface{}) (err error)

UpdatePolicyGroups multi update policy group

func (*Service) VideoAudit

func (s *Service) VideoAudit(c context.Context, vp *archive.VideoParam, attrs map[uint]int32) (err error)

VideoAudit upload first_round info.

Jump to

Keyboard shortcuts

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