mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-02-20 07:59:50 -05:00
30 lines
784 B
Python
30 lines
784 B
Python
from typing import Annotated
|
|
|
|
from fastapi import Depends
|
|
|
|
from media_manager.database import DbSessionDependency
|
|
from media_manager.notification.repository import NotificationRepository
|
|
from media_manager.notification.service import NotificationService
|
|
|
|
|
|
def get_notification_repository(
|
|
db_session: DbSessionDependency,
|
|
) -> NotificationRepository:
|
|
return NotificationRepository(db_session)
|
|
|
|
|
|
notification_repository_dep = Annotated[
|
|
NotificationRepository, Depends(get_notification_repository)
|
|
]
|
|
|
|
|
|
def get_notification_service(
|
|
notification_repository: notification_repository_dep,
|
|
) -> NotificationService:
|
|
return NotificationService(notification_repository)
|
|
|
|
|
|
notification_service_dep = Annotated[
|
|
NotificationService, Depends(get_notification_service)
|
|
]
|