service/library/contentaudit/video_moderation/video_moderation_action.go

29 lines
844 B
Go
Raw Normal View History

2024-04-26 10:46:37 +08:00
package videomoderation
// 图像审核动作,由定时任务间隔内对同一数据库-表-单个元素-某字段产生的审核任务的操作构成
type VideoModerationAction struct {
// 静态元素
TaskNum int // 任务数量
TaskChain []*VideoModerationTaskControlBlock // 任务链
// 动态元素
AuditedTaskNum int // 已完成审核的任务数量
}
func NewVideoModerationAction() *VideoModerationAction {
return &VideoModerationAction{
TaskNum: 0,
TaskChain: make([]*VideoModerationTaskControlBlock, 0),
AuditedTaskNum: 0,
}
}
func (s *VideoModerationAction) Record(tcb *VideoModerationTaskControlBlock) {
s.TaskChain = append(s.TaskChain, tcb)
s.TaskNum++
}
func (s *VideoModerationAction) IsPassed() bool {
return s.TaskChain[len(s.TaskChain)-1].IsTaskPassed
}