27 lines
1.0 KiB
Python
27 lines
1.0 KiB
Python
#!/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 pydantic import BaseModel, Field, ConfigDict
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
|
|
|
|
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_time: Optional[datetime] = Field(None, description="上传时间")
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|