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"