ADD presentation layer & init routers
parent
dd214fa2a2
commit
3fe7f8f966
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
from fastapi import FastAPI
|
||||||
|
|
||||||
|
|
||||||
|
def init_routers(app: FastAPI) -> None:
|
||||||
|
"""Initialize FastAPI routers."""
|
||||||
|
pass
|
|
@ -0,0 +1,8 @@
|
||||||
|
from fastapi import APIRouter
|
||||||
|
|
||||||
|
router = APIRouter(prefix="/dish", tags=["Dish"])
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/")
|
||||||
|
async def get_dishes():
|
||||||
|
return
|
|
@ -0,0 +1,8 @@
|
||||||
|
from fastapi import APIRouter
|
||||||
|
|
||||||
|
router = APIRouter(prefix="/menu", tags=["Menu"])
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/")
|
||||||
|
async def get_menus():
|
||||||
|
return
|
|
@ -0,0 +1,8 @@
|
||||||
|
from fastapi import APIRouter
|
||||||
|
|
||||||
|
router = APIRouter(prefix="/submenu", tags=["Dish"])
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/")
|
||||||
|
async def get_dish():
|
||||||
|
return
|
Loading…
Reference in New Issue