2024-03-31 04:18:41 +03:00
|
|
|
from typing import Annotated
|
2024-03-31 01:36:57 +03:00
|
|
|
|
2024-03-31 04:18:41 +03:00
|
|
|
from fastapi import APIRouter, Depends
|
|
|
|
|
|
|
|
from api.application.contracts.user import UserCreateRequest, UserResponse
|
|
|
|
from api.application.usecase.create_user import CreateUser
|
|
|
|
from api.infrastructure.dependencies.stub import Stub
|
2024-03-31 01:36:57 +03:00
|
|
|
|
|
|
|
user_router = APIRouter(prefix="/users", tags=["Users"])
|
|
|
|
|
|
|
|
|
|
|
|
@user_router.get("/")
|
|
|
|
async def get_all_users() -> list[UserResponse]:
|
|
|
|
return []
|
2024-03-31 04:18:41 +03:00
|
|
|
|
|
|
|
|
|
|
|
@user_router.post("/")
|
|
|
|
async def create_task(
|
|
|
|
request: UserCreateRequest,
|
|
|
|
usecase: Annotated[CreateUser, Depends(Stub(CreateUser))],
|
|
|
|
) -> None:
|
|
|
|
return await usecase.execute(request)
|