from flask import Blueprint from app.controllers import HistoryController from app.di_container import Container from dependency_injector.wiring import inject, Provide history_blueprint = Blueprint("history", __name__) @history_blueprint.route("/", methods=["GET"]) @inject def user_history( user_id: str, controller: HistoryController = Provide[Container.history_controller] ): return controller.get_quiz_by_user(user_id) @history_blueprint.route("/detail/", methods=["GET"]) @inject def user_detail_history( answer_id, controller: HistoryController = Provide[Container.history_controller] ): return controller.get_detail_quiz_history(answer_id) @history_blueprint.route("/session/", methods=["GET"]) @inject def session_history( session_id: str, controller: HistoryController = Provide[Container.history_controller], ): return controller.get_session_history(session_id)