refactor: 将配置导入导出常量移至文件顶部

This commit is contained in:
fawney19
2026-02-11 23:27:48 +08:00
parent 01c725a2ee
commit 6956536830

View File

@@ -23,6 +23,10 @@ from src.services.system.config import SystemConfigService
router = APIRouter(prefix="/api/admin/system", tags=["Admin - System"])
CONFIG_EXPORT_VERSION = "2.2"
CONFIG_SUPPORTED_VERSIONS = ("2.0", "2.1", "2.2")
MAX_IMPORT_SIZE = 10 * 1024 * 1024 # 10MB
def _get_version_from_git() -> str | None:
"""从 git describe 获取版本号"""
@@ -1077,11 +1081,6 @@ class AdminExportConfigAdapter(AdminApiAdapter):
}
CONFIG_EXPORT_VERSION = "2.2"
CONFIG_SUPPORTED_VERSIONS = ("2.0", "2.1", "2.2")
MAX_IMPORT_SIZE = 10 * 1024 * 1024 # 10MB
class AdminImportConfigAdapter(AdminApiAdapter):
"""导入提供商和模型配置"""