from sqlalchemy import DateTime, String, BigInteger, CHAR, Column
from config.database import Base


class RobotInfo(Base):
    """
    机器人信息表
    """

    __tablename__ = 'robot_info'

    robot_id = Column(BigInteger, primary_key=True, autoincrement=True, nullable=False, comment='机器人ID')
    name = Column(String(32), nullable=False, comment='机器人名称')
    model = Column(String(32), nullable=True, comment='机器人型号')
    serial = Column(String(32), nullable=True, comment='序列号')
    online = Column(String(2), nullable=True, comment='机器人在线状态(0在线, 1离线)')
    power = Column(String(3), nullable=True, comment='电量')
    run_time = Column(BigInteger, nullable=True, comment='总运行时长（单位：分钟）')
    position = Column(String(32), nullable=True, comment='位置')
    image = Column(String(512), nullable=True, comment='机器人外观图地址')
    create_time = Column(DateTime, nullable=True, comment='创建时间')
    create_by = Column(String(64), nullable=True, comment='创建者')
    update_time = Column(DateTime, nullable=True, comment='修改时间')
    update_by = Column(String(64), nullable=True, comment='修改者')
    del_flag = Column(CHAR(1), nullable=False, comment='删除标志(0存在, 2删除)')
    remark = Column(String(512), nullable=True, comment='备注')
    last_charge = Column(DateTime, nullable=True, comment='上一次充电时间')
    ip = Column(String(16), nullable=True, comment='机器人ip')
    status = Column(String(2), nullable=False, comment='使用情况(0待机,1正在运行)')
    video_uri = Column(String(512), nullable=True, comment='视频uri')



