refactor(backend): 迁移基础设施,core,拆分models

This commit is contained in:
sophie committed 2026-06-25 14:01:52 +08:00
1 parent b89d93d738
commit 053ea392f2
61 files changed
+3329 -3268

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
"""
backend/app/models/department.py
用途:部门组织模型。
依赖:models.base.Base。
"""
from __future__ import annotations
from typing import Optional
from sqlalchemy import String, Text
from sqlalchemy.orm import Mapped, mapped_column
from app.models.base import Base
class Department(Base):
"""部门表:存储公司部门列表。"""
__tablename__ = 'departments'
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str] = mapped_column(String(100), unique=True)
code: Mapped[Optional[str]] = mapped_column(String(50), unique=True)
company: Mapped[Optional[str]] = mapped_column(String(100))
description: Mapped[Optional[str]] = mapped_column(Text)