From 71328752656ae145382258f50ca63c299044b8bb Mon Sep 17 00:00:00 2001 From: jingrow Date: Sun, 2 Nov 2025 01:25:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jingrow/jingrow/api/system.py | 42 +++++++++++++++--------------- apps/jingrow/jingrow/config.py | 42 ++++++++++++++++-------------- 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/apps/jingrow/jingrow/api/system.py b/apps/jingrow/jingrow/api/system.py index 9ce9087..aaf6fd9 100644 --- a/apps/jingrow/jingrow/api/system.py +++ b/apps/jingrow/jingrow/api/system.py @@ -93,27 +93,6 @@ async def update_environment_config(request: Request, config_data: Dict[str, Any 'jingrow_cloud_api_key', 'jingrow_cloud_api_secret', ], - '数据库配置': [ - 'jingrow_db_host', - 'jingrow_db_port', - 'jingrow_db_name', - 'jingrow_db_user', - 'jingrow_db_password', - 'jingrow_db_type', - ], - 'Qdrant 向量数据库配置': [ - 'qdrant_host', - 'qdrant_port', - ], - '运行模式': [ - 'run_mode', - ], - '环境:development/production(控制启动模式、热重载等)': [ - 'environment', - ], - '日志级别:DEBUG/INFO/WARNING/ERROR/CRITICAL(全局默认级别)': [ - 'log_level', - ], '本地后端主机配置': [ 'backend_host', 'backend_port', @@ -124,6 +103,27 @@ async def update_environment_config(request: Request, config_data: Dict[str, Any 'worker_threads', 'watch', ], + 'Qdrant 向量数据库配置': [ + 'qdrant_host', + 'qdrant_port', + ], + '数据库配置': [ + 'jingrow_db_host', + 'jingrow_db_port', + 'jingrow_db_name', + 'jingrow_db_user', + 'jingrow_db_password', + 'jingrow_db_type', + ], + '运行模式': [ + 'run_mode', + ], + '环境:development/production(控制启动模式、热重载等)': [ + 'environment', + ], + '日志级别:DEBUG/INFO/WARNING/ERROR/CRITICAL(全局默认级别)': [ + 'log_level', + ], } # 生成所有允许的字段列表 diff --git a/apps/jingrow/jingrow/config.py b/apps/jingrow/jingrow/config.py index 20247c5..bc62da8 100644 --- a/apps/jingrow/jingrow/config.py +++ b/apps/jingrow/jingrow/config.py @@ -16,26 +16,7 @@ class Settings(BaseSettings): jingrow_cloud_api_url: str = 'https://api.jingrow.com' jingrow_cloud_api_key: str = '' jingrow_cloud_api_secret: str = '' - - # 数据库配置 - jingrow_db_host: str = 'localhost' - jingrow_db_port: str = '3306' - jingrow_db_name: str = 'jingrow_local' - jingrow_db_user: str = 'root' - jingrow_db_password: str = '' - jingrow_db_type: str = 'mariadb' - - # Qdrant 向量数据库配置 - qdrant_host: str = '' - qdrant_port: int = 6333 - - # 运行模式 - run_mode: str = 'api' - # 环境:development/production(控制启动模式、热重载等) - environment: str = 'development' - # 日志级别:DEBUG/INFO/WARNING/ERROR/CRITICAL(全局默认级别) - log_level: str = 'INFO' - + # 本地后端主机配置 backend_host: str = '0.0.0.0' backend_port: int = 9001 @@ -45,6 +26,27 @@ class Settings(BaseSettings): worker_processes: int = 1 worker_threads: int = 1 watch: bool = True + + # Qdrant 向量数据库配置 + qdrant_host: str = '' + qdrant_port: int = 6333 + + # 数据库配置 + jingrow_db_host: str = 'localhost' + jingrow_db_port: str = '3306' + jingrow_db_name: str = 'jingrow_local' + jingrow_db_user: str = 'root' + jingrow_db_password: str = '' + jingrow_db_type: str = 'mariadb' + + + # 运行模式 + run_mode: str = 'api' + # 环境:development/production(控制启动模式、热重载等) + environment: str = 'development' + # 日志级别:DEBUG/INFO/WARNING/ERROR/CRITICAL(全局默认级别) + log_level: str = 'INFO' + class Config: env_file = str(get_root_path() / '.env')