From 31d10839682262c8aa526f1d2f5ee68dfe1bcdda Mon Sep 17 00:00:00 2001 From: aaron <> Date: Wed, 29 Jan 2025 13:52:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E9=80=81=E5=88=B8=E7=9A=84=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/endpoints/user.py | 6 +++--- app/core/config.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/api/endpoints/user.py b/app/api/endpoints/user.py index 554a299..c03080c 100644 --- a/app/api/endpoints/user.py +++ b/app/api/endpoints/user.py @@ -311,8 +311,8 @@ def issue_register_coupons(db: Session, user_id: int): """ register_coupons = settings.REGISTER_COUPONS - # 设置过期时间为3个月后 - expire_time = datetime.now() + timedelta(days=90) + # 设置过期时间 + expire_time = datetime.now() + timedelta(days=register_coupons["expire_days"]) for config in register_coupons: coupon = db.query(CouponDB).filter( @@ -332,7 +332,7 @@ def issue_register_coupons(db: Session, user_id: int): db.add(user_coupon) @router.get("/list", response_model=ResponseModel) -async def get_user_list( +async def get_list( skip: int = 0, limit: int = 10, role: Optional[str] = None, diff --git a/app/core/config.py b/app/core/config.py index 19660fc..01f152a 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -53,7 +53,7 @@ class Settings(BaseSettings): # 注册赠券配置 REGISTER_COUPONS: list = [ - {"coupon_id": 1, "count": 3}, + {"coupon_id": 1, "count": 3, "expire_days": 15}, ] WECHAT_APPID: str = "wx3cc5b7dcb28f2756"