#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2025/04/03 10:30
# @File           : project_detect_file.py
# @IDE            : PyCharm
# @desc           : pydantic 模型，用于数据库序列化操作

from core.data_types import DatetimeStr

from typing import Optional
from pydantic import BaseModel, Field, ConfigDict


class ProjectDetectFilePager(BaseModel):
    detect_id: Optional[int] = Field(..., description="训练集合id")
    pagerNum: Optional[int] = Field(None, description="当前页码")
    pagerSize: Optional[int] = Field(None, description="每页数量")


class ProjectDetectFileOut(BaseModel):
    id: Optional[int] = Field(None, description="id")
    detect_id: Optional[int] = Field(..., description="训练集合id")
    file_name: Optional[str] = Field(None, description="文件名称")
    thumb_file_url: Optional[str] = Field(None, description="文件路径")
    create_datetime: DatetimeStr

    model_config = ConfigDict(from_attributes=True)
