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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao is redis dao.

func New

func New(c *conf.Config) (d *Dao)

New new a dao.

func (*Dao) AddArchiveOper

func (d *Dao) AddArchiveOper(c context.Context, aid int64, attribute int32, typeid int16, state int, round int8, lastID int64, content, remark string) (id int64, err error)

AddArchiveOper add archive operate log

func (*Dao) AddDispatch

func (d *Dao) AddDispatch(c context.Context, t *task.Task) (lastID int64, err error)

AddDispatch add task dispatch

func (*Dao) AddRecheckAids

func (d *Dao) AddRecheckAids(c context.Context, tp int, aids []int64, ignRechecked bool) (err error)

AddRecheckAids add recheck aids

func (*Dao) AddTaskHis

func (d *Dao) AddTaskHis(c context.Context, pool int8, action int8, taskID int64, cid int64, uid int64, result int16, reason string) (rows int64, err error)

AddTaskHis add task oper history

func (*Dao) AddTaskTook

func (d *Dao) AddTaskTook(c context.Context, took *archive.TaskTook) (lastID int64, err error)

AddTaskTook add TaskTook

func (*Dao) AddTrack

func (d *Dao) AddTrack(c context.Context, aid int64, state int, round int8, attr int32, remark string, ctime, mtime string) (rows int64, err error)

AddTrack insert archive track history

func (*Dao) AddVideoTrack

func (d *Dao) AddVideoTrack(c context.Context, aid int64, filename string, status int16, xcodeState int8, remark string, ctime, mtime string) (rows int64, err error)

AddVideoTrack insert video track history

func (*Dao) Addit

func (d *Dao) Addit(c context.Context, aid int64) (addit *archive.Addit, err error)

Addit get archive addit.

func (*Dao) Addits

func (d *Dao) Addits(c context.Context, aids []int64) (addits map[int64]*archive.Addit, err error)

Addits batch get archive addit.

func (*Dao) ArchiveByAid

func (d *Dao) ArchiveByAid(c context.Context, aid int64) (arc *archive.Archive, err error)

ArchiveByAid get archive by aid

func (*Dao) ArchiveNote

func (d *Dao) ArchiveNote(c context.Context, aid int64) (note string, err error)

ArchiveNote 稿件审核的备注字段,可能为NIL

func (*Dao) AssignConfigs

func (d *Dao) AssignConfigs(c context.Context) (tasks map[int64]*tmod.AssignConfig, err error)

AssignConfigs take config

func (*Dao) AuditTypesConf

func (d *Dao) AuditTypesConf(c context.Context) (atps map[int16]struct{}, err error)

AuditTypesConf get audit conf

func (*Dao) BeginTran

func (d *Dao) BeginTran(c context.Context) (tx *sql.Tx, err error)

BeginTran begin transcation.

func (*Dao) Close

func (d *Dao) Close()

Close close dao.

func (*Dao) ConsumerOnline

func (d *Dao) ConsumerOnline(c context.Context, uids string) (ids []int64, err error)

ConsumerOnline get online task_consumer

func (*Dao) DelAssignConfs

func (d *Dao) DelAssignConfs(c context.Context, ids []int64) (rows int64, err error)

DelAssignConfs 删除指派配置

func (*Dao) DelDispatch

func (d *Dao) DelDispatch(c context.Context, aid, cid int64) (rows int64, err error)

DelDispatch del dispatch.

func (*Dao) DelDispatchByAid

func (d *Dao) DelDispatchByAid(c context.Context, aid int64) (rows int64, err error)

DelDispatchByAid del dispatch by aid.

func (*Dao) DelTaskBefore

func (d *Dao) DelTaskBefore(c context.Context, before time.Time, limit int64) (rows int64, err error)

DelTaskBefore del task_dispatch

func (*Dao) DelTaskDoneBefore

func (d *Dao) DelTaskDoneBefore(c context.Context, before time.Time, limit int64) (rows int64, err error)

DelTaskDoneBefore del task_dispatch_done

func (*Dao) DelTaskExtend

func (d *Dao) DelTaskExtend(c context.Context, before time.Time, limit int64) (rows int64, err error)

DelTaskExtend del task_dispatch_extend

func (*Dao) DelTaskHistoryDone

func (d *Dao) DelTaskHistoryDone(c context.Context, before time.Time, limit int64) (rows int64, err error)

DelTaskHistoryDone del oper done

func (*Dao) DelWeightConfs

func (d *Dao) DelWeightConfs(c context.Context, ids []int64) (rows int64, err error)

DelWeightConfs 删除权重配置

func (*Dao) Delay

func (d *Dao) Delay(c context.Context, aid int64) (delay *archive.Delay, err error)

Delay get delay by aid

func (*Dao) DispatchState

func (d *Dao) DispatchState(c context.Context, aid, cid int64) (id int64, state int8, err error)

DispatchState get dipatch state.

func (*Dao) ExcitationArchivesByTime

func (d *Dao) ExcitationArchivesByTime(c context.Context, mid int64, bt, et time.Time) (archives []*archive.Archive, err error)

ExcitationArchivesByTime 获取Up主过审的自制稿件

func (*Dao) FlowUnique

func (d *Dao) FlowUnique(c context.Context, oid, groupID int64, pool int8) (f *archive.FlowData, err error)

FlowUnique 获取命中 指定流量套餐的记录 return *archive.FlowData/nil, error/nil

func (*Dao) GetTaskWeight

func (d *Dao) GetTaskWeight(c context.Context, lastid int64) (mcases map[int64]*task.WeightParams, err error)

GetTaskWeight 从数据库读取权重配置

func (*Dao) HasFlowGroup

func (d *Dao) HasFlowGroup(c context.Context, pool int, gid, oid int64) (has bool, err error)

HasFlowGroup check if has flow group record

func (*Dao) InDispatchExtend

func (d *Dao) InDispatchExtend(c context.Context, taskid int64, desc string) (lastid int64, err error)

InDispatchExtend 扩展表,记录权重配置信息

func (*Dao) LastArcOper

func (d *Dao) LastArcOper(c context.Context, aid int64) (re *archive.Oper, err error)

LastArcOper get a archive last history.

func (*Dao) LastRoundOper

func (d *Dao) LastRoundOper(c context.Context, aid int64, round int8) (oper *archive.Oper, err error)

LastRoundOper get last archive round record.

func (*Dao) LastVideoOper

func (d *Dao) LastVideoOper(c context.Context, vid int64) (oper *archive.VideoOper, err error)

LastVideoOper get the last manual-operate record by vid

func (*Dao) LastVideoOperUID

func (d *Dao) LastVideoOperUID(c context.Context, vid int64) (uid int64, err error)

LastVideoOperUID get the last manual-operate operator id by vid

func (*Dao) NewVideo

func (d *Dao) NewVideo(c context.Context, filename string) (v *archive.Video, err error)

NewVideo get video info by filename.

func (*Dao) NextRoundOper

func (d *Dao) NextRoundOper(c context.Context, id int64, aid int64, round int8) (oper *archive.Oper, err error)

NextRoundOper get next archive round record.

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) (err error)

Ping ping cpdb

func (*Dao) RecheckByAid

func (d *Dao) RecheckByAid(c context.Context, tp int, aid int64) (recheck *archive.Recheck, err error)

RecheckByAid find archive recheck

func (*Dao) ReportAdd

func (d *Dao) ReportAdd(c context.Context, typeid int8, content string, ctime, mtime time.Time) (lastID int64, err error)

ReportAdd report add of typeid

func (*Dao) ReportLast

func (d *Dao) ReportLast(c context.Context, typeid int8) (report *archive.Report, err error)

ReportLast get last inserted report

func (*Dao) Reports

func (d *Dao) Reports(c context.Context, typeid int8, stime, etime time.Time) (reports []*archive.Report, err error)

Reports report get of typeid

func (*Dao) SetUpSpecial

func (d *Dao) SetUpSpecial(c context.Context, taskid int64, special int8) (rows int64, err error)

SetUpSpecial 更新单条权重

func (*Dao) TaskByMtime

func (d *Dao) TaskByMtime(c context.Context, stime time.Time) (tasks []*archive.Task, err error)

TaskByMtime gets to took the task by mtime

func (*Dao) TaskByUntreated

func (d *Dao) TaskByUntreated(c context.Context) (tasks []*archive.Task, err error)

TaskByUntreated gets to took the task by untreated

func (*Dao) TaskDoneByMtime

func (d *Dao) TaskDoneByMtime(c context.Context, stime time.Time) (tasks []*archive.Task, err error)

TaskDoneByMtime gets to took the task done by mtime

func (*Dao) TaskIDforWeight

func (d *Dao) TaskIDforWeight(c context.Context, lastid int64) (ids []int64, last int64, err error)

TaskIDforWeight 获取需要更新权重的任务id(用于给redis批量读取)

func (*Dao) TaskTookByHalfHour

func (d *Dao) TaskTookByHalfHour(c context.Context) (took *archive.TaskTook, err error)

TaskTookByHalfHour get TaskTook by half hour

func (*Dao) TaskTooks

func (d *Dao) TaskTooks(c context.Context, stime time.Time) (tooks []*archive.TaskTook, err error)

TaskTooks gets TaskTook by ctime

func (*Dao) TaskTooksByHalfHour

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

TaskTooksByHalfHour get TaskTooks by half hour

func (*Dao) TxAddDispatchDone

func (d *Dao) TxAddDispatchDone(c context.Context, tx *sql.Tx, startTime, endTime time.Time) (rows int64, err error)

TxAddDispatchDone add task dispatch done

func (*Dao) TxAddFlow

func (d *Dao) TxAddFlow(tx *sql.Tx, pool int8, oid, uid, groupID int64, remark string) (id int64, err error)

TxAddFlow tx add flow_design.

func (*Dao) TxAddFlowLog

func (d *Dao) TxAddFlowLog(tx *sql.Tx, pool, action int8, oid, uid, groupID int64, remark string) (id int64, err error)

TxAddFlowLog tx add flow_design log.

func (*Dao) TxAddRecheckAID

func (d *Dao) TxAddRecheckAID(tx *sql.Tx, tp int, aid int64) (id int64, err error)

TxAddRecheckAID add recheck aid to db

func (*Dao) TxDelDispatchByTime

func (d *Dao) TxDelDispatchByTime(c context.Context, tx *sql.Tx, startTime, endTime time.Time) (rows int64, err error)

TxDelDispatchByTime del dispatch by time segment

func (*Dao) TxDelTaskOper

func (d *Dao) TxDelTaskOper(tx *sql.Tx, t time.Time, limit int64) (rows int64, err error)

TxDelTaskOper delete from task_oper_history before t.

func (*Dao) TxMoveTaskOperDone

func (d *Dao) TxMoveTaskOperDone(tx *sql.Tx, t time.Time, limit int64) (rows int64, err error)

TxMoveTaskOperDone select into from task_oper_history to task_oper_history_done before t.

func (*Dao) TxUpFlowState

func (d *Dao) TxUpFlowState(tx *sql.Tx, id int64, state int8) (rows int64, err error)

TxUpFlowState 更新pool!=1的流量套餐资源的状态 return int64, error/nil

func (*Dao) TxUpRecheckState

func (d *Dao) TxUpRecheckState(tx *sql.Tx, tp int, aid int64, state int8) (row int64, err error)

TxUpRecheckState update recheck state

func (*Dao) TypeMapping

func (d *Dao) TypeMapping(c context.Context) (rmap map[int16]*archive.Type, err error)

TypeMapping is second types opposite first types.

func (*Dao) UpTag

func (d *Dao) UpTag(c context.Context, aid int64, tags string) (rows int64, err error)

UpTag update archive tag

func (*Dao) UpTaskWeight

func (d *Dao) UpTaskWeight(c context.Context, taskid int64, weight int64) (rows int64, err error)

UpTaskWeight 更新单条权重

func (*Dao) UpdateMidRecheckState

func (d *Dao) UpdateMidRecheckState(c context.Context, tp int, mid int64, state int8) (err error)

UpdateMidRecheckState 设置某个UP主的未回查稿件回查状态

func (*Dao) UpdateRecheckState

func (d *Dao) UpdateRecheckState(c context.Context, tp int, aid int64, state int8) (err error)

UpdateRecheckState update recheck state

func (*Dao) UpdatedFilenames

func (d *Dao) UpdatedFilenames(c context.Context, stime, etime time.Time) (fns []string, err error)

UpdatedFilenames Get updated video's filename between stime and etime.

func (*Dao) VideoAuditNote

func (d *Dao) VideoAuditNote(c context.Context, vid int64) (note string, err error)

VideoAuditNote get note by vid

func (*Dao) Videos2

func (d *Dao) Videos2(c context.Context, aid int64) (vs []*archive.Video, err error)

Videos2 get videos by 2 table em.......

func (*Dao) WeightConf

func (d *Dao) WeightConf(c context.Context) (items []*tmod.ConfigItem, err error)

WeightConf 所有有效的配置(用于检测是否和以及有的配置冲突)

func (*Dao) WeightValueConf

func (d *Dao) WeightValueConf(c context.Context) (wvconf *task.WeightValueConf, err error)

WeightValueConf 权重数值配置

Jump to

Keyboard shortcuts

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