Skip to content

Commit

Permalink
feat: add domain, infra, service layer
Browse files Browse the repository at this point in the history
  • Loading branch information
hyukychang committed Apr 1, 2024
1 parent 8750515 commit 0656767
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ara/domain/board/board_domain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from ara.domain.board.type import BoardInfo
from ara.infra.board.board_infra import BoardInfra


class BoardDomain:
def __init__(self) -> None:
self.board_infra = BoardInfra()

def get_all_boards(self) -> list[BoardInfo]:
return self.board_infra.get_all_boards()
2 changes: 1 addition & 1 deletion ara/infra/board/board_infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self) -> None:
super().__init__(Board)
self.board_group_infra = BoardGroupInfra()

def get_all(self) -> list[BoardInfo]:
def get_all_boards(self) -> list[BoardInfo]:
queryset = Board.objects.select_related("group").extra(
select={
"topic_id": "topic.id",
Expand Down
Empty file added ara/service/board/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions ara/service/board/board_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from ara.domain.board.board_domain import BoardDomain
from ara.domain.board.type import BoardInfo


class BadgeApplication:
def __init__(self) -> None:
self.board_domain = BoardDomain()

def get_all_boards(self) -> list[BoardInfo]:
return self.board_domain.get_all_boards()

0 comments on commit 0656767

Please sign in to comment.