22 lines
641 B
Python
22 lines
641 B
Python
from dependency_injector.wiring import Provide, inject
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from ielts_be.dtos.user_batch import BatchUsersDTO
|
|
from ielts_be.middlewares import Authorized, IsAuthenticatedViaBearerToken
|
|
from ielts_be.controllers import IUserController
|
|
|
|
controller = "user_controller"
|
|
user_router = APIRouter()
|
|
|
|
|
|
@user_router.post(
|
|
'/import',
|
|
dependencies=[Depends(Authorized([IsAuthenticatedViaBearerToken]))]
|
|
)
|
|
@inject
|
|
async def batch_import(
|
|
batch: BatchUsersDTO,
|
|
user_controller: IUserController = Depends(Provide[controller])
|
|
):
|
|
return await user_controller.batch_import(batch)
|