feat: add inbox messages module for calendar invitations

This commit is contained in:
qzl
2026-02-28 12:09:34 +08:00
parent 9b48939de8
commit 709ae5ab73
8 changed files with 454 additions and 0 deletions
@@ -0,0 +1,30 @@
from __future__ import annotations
from typing import Annotated
from fastapi import Depends
from sqlalchemy.ext.asyncio import AsyncSession
from core.auth.models import CurrentUser
from core.db.session import get_db
from v1.inbox_messages.repository import SQLAlchemyInboxMessageRepository
from v1.inbox_messages.service import InboxMessageService
from v1.users.dependencies import get_current_user
async def get_inbox_message_repository(
session: Annotated[AsyncSession, Depends(get_db)],
) -> SQLAlchemyInboxMessageRepository:
return SQLAlchemyInboxMessageRepository(session)
def get_inbox_message_service(
session: Annotated[AsyncSession, Depends(get_db)],
repository: Annotated[
SQLAlchemyInboxMessageRepository, Depends(get_inbox_message_repository)
],
user: Annotated[CurrentUser, Depends(get_current_user)],
) -> InboxMessageService:
return InboxMessageService(
repository=repository, session=session, current_user=user
)