2025-04-11 08:54:28 +08:00
|
|
|
#!/usr/bin/python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# @version : 1.0
|
|
|
|
# @Create Time : 2025/04/03 10:30
|
|
|
|
# @File : project_detect.py
|
|
|
|
# @IDE : PyCharm
|
|
|
|
# @desc : pydantic 模型,用于数据库序列化操作
|
|
|
|
|
2025-04-22 10:11:44 +08:00
|
|
|
from core.data_types import DatetimeStr
|
|
|
|
|
2025-04-17 15:57:16 +08:00
|
|
|
from typing import Optional
|
2025-04-22 10:11:44 +08:00
|
|
|
from pydantic import BaseModel, Field, ConfigDict
|
2025-04-11 08:54:28 +08:00
|
|
|
|
|
|
|
|
2025-04-17 15:57:16 +08:00
|
|
|
class ProjectDetectIn(BaseModel):
|
|
|
|
project_id: Optional[int] = Field(..., description="项目id")
|
|
|
|
file_type: Optional[str] = Field('img', description="推理集合文件类别")
|
|
|
|
detect_name: Optional[str] = Field(..., description="推理集合名称")
|
|
|
|
rtsp_url: Optional[str] = Field(None, description="视频流地址")
|
2025-04-11 08:54:28 +08:00
|
|
|
|
|
|
|
|
2025-04-17 15:57:16 +08:00
|
|
|
class ProjectDetectPager(BaseModel):
|
|
|
|
project_id: Optional[int] = Field(..., description="项目id")
|
|
|
|
detect_name: Optional[str] = Field(None, description="推理集合名称")
|
|
|
|
pagerNum: Optional[int] = Field(1, description="当前页码")
|
|
|
|
pagerSize: Optional[int] = Field(10, description="每页数量")
|
|
|
|
|
2025-04-11 08:54:28 +08:00
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
2025-04-17 15:57:16 +08:00
|
|
|
|
|
|
|
class ProjectDetectOut(BaseModel):
|
|
|
|
id: Optional[int]
|
|
|
|
project_id: Optional[int]
|
|
|
|
detect_name: Optional[str]
|
|
|
|
detect_no: Optional[str]
|
|
|
|
detect_version: Optional[int]
|
|
|
|
file_type: Optional[str]
|
|
|
|
folder_url: Optional[str]
|
|
|
|
rtsp_url: Optional[str]
|
2025-04-22 10:11:44 +08:00
|
|
|
create_datetime: DatetimeStr
|
2025-04-17 15:57:16 +08:00
|
|
|
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectDetectList(BaseModel):
|
|
|
|
id: Optional[int]
|
|
|
|
file_type: Optional[str]
|
|
|
|
detect_name: Optional[str]
|
|
|
|
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|