prepare fastapi root layout for server deployment

This commit is contained in:
刘金宝
2026-06-04 10:55:23 +08:00
parent eb43573a44
commit b46e43aadc
103 changed files with 347 additions and 197 deletions
+22
View File
@@ -0,0 +1,22 @@
from __future__ import annotations
from sqlalchemy import BigInteger, Integer, String
from sqlalchemy.orm import Mapped, mapped_column
from app.db.base import Base
from app.models.mixins import TimestampMixin
BIGINT_PK = BigInteger().with_variant(Integer, "sqlite")
class Department(TimestampMixin, Base):
"""科室模型:使用用户端确定的 department 表字段。"""
__tablename__ = "department"
id: Mapped[int] = mapped_column(BIGINT_PK, primary_key=True, autoincrement=True, comment="科室ID")
name: Mapped[str] = mapped_column(String(100), nullable=False, comment="科室名称")
category: Mapped[str] = mapped_column(String(50), nullable=False, comment="科室分类")
institution_id: Mapped[int] = mapped_column(BigInteger, nullable=False, index=True, comment="所属机构ID")
__table_args__ = {"comment": "科室表"}