项目基础模块代码

This commit is contained in:
2025-02-19 16:57:49 +08:00
parent 31302bcd17
commit bed123c532
14 changed files with 159 additions and 57 deletions

View File

@ -1,5 +1,5 @@
from app.db.db_base import DbCommon
from sqlalchemy import String, Integer
from sqlalchemy import String, Integer, JSON
from sqlalchemy.orm import Mapped, mapped_column
@ -8,35 +8,36 @@ class ProjectType(DbCommon):
项目类别表 - 标识项目的类型目前存在的目标识别OCR识别瑕疵检测图像分类
"""
__tablename__ = "project_type"
type_code = Mapped[str] = mapped_column(String(20), unique=True, nullable=False)
type_name = Mapped[str] = mapped_column(String(20))
icon_path = Mapped[str] = mapped_column(String(255))
description = Mapped[str] = mapped_column(String(255))
type_status = Mapped[str] = mapped_column(String(10))
type_code: Mapped[str] = mapped_column(String(20), unique=True, nullable=False)
type_name: Mapped[str] = mapped_column(String(20))
icon_path: Mapped[str] = mapped_column(String(255))
description: Mapped[str] = mapped_column(String(255))
type_status: Mapped[str] = mapped_column(String(10))
class ProjectInfo(DbCommon):
"""项目信息表"""
__tablename__ = "project_info"
project_no = Mapped[str] = mapped_column(String(32), unique=True, nullable=False)
project_name = Mapped[str] = mapped_column(String(32), unique=True, nullable=False)
type_code = Mapped[str] = mapped_column(String(10))
description = Mapped[str] = mapped_column(String(255))
project_status = Mapped[str] = mapped_column(String(10))
user_id = Mapped[int] = mapped_column(Integer)
train_version = Mapped[int] = mapped_column(Integer)
project_no: Mapped[str] = mapped_column(String(32), unique=True, nullable=False)
project_name: Mapped[str] = mapped_column(String(32), unique=True, nullable=False)
type_code: Mapped[str] = mapped_column(String(10))
description: Mapped[str] = mapped_column(String(255))
project_status: Mapped[str] = mapped_column(String(10))
user_id: Mapped[int] = mapped_column(Integer)
train_version: Mapped[int] = mapped_column(Integer)
class ProjectLabel(DbCommon):
"""项目标签表"""
__tablename__ = "project_label"
label_name = Mapped[str] = mapped_column(String(32), unique=True, nullable=False)
project_id = Mapped[int] = mapped_column(Integer, nullable=False)
label_name: Mapped[str] = mapped_column(String(32), unique=True, nullable=False)
project_id: Mapped[int] = mapped_column(Integer, nullable=False)
meta: Mapped[dict] = mapped_column(JSON)
class ProjectImage(DbCommon):
"""项目图片表"""
__tablename__ = "project_image"
image_url = Mapped[str] = mapped_column(String(255), nullable=False)
thumb_image_url = Mapped[str] = mapped_column(String(255), nullable=False)
project_id = Mapped[int] = mapped_column(Integer)
image_url: Mapped[str] = mapped_column(String(255), nullable=False)
thumb_image_url: Mapped[str] = mapped_column(String(255), nullable=False)
project_id: Mapped[int] = mapped_column(Integer)