From fadb0e5b4f41915446220c0f3e0f27e1d93aaf43 Mon Sep 17 00:00:00 2001 From: longda Date: Tue, 24 Mar 2026 23:57:27 +0800 Subject: [PATCH] =?UTF-8?q?v1.2.13:=20=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=A2=9E=E5=BC=BA/=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E4=BC=98=E5=8C=96/=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=B1=A0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/VERSION | 1 + backend/app/routers/collections.py | 5 +++++ config/VERSION | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 backend/VERSION diff --git a/backend/VERSION b/backend/VERSION new file mode 100644 index 0000000..0b1f1ed --- /dev/null +++ b/backend/VERSION @@ -0,0 +1 @@ +1.2.13 diff --git a/backend/app/routers/collections.py b/backend/app/routers/collections.py index ea44f59..fd741e0 100644 --- a/backend/app/routers/collections.py +++ b/backend/app/routers/collections.py @@ -121,6 +121,7 @@ def get_collections( sortBy: str = Query('createdAt'), sortOrder: str = Query('desc'), all_users: bool = Query(False, description="return all users data for admin"), + user_id: str = Query(None, description="filter by user id"), current_user: User = Depends(get_current_user), db: Session = Depends(get_db) ): @@ -138,6 +139,10 @@ def get_collections( else: query = db.query(Collection).filter(Collection.f99_91_user_id == current_user.f99_90_id) + # 如果指定了user_id参数,则只返回该用户的藏品 + if user_id: + query = query.filter(Collection.f99_91_user_id == user_id) + if category: query = query.filter(Collection.f01_03_category == category) if status: diff --git a/config/VERSION b/config/VERSION index dedc56c..0b1f1ed 100644 --- a/config/VERSION +++ b/config/VERSION @@ -1 +1 @@ -VERSION=1.2.12 +1.2.13