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,5 +1,7 @@
|
||||
from typing import Dict
|
||||
|
||||
from app.controllers.abc import ITrainingController
|
||||
from app.dtos import TipsDTO
|
||||
from app.dtos.training import FetchTipsDTO
|
||||
from app.services.abc import ITrainingService
|
||||
|
||||
|
||||
@@ -8,8 +10,8 @@ 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)
|
||||
async def fetch_tips(self, data: FetchTipsDTO):
|
||||
return await self._service.fetch_tips(data.context, data.question, data.answer, data.correct_answer)
|
||||
|
||||
async def get_training_content(self, data: Dict):
|
||||
return await self._service.get_training_content(data)
|
||||
|
||||
Reference in New Issue
Block a user