From 5f1ed61536ac987337cad48b5ea7c7f4d45d1dbe Mon Sep 17 00:00:00 2001 From: xingc Date: Mon, 18 Aug 2025 01:58:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(card):=20=E6=96=B0=E5=A2=9E=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=B9=B3=E5=8F=B0session=E8=AE=B0=E5=BD=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/routers/card/routes.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/routers/card/routes.py b/core/routers/card/routes.py index 88e52b2..7801ca1 100644 --- a/core/routers/card/routes.py +++ b/core/routers/card/routes.py @@ -275,6 +275,18 @@ async def created_card( return {'data': card} +@card_router.post('/platform-session', summary='保持/更新渠道session', response_model=base_schema.BaseResponse) +async def create_platform_session( + payload: schema.PlatformSessionsIn, + platform: base_schema.SupportPlatformType = Query(...), + redis_conn: aioredis.Redis = Depends(get_cache) +): + async with redis_conn: + await redis_conn.set(generate_keyname(f'session:{platform.value}'), ujson.encode(payload.data), ex=60 * 30) + + return {'data': payload.data} + + @card_router.post( '/{card_id}/update/', summary='卡片更新(会员功能,入手价值、展示价值)',