From bbc0f445b8fd186adc6c24e0593a9149c0fd21e6 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Wed, 16 Apr 2025 13:07:48 +0800 Subject: [PATCH] update --- app/api/v1/tryon.py | 5 ++++- app/core/config.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/api/v1/tryon.py b/app/api/v1/tryon.py index 8884efb..174ad63 100644 --- a/app/api/v1/tryon.py +++ b/app/api/v1/tryon.py @@ -64,8 +64,11 @@ async def tryon( status=TryonStatus.GENERATING ) db.add(tryon_history) + + # 更新试穿次数 + current_user.tryon_remain_count -= 1 await db.commit() - return StandardResponse(code=200, message="试穿任务已提交", data=tryon_history.id) + return StandardResponse(code=200, message="试穿任务已提交", data={"tryon_history_id": tryon_history.id, "tryon_remain_count": current_user.tryon_remain_count}) else: return StandardResponse(code=500, message="试穿任务提交失败") diff --git a/app/core/config.py b/app/core/config.py index 74ab437..7c17efe 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -12,8 +12,8 @@ class Settings(BaseSettings): PROJECT_VERSION: str = "0.1.0" # 试穿次数 - TRYON_REMAIN_COUNT: int = 5 - TRYON_ADDITIONAL_COUNT: int = 3 + TRYON_REMAIN_COUNT: int = 3 + TRYON_ADDITIONAL_COUNT: int = 1 # 默认头像 DEFAULT_AVATAR: str = "https://aidress-1311994147.cos.ap-chengdu.myqcloud.com/uploads/20250415/a9fecdb0fa3549488f010f7b89fdef1c.png"