From aa57478852a38ee8ae4ead902a930a920db678b7 Mon Sep 17 00:00:00 2001 From: zcr Date: Tue, 30 Dec 2025 17:35:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E6=8E=A8=E8=8D=90=E6=8E=A5=E5=8F=A3fi?= =?UTF-8?q?rst=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/config.py | 2 +- app/service/recommendation_system/milvus_client.py | 2 +- app/service/recommendation_system/vector_utils.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index 0ca254d..215176e 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -36,7 +36,7 @@ class Settings(BaseSettings): # --- mysql 配置信息 --- MYSQL_HOST: str = Field(default='', description="") - MYSQL_PORT: str = Field(default='', description="") + MYSQL_PORT: int = Field(default='', description="") MYSQL_USER: str = Field(default='', description="") MYSQL_PASSWORD: str = Field(default='', description="") MYSQL_DB: str = Field(default='', description="") diff --git a/app/service/recommendation_system/milvus_client.py b/app/service/recommendation_system/milvus_client.py index 0f4ef75..a027f99 100644 --- a/app/service/recommendation_system/milvus_client.py +++ b/app/service/recommendation_system/milvus_client.py @@ -23,7 +23,7 @@ def get_milvus_client() -> MilvusClient: _milvus_client = MilvusClient( uri=settings.MILVUS_URL, token=settings.MILVUS_TOKEN, - db_name=settings.MILVUS_DB, + db_name="", ) logger.info("Milvus 客户端连接成功") except Exception as e: diff --git a/app/service/recommendation_system/vector_utils.py b/app/service/recommendation_system/vector_utils.py index 05d8622..f6a78ab 100644 --- a/app/service/recommendation_system/vector_utils.py +++ b/app/service/recommendation_system/vector_utils.py @@ -10,7 +10,7 @@ from torchvision import models, transforms from PIL import Image from minio import Minio -from app.core.config import MINIO_URL, MINIO_ACCESS, MINIO_SECRET, MINIO_SECURE +from app.core.config import settings from app.service.recommendation_system.config import RECOMMENDATION_CONFIG logger = logging.getLogger(__name__) @@ -48,10 +48,10 @@ def get_minio_client(): global _minio_client if _minio_client is None: _minio_client = Minio( - MINIO_URL, - access_key=MINIO_ACCESS, - secret_key=MINIO_SECRET, - secure=MINIO_SECURE + settings.MINIO_URL, + access_key=settings.MINIO_ACCESS, + secret_key=settings.MINIO_SECRET, + secure=settings.MINIO_SECURE ) return _minio_client