/**
 * Phase 3: 批处理模式 - 路由配置
 */

import { FastifyInstance } from 'fastify';
import {
  executeBatch,
  getTask,
  getTaskResults,
  retryFailed,
  getTemplates,
} from '../controllers/batchController.js';

export async function batchRoutes(fastify: FastifyInstance) {
  // 执行批处理任务
  fastify.post('/batch/execute', executeBatch);

  // 获取任务状态
  fastify.get('/batch/tasks/:taskId', getTask);

  // 获取任务结果
  fastify.get('/batch/tasks/:taskId/results', getTaskResults);

  // 重试失败的文档
  fastify.post('/batch/tasks/:taskId/retry-failed', retryFailed);

  // 获取所有预设模板
  fastify.get('/batch/templates', getTemplates);
}









