/**
 * 音频下载相关 API
 */

import { get, post } from '../utils/request';

/**
 * 获取音频下载信息
 */
export async function getAudioDownloadInfo(audioId: string) {
  return get<{
    id: number;
    title: string;
    audioUrl: string;
    duration: number;
    size: number;
    downloadUrl: string;
  }>(`/tts/download/${audioId}`);
}

/**
 * 批量获取下载链接
 */
export async function getBatchDownloadUrls(audioIds: string[]) {
  return post<{
    total: number;
    audios: Array<{
      id: number;
      title: string;
      downloadUrl: string;
      duration: number;
      size: number;
    }>;
  }>('/tts/download/batch', { audioIds });
}
