16 lines
509 B
Python
16 lines
509 B
Python
from app.controllers.abc import ITrainingController
|
|
from app.dtos import TipsDTO
|
|
from app.services.abc import ITrainingService
|
|
|
|
|
|
class TrainingController(ITrainingController):
|
|
|
|
def __init__(self, training_service: ITrainingService):
|
|
self._service = training_service
|
|
|
|
async def fetch_tips(self, data: TipsDTO):
|
|
try:
|
|
return await self._service.fetch_tips(data.context, data.question, data.answer, data.correct_answer)
|
|
except Exception as e:
|
|
return str(e)
|