55 lines
2.3 KiB
Python
55 lines
2.3 KiB
Python
"""
|
||
视频检查任务模型
|
||
"""
|
||
|
||
from datetime import datetime
|
||
from typing import Optional, Dict, Any
|
||
from sqlalchemy import Column, Integer, String, DateTime, Text, JSON
|
||
from sqlalchemy.ext.declarative import declarative_base
|
||
|
||
Base = declarative_base()
|
||
|
||
|
||
class SurVideoCheckTask(Base):
|
||
"""视频检查任务表"""
|
||
__tablename__ = "sur_video_check_task"
|
||
|
||
id = Column(Integer, primary_key=True, comment="主键")
|
||
video_id_list = Column(Text, comment="视频id list,用,分隔")
|
||
target_video_id = Column(Text, comment="被查询人员所在video id")
|
||
config_id = Column(Integer, comment="配置id")
|
||
feature_data = Column(Text, comment="特征向量")
|
||
status = Column(Integer, comment="任务状态:0=等待,1=正在处理,2=完成,3=取消,5=失败")
|
||
progress = Column(Integer, default=0, comment="进度,1000满")
|
||
result = Column(Integer, comment="结果:0=未出结果,1=找到,2=未找到")
|
||
result_data = Column(JSON, comment="结果数据")
|
||
created_time = Column(DateTime, default=datetime.now, comment="创建时间")
|
||
created_by = Column(Integer, comment="创建人")
|
||
start_time = Column(DateTime, comment="任务开始时间")
|
||
finish_time = Column(DateTime, comment="任务结束时间")
|
||
|
||
|
||
class SurVideo(Base):
|
||
"""视频表"""
|
||
__tablename__ = "sur_video"
|
||
|
||
id = Column(Integer, primary_key=True, comment="主键")
|
||
video_name = Column(Text, comment="文件名")
|
||
created_time = Column(DateTime, default=datetime.now, comment="创建时间")
|
||
video_name_on_server = Column(Text, comment="服务器上的文件名")
|
||
|
||
|
||
class SurConfigBase(Base):
|
||
"""配置基础表"""
|
||
__tablename__ = "sur_config_base"
|
||
|
||
id = Column(Integer, primary_key=True, comment="主键")
|
||
config_type = Column(Integer, nullable=False, comment="配置类型:0=人脸识别")
|
||
group_id = Column(Integer, nullable=False, comment="组id")
|
||
config_key = Column(Text, nullable=False, comment="键")
|
||
config_value = Column(Text, comment="值")
|
||
description = Column(Text, comment="备注")
|
||
created_time = Column(DateTime, comment="创建时间")
|
||
updated_time = Column(DateTime, comment="修改时间")
|
||
created_by = Column(Integer, comment="创建人")
|
||
updated_by = Column(Integer, comment="修改人") |