Updated this to the latest version of develop, got rid of most of the duplication, might be missing some packages in toml, needs testing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from dependency_injector.wiring import Provide, inject
|
||||
from fastapi import APIRouter, Depends
|
||||
from fastapi import APIRouter, Depends, Request
|
||||
|
||||
from app.dtos import TipsDTO
|
||||
from app.dtos.training import FetchTipsDTO
|
||||
from app.middlewares import Authorized, IsAuthenticatedViaBearerToken
|
||||
from app.controllers.abc import ITrainingController
|
||||
|
||||
@@ -15,7 +15,20 @@ training_router = APIRouter()
|
||||
)
|
||||
@inject
|
||||
async def get_reading_passage(
|
||||
data: TipsDTO,
|
||||
data: FetchTipsDTO,
|
||||
training_controller: ITrainingController = Depends(Provide[controller])
|
||||
):
|
||||
return await training_controller.fetch_tips(data)
|
||||
|
||||
|
||||
@training_router.post(
|
||||
'/',
|
||||
dependencies=[Depends(Authorized([IsAuthenticatedViaBearerToken]))]
|
||||
)
|
||||
@inject
|
||||
async def training_content(
|
||||
request: Request,
|
||||
training_controller: ITrainingController = Depends(Provide[controller])
|
||||
):
|
||||
data = await request.json()
|
||||
return await training_controller.get_training_content(data)
|
||||
|
||||
Reference in New Issue
Block a user