refactor(backend): 后端重构初步设想

This commit is contained in:
sophie committed 2026-06-17 11:24:54 +08:00
1 parent b69d549b2c
commit 21b8c24815
96 files changed
+1592

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
"""
backend/app/core/config/__init__.py
用途:应用配置包入口(settings、env_persistence)。
逻辑:create_app 加载 Config;before_request 刷新 DB 持久化配置。
"""
@@ -0,0 +1,9 @@
"""
backend/app/core/config/env_persistence.py
用途:DB 持久化运行时配置(Wave 1 自 app/env_persistence.py 迁入)。
逻辑:before_request 调用 apply_env_settings 刷新 app.config。
"""
from app.env_persistence import apply_env_settings # noqa: F401
__all__ = ['apply_env_settings']
+9
View File
@@ -0,0 +1,9 @@
"""
backend/app/core/config/settings.py
用途:Config 类与环境映射(Wave 1 自 app/config.py 迁入)。
逻辑:create_app(config_name) 通过 config[config_name] 加载。
"""
from app.config import ACTIVE_ENV_NAME, config # noqa: F401
__all__ = ['config', 'ACTIVE_ENV_NAME']