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 Identification_recordModel(BaseModel):
    """
    识别记录表对应pydantic模型
    """
    model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)

    id: Optional[int] = Field(default=None, description='主键 自增')
    person_name: Optional[str] = Field(default=None, description='识别人姓名')
    door_name: Optional[str] = Field(default=None, description='门禁点')
    status: Optional[str] = Field(default=None, description='识别结果, 0 拒绝, 1 通过')
    source: Optional[str] = Field(default=None, description='识别来源')
    pic_uri: Optional[str] = Field(default=None, description='图像url')
    create_time: Optional[datetime] = Field(default=None, description='创建时间')
    create_by: Optional[str] = Field(default=None, description='创建者')
    conf: Optional[int] = Field(default=None, description='识别置信度')
    person_status: Optional[str] = Field(default=None, description=' 0 陌生人, 1 员工')






class Identification_recordQueryModel(Identification_recordModel):
    """
    识别记录不分页查询模型
    """
    begin_create_time: Optional[str] = Field(default=None, description='开始创建时间')
    end_create_time: Optional[str] = Field(default=None, description='结束创建时间')


@as_query
class Identification_recordPageQueryModel(Identification_recordQueryModel):
    """
    识别记录分页查询模型
    """

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


class DeleteIdentification_recordModel(BaseModel):
    """
    删除识别记录模型
    """

    model_config = ConfigDict(alias_generator=to_camel)

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