Add Allusers view

main
Сергей Ванюшкин 2024-03-31 01:36:57 +03:00
parent b733a6bf9a
commit f5ecba9c1e
5 changed files with 27 additions and 2 deletions

View File

@ -1,7 +1,8 @@
from fastapi import FastAPI from fastapi import FastAPI
from api.presentation.routers import healthcheck_router from api.presentation.routers import healthcheck_router, user_router
def init_routers(app: FastAPI) -> None: def init_routers(app: FastAPI) -> None:
app.include_router(user_router)
app.include_router(healthcheck_router) app.include_router(healthcheck_router)

View File

@ -0,0 +1,3 @@
from .user_response import UserResponse
__all__ = ("UserResponse",)

View File

@ -0,0 +1,7 @@
from dataclasses import dataclass
@dataclass(frozen=True)
class UserResponse:
name: str
email: str

View File

@ -1,3 +1,7 @@
from .ping import healthcheck_router from .ping import healthcheck_router
from .user import user_router
__all__ = ("healthcheck_router",) __all__ = (
"healthcheck_router",
"user_router",
)

View File

@ -0,0 +1,10 @@
from fastapi import APIRouter
from api.application.contracts.user import UserResponse
user_router = APIRouter(prefix="/users", tags=["Users"])
@user_router.get("/")
async def get_all_users() -> list[UserResponse]:
return []