From 3fe7f8f966d07134a33f0247e4eec058fb81fc33 Mon Sep 17 00:00:00 2001 From: Sergey Vanyushkin Date: Fri, 16 Aug 2024 21:54:00 +0300 Subject: [PATCH] ADD presentation layer & init routers --- src/fastfood_two/domain/__init__.py | 0 src/fastfood_two/entrypoint/main.py | 3 ++- src/fastfood_two/entrypoint/routers.py | 6 ++++++ src/fastfood_two/infrastructure/__init__.py | 0 src/fastfood_two/presentation/__init__.py | 0 src/fastfood_two/presentation/dish.py | 8 ++++++++ src/fastfood_two/presentation/menu.py | 8 ++++++++ src/fastfood_two/presentation/submenu.py | 8 ++++++++ src/fastfood_two/presentation/summary.py | 0 9 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/fastfood_two/domain/__init__.py create mode 100644 src/fastfood_two/entrypoint/routers.py create mode 100644 src/fastfood_two/infrastructure/__init__.py create mode 100644 src/fastfood_two/presentation/__init__.py create mode 100644 src/fastfood_two/presentation/dish.py create mode 100644 src/fastfood_two/presentation/menu.py create mode 100644 src/fastfood_two/presentation/submenu.py create mode 100644 src/fastfood_two/presentation/summary.py diff --git a/src/fastfood_two/domain/__init__.py b/src/fastfood_two/domain/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/fastfood_two/entrypoint/main.py b/src/fastfood_two/entrypoint/main.py index 1558065..56b9363 100644 --- a/src/fastfood_two/entrypoint/main.py +++ b/src/fastfood_two/entrypoint/main.py @@ -7,6 +7,7 @@ from fastapi import FastAPI from fastfood_two.common.logger import configure_logger from fastfood_two.entrypoint.dependencies import init_dependencies from fastfood_two.entrypoint.error_handlers import init_errorhandlers +from fastfood_two.entrypoint.routers import init_routers logger = logging.getLogger(__name__) configure_logger(level=logging.INFO) @@ -21,13 +22,13 @@ async def app_lifespan(app: FastAPI) -> AsyncGenerator: :param app: FastAPI application :type app: FastAPI - """ logger.info("Application lifespan started") init_dependencies(app) init_errorhandlers(app) + init_routers(app) yield diff --git a/src/fastfood_two/entrypoint/routers.py b/src/fastfood_two/entrypoint/routers.py new file mode 100644 index 0000000..9c6a693 --- /dev/null +++ b/src/fastfood_two/entrypoint/routers.py @@ -0,0 +1,6 @@ +from fastapi import FastAPI + + +def init_routers(app: FastAPI) -> None: + """Initialize FastAPI routers.""" + pass diff --git a/src/fastfood_two/infrastructure/__init__.py b/src/fastfood_two/infrastructure/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/fastfood_two/presentation/__init__.py b/src/fastfood_two/presentation/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/fastfood_two/presentation/dish.py b/src/fastfood_two/presentation/dish.py new file mode 100644 index 0000000..5d06b09 --- /dev/null +++ b/src/fastfood_two/presentation/dish.py @@ -0,0 +1,8 @@ +from fastapi import APIRouter + +router = APIRouter(prefix="/dish", tags=["Dish"]) + + +@router.get("/") +async def get_dishes(): + return diff --git a/src/fastfood_two/presentation/menu.py b/src/fastfood_two/presentation/menu.py new file mode 100644 index 0000000..d0c46d5 --- /dev/null +++ b/src/fastfood_two/presentation/menu.py @@ -0,0 +1,8 @@ +from fastapi import APIRouter + +router = APIRouter(prefix="/menu", tags=["Menu"]) + + +@router.get("/") +async def get_menus(): + return diff --git a/src/fastfood_two/presentation/submenu.py b/src/fastfood_two/presentation/submenu.py new file mode 100644 index 0000000..7d7814e --- /dev/null +++ b/src/fastfood_two/presentation/submenu.py @@ -0,0 +1,8 @@ +from fastapi import APIRouter + +router = APIRouter(prefix="/submenu", tags=["Dish"]) + + +@router.get("/") +async def get_dish(): + return diff --git a/src/fastfood_two/presentation/summary.py b/src/fastfood_two/presentation/summary.py new file mode 100644 index 0000000..e69de29