Merge branch 'refactor/backend-architecture' into development

This commit is contained in:
yangshilin
2026-03-18 17:18:23 +08:00
parent 2070a03d35
commit 48b70e1350
266 changed files with 12386 additions and 9690 deletions

15
api/tests/conftest.py Normal file
View File

@@ -0,0 +1,15 @@
"""Pytest 配置:确保 api 目录在 path 中,并预先加载所有 model 以解析 relationship 字符串引用。"""
import sys
from pathlib import Path
_api_dir = Path(__file__).resolve().parent.parent
if str(_api_dir) not in sys.path:
sys.path.insert(0, str(_api_dir))
# 聚合导入所有 feature models使 SQLAlchemy 能解析 User -> Order 等字符串 relationship
from app.features.auth import models as _auth_models # noqa: F401
from app.features.conversation import models as _conv_models # noqa: F401
from app.features.memory import models as _memory_models # noqa: F401
from app.features.memoir import models as _memoir_models # noqa: F401
from app.features.payment import models as _payment_models # noqa: F401
from app.features.user import models as _user_models # noqa: F401