import http from '@/utils/http'
import type { BroadcastInfo, GenerateBroadcastResponse } from '@/types/broadcast'

export const broadcastApi = {
  /**
   * 触发播课生成
   */
  generate(courseId: number) {
    return http.post<GenerateBroadcastResponse>(`/api/v1/courses/${courseId}/generate-broadcast`)
  },

  /**
   * 获取播课信息
   */
  getInfo(courseId: number) {
    return http.get<BroadcastInfo>(`/api/v1/courses/${courseId}/broadcast`)
  }
}
