-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#22: WIP: feat: add basic
review
repositories and services
- Loading branch information
1 parent
849e1d2
commit c50ba11
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from .repositories import ReviewRepository | ||
from .services import ReviewService | ||
|
||
__all__ = [ | ||
"ReviewRepository", | ||
"ReviewService", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ReviewRepository: | ||
"""Репозиторий для работы с данными рецензий.""" | ||
|
||
async def create(self): | ||
"""Создание рецензии.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from .repositories import ReviewRepository | ||
|
||
|
||
class ReviewService: | ||
"""Сервис для работы с рецензиями.""" | ||
|
||
def __init__(self, review_repository: ReviewRepository) -> None: | ||
assert isinstance(review_repository, ReviewRepository) | ||
self._repository = review_repository | ||
|
||
async def create_review(self): | ||
"""Создание новой рецензии на фильм.""" | ||
await self._repository.create() |