项目初次提交
This commit is contained in:
5
apps/business/project/schemas/__init__.py
Normal file
5
apps/business/project/schemas/__init__.py
Normal file
@ -0,0 +1,5 @@
|
||||
from .project_info import ProjectInfoIn, ProjectInfoOut, ProjectInfoPagerOut
|
||||
from .project_image import ProjectImage, ProjectImagePager, ProjectImageOut
|
||||
from .project_label import ProjectLabel
|
||||
from .project_img_label import ProjectImgLabelIn
|
||||
from .project_img_leafer import ProjectImgLeaferLabel, ProjectImgLeaferOut
|
38
apps/business/project/schemas/project_image.py
Normal file
38
apps/business/project/schemas/project_image.py
Normal file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @version : 1.0
|
||||
# @Create Time : 2025/04/03 10:27
|
||||
# @File : project_image.py
|
||||
# @IDE : PyCharm
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from core.data_types import DatetimeStr
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ProjectImage(BaseModel):
|
||||
id: Optional[int] = Field(None, description="id")
|
||||
project_id: Optional[int] = Field(..., description="项目id")
|
||||
img_type: Optional[str] = Field(None, description="图片类别")
|
||||
file_name: Optional[str] = Field(None, description="文件名称")
|
||||
create_time: DatetimeStr
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class ProjectImageOut(BaseModel):
|
||||
id: Optional[int] = Field(None, description="id")
|
||||
project_id: Optional[int] = Field(..., description="项目id")
|
||||
file_name: Optional[str] = Field(None, description="文件名称")
|
||||
create_time: DatetimeStr
|
||||
label_count: Optional[int]
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class ProjectImagePager(BaseModel):
|
||||
project_id: Optional[int] = Field(..., description="项目id")
|
||||
img_type: Optional[str] = Field(None, description="图片类别")
|
||||
pagerNum: Optional[int] = Field(None, description="当前页码")
|
||||
pagerSize: Optional[int] = Field(None, description="每页数量")
|
18
apps/business/project/schemas/project_img_label.py
Normal file
18
apps/business/project/schemas/project_img_label.py
Normal file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @version : 1.0
|
||||
# @Create Time : 2025/04/03 10:29
|
||||
# @File : project_img_label.py
|
||||
# @IDE : PyCharm
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ProjectImgLabelIn(BaseModel):
|
||||
label_id: int
|
||||
mark_center_x: str
|
||||
mark_center_y: str
|
||||
mark_width: str
|
||||
mark_height: str
|
||||
|
25
apps/business/project/schemas/project_img_leafer.py
Normal file
25
apps/business/project/schemas/project_img_leafer.py
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @version : 1.0
|
||||
# @Create Time : 2025/04/03 10:29
|
||||
# @File : project_img_leafer.py
|
||||
# @IDE : PyCharm
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from typing import Optional, List
|
||||
|
||||
from . import ProjectImgLabelIn
|
||||
|
||||
|
||||
class ProjectImgLeaferLabel(BaseModel):
|
||||
image_id: Optional[int] = Field(..., description="图片id")
|
||||
leafer: Optional[dict] = Field(..., description="保存的leafer")
|
||||
label_infos: List[ProjectImgLabelIn] = Field(..., description="标签框选信息")
|
||||
|
||||
|
||||
class ProjectImgLeaferOut(BaseModel):
|
||||
image_id: Optional[int] = Field(..., description="图片id")
|
||||
leafer: Optional[dict] = Field(..., description="保存的leafer")
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
47
apps/business/project/schemas/project_info.py
Normal file
47
apps/business/project/schemas/project_info.py
Normal file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @version : 1.0
|
||||
# @Create Time : 2025/04/03 10:25
|
||||
# @File : project_info.py
|
||||
# @IDE : PyCharm
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ProjectInfoIn(BaseModel):
|
||||
"""项目信息输入"""
|
||||
project_name: Optional[str] = Field(..., description="项目名称")
|
||||
type_code: Optional[str] = Field(..., description="项目类型编码")
|
||||
description: Optional[str] = Field(None, description="项目描述")
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class ProjectInfoOut(BaseModel):
|
||||
"""项目信息输出"""
|
||||
id: Optional[int] = Field(None, description="项目id")
|
||||
project_no: Optional[str] = Field(..., description="项目编号")
|
||||
project_name: Optional[str] = Field(..., description="项目名称")
|
||||
type_code: Optional[str] = Field(..., description="项目类型编码")
|
||||
description: Optional[str] = Field(None, description="项目描述")
|
||||
train_version: Optional[int] = Field(None, description="训练版本号")
|
||||
project_status: Optional[str] = Field(None, description="项目状态")
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class ProjectInfoPagerOut(BaseModel):
|
||||
"""项目信息输出"""
|
||||
id: Optional[int] = Field(None, description="项目id")
|
||||
project_no: Optional[str] = Field(None, description="项目编号")
|
||||
project_name: Optional[str] = Field(None, description="项目名称")
|
||||
type_code: Optional[str] = Field(None, description="项目类型编码")
|
||||
description: Optional[str] = Field(None, description="项目描述")
|
||||
train_version: Optional[int] = Field(None, description="训练版本号")
|
||||
project_status: Optional[str] = Field(None, description="项目状态")
|
||||
mark_count: Optional[int] = Field(0, description="已标记数量")
|
||||
no_mark_count: Optional[int] = Field(0, description="未标记数量")
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
20
apps/business/project/schemas/project_label.py
Normal file
20
apps/business/project/schemas/project_label.py
Normal file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @version : 1.0
|
||||
# @Create Time : 2025/04/03 10:28
|
||||
# @File : project_label.py
|
||||
# @IDE : PyCharm
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ProjectLabel(BaseModel):
|
||||
"""项目标签输入输出"""
|
||||
id: Optional[int] = Field(None, description="id")
|
||||
project_id: Optional[int] = Field(None, description="项目id")
|
||||
label_name: Optional[str] = Field(..., description="标签名称")
|
||||
meta: Optional[dict] = Field(None, description="label属性")
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
Reference in New Issue
Block a user