TIF_E41211115_Genso_quiz_ba.../app/controllers/history_controller.py

16 lines
504 B
Python

from services import HistoryService
from helpers import make_error_response, make_response
class HistoryController:
def __init__(self, history_service: HistoryService):
self.history_service = history_service
def get_quiz_by_user(self, user_id: str):
try:
data = self.history_service.get_history_by_user_id(user_id)
return make_response(message="retrive history data", data=data)
except Exception as e:
return make_error_response(e)