40 lines
1.7 KiB
Python
40 lines
1.7 KiB
Python
"""
|
||
配置表模型
|
||
"""
|
||
|
||
from sqlalchemy import Column, Integer, String, Text, DateTime, func, SmallInteger
|
||
from sqlalchemy.ext.declarative import declarative_base
|
||
|
||
Base = declarative_base()
|
||
|
||
|
||
class SurConfig(Base):
|
||
"""配置表"""
|
||
__tablename__ = "sur_config"
|
||
|
||
id = Column(Integer, primary_key=True, index=True)
|
||
scope = Column(SmallInteger, nullable=False, comment="作用域:0=全局,1=房间,2=摄像头")
|
||
target_id = Column(Integer, comment="根据作用域,摄像头id或房间id或其他")
|
||
description = Column(Text, comment="描述")
|
||
created_time = Column(DateTime, default=func.now(), comment="创建时间")
|
||
updated_time = Column(DateTime, default=func.now(), comment="更新时间")
|
||
created_by = Column(Integer, comment="创建人")
|
||
updated_by = Column(Integer, comment="更新人")
|
||
config_type = Column(SmallInteger, nullable=False, comment="配置类型:0=人脸识别")
|
||
config_group_id = Column(Integer, comment="配置组id")
|
||
|
||
|
||
class SurConfigBase(Base):
|
||
"""配置基础表"""
|
||
__tablename__ = "sur_config_base"
|
||
|
||
id = Column(Integer, primary_key=True, index=True)
|
||
config_type = Column(SmallInteger, 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="修改人") |