feat(chat): support public channel chat

This commit is contained in:
MingxuanGame
2025-08-16 05:29:16 +00:00
parent 9a5c2fde08
commit f992e4cc71
13 changed files with 925 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
from __future__ import annotations
from collections.abc import AsyncIterator, Callable
from contextvars import ContextVar
import json
@@ -51,6 +52,17 @@ async def get_db():
yield session
DBFactory = Callable[[], AsyncIterator[AsyncSession]]
async def get_db_factory() -> DBFactory:
async def _factory() -> AsyncIterator[AsyncSession]:
async with AsyncSession(engine) as session:
yield session
return _factory
# Redis 依赖
def get_redis():
return redis_client