service/dbstruct/imageaudittask.go

39 lines
2.9 KiB
Go
Raw Normal View History

2023-12-21 22:17:40 +08:00
package dbstruct
2024-02-07 12:07:28 +08:00
import (
"service/bizcommon/util"
)
2023-12-21 22:17:40 +08:00
type ImageAuditTask struct {
Id *string `json:"id" bson:"_id"` // 图像审核任务表id
AuditedMedia *MediaComponent `json:"audited_media" bson:"audited_media"` // 待审核媒体内容(图像)
OldMedia *MediaComponent `json:"old_media" bson:"old_media"` // 旧媒体内容
RouteUrl *string `json:"route_url" bson:"route_url"` // 路由URL
AssociativeDatabase *string `json:"associative_database" bson:"associative_database"` // 关联数据库
AssociativeTableName *string `json:"associative_table_name" bson:"associative_table_name"` // 关联表名
AssociativeTableId *int64 `json:"associative_table_id" bson:"associative_table_id"` // 关联表主键ID
AssociativeTableColumn *string `json:"associative_table_column" bson:"associative_table_column"` // 关联表字段
BatchId *string `json:"batch_id" bson:"batch_id"` // 批次号
IsFragmented *int64 `json:"is_fragmented" bson:"is_fragmented"` // 是否分片
FragmentsNum *int64 `json:"fragments_num" bson:"fragments_num"` // 分片数量
ImageAuditId *string `json:"image_audit_id" bson:"image_audit_id"` // 图像审核表id(未分片时通过该id关联图像审核表)
ImageAuditFragmentIds *[]string `json:"image_audit_fragment_ids" bson:"image_audit_fragment_ids"` // 图像审核表分片id(分片时通过该id关联图像审核表)
2024-02-07 12:07:28 +08:00
IsAligned *int64 `json:"is_aligned" bson:"is_aligned"` // 是否已经对齐(详见consts->status->aligned)
2023-12-21 22:17:40 +08:00
Status *int64 `json:"status" bson:"status"` // 审核状态
Remarks *string `json:"remarks" bson:"remarks"` // 备注
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
2024-04-11 21:51:46 +08:00
AuditedMediaResults []bool // 每个任务是否审核通过
ImageAudits []*ImageAudit // 每个任务的结果
2023-12-21 22:17:40 +08:00
}
func (p *ImageAuditTask) IsEmpty() bool {
if p == nil {
return true
}
return p.Id == nil || p.AuditedMedia.IsEmpty() || util.DerefString(p.AssociativeDatabase) == "" || util.DerefString(p.AssociativeTableName) == "" ||
p.AssociativeTableId == nil || util.DerefString(p.AssociativeTableColumn) == ""
}