ADD presentation layer & init routers

main
Сергей Ванюшкин 2024-08-16 21:54:00 +03:00
parent dd214fa2a2
commit 3fe7f8f966
9 changed files with 32 additions and 1 deletions

View File

View File

@ -7,6 +7,7 @@ from fastapi import FastAPI
from fastfood_two.common.logger import configure_logger from fastfood_two.common.logger import configure_logger
from fastfood_two.entrypoint.dependencies import init_dependencies from fastfood_two.entrypoint.dependencies import init_dependencies
from fastfood_two.entrypoint.error_handlers import init_errorhandlers from fastfood_two.entrypoint.error_handlers import init_errorhandlers
from fastfood_two.entrypoint.routers import init_routers
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
configure_logger(level=logging.INFO) configure_logger(level=logging.INFO)
@ -21,13 +22,13 @@ async def app_lifespan(app: FastAPI) -> AsyncGenerator:
:param app: FastAPI application :param app: FastAPI application
:type app: FastAPI :type app: FastAPI
""" """
logger.info("Application lifespan started") logger.info("Application lifespan started")
init_dependencies(app) init_dependencies(app)
init_errorhandlers(app) init_errorhandlers(app)
init_routers(app)
yield yield

View File

@ -0,0 +1,6 @@
from fastapi import FastAPI
def init_routers(app: FastAPI) -> None:
"""Initialize FastAPI routers."""
pass

View File

@ -0,0 +1,8 @@
from fastapi import APIRouter
router = APIRouter(prefix="/dish", tags=["Dish"])
@router.get("/")
async def get_dishes():
return

View File

@ -0,0 +1,8 @@
from fastapi import APIRouter
router = APIRouter(prefix="/menu", tags=["Menu"])
@router.get("/")
async def get_menus():
return

View File

@ -0,0 +1,8 @@
from fastapi import APIRouter
router = APIRouter(prefix="/submenu", tags=["Dish"])
@router.get("/")
async def get_dish():
return

View File