from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
from typing import Optional
from module_admin.annotation.pydantic_annotation import as_query




class Robot_actionModel(BaseModel):
    """
    机器人动作表对应pydantic模型
    """
    model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)

    id: Optional[int] = Field(default=None, description='主键 自增')
    name: Optional[str] = Field(default=None, description='动作名')
    description: Optional[str] = Field(default=None, description='描述')
    interval_min: Optional[int] = Field(default=None, description='最小时间间隔 单位s')
    interval_max: Optional[int] = Field(default=None, description='最大时间间隔 单位s')
    status: Optional[str] = Field(default=None, description='动作状态 0 未启用, 1已启用')
    update_time: Optional[datetime] = Field(default=None, description='修改时间')






class Robot_actionQueryModel(Robot_actionModel):
    """
    机器人动作不分页查询模型
    """
    begin_update_time: Optional[str] = Field(default=None, description='开始修改时间')
    end_update_time: Optional[str] = Field(default=None, description='结束修改时间')


@as_query
class Robot_actionPageQueryModel(Robot_actionQueryModel):
    """
    机器人动作分页查询模型
    """

    page_num: int = Field(default=1, description='当前页码')
    page_size: int = Field(default=20, description='每页记录数')


class DeleteRobot_actionModel(BaseModel):
    """
    删除机器人动作模型
    """

    model_config = ConfigDict(alias_generator=to_camel)

    ids: str = Field(description='需要删除的主键 自增')
