From 2a3de5397e241994f367bc125daf0114d93c0c23 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Wed, 16 Apr 2025 18:01:35 +0800 Subject: [PATCH] update --- app/api/v1/tryon.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/v1/tryon.py b/app/api/v1/tryon.py index 174ad63..f990bce 100644 --- a/app/api/v1/tryon.py +++ b/app/api/v1/tryon.py @@ -75,12 +75,14 @@ async def tryon( @router.get("/histories", tags=["tryon"]) async def get_tryon_histories( db: AsyncSession = Depends(deps.get_db), - current_user: User = Depends(get_current_user) + current_user: User = Depends(get_current_user), + skip: int = 0, + limit: int = 10 ): """ 获取试穿历史 """ - histories = await db.execute(select(TryonHistory).where(TryonHistory.user_id == current_user.id).order_by(TryonHistory.create_time.desc())) + histories = await db.execute(select(TryonHistory).where(TryonHistory.user_id == current_user.id).order_by(TryonHistory.create_time.desc()).offset(skip).limit(limit)) tryon_histories = histories.scalars().all() result = []