from flask import Blueprint, jsonify from backend.models import DownloadJob bp = Blueprint('download_jobs', __name__, url_prefix='/api/download-jobs') @bp.route('/', methods=['GET']) def get_job_status(job_id): """Get download job status""" job = DownloadJob.query.get_or_404(job_id) return jsonify(job.to_dict()), 200 @bp.route('/question/', methods=['GET']) def get_job_by_question(question_id): """Get download job for a question""" job = DownloadJob.query.filter_by(question_id=question_id).first_or_404() return jsonify(job.to_dict()), 200