import {
  CreateMovieProjectV2Request,
  CreateMovieProjectV3Request,
} from "./DTO/movie_start_dto";
import { post } from "./request";

import { withQueuePolling, QueueResponse } from './movie_queue';

// 新-创建接口
export const createMovieProject = async (data: any): Promise<QueueResponse> => {
  const apiCall = (params: any) => post<QueueResponse>('/movie/create_movie_project', params);
  return withQueuePolling(apiCall, data);
};

/**
 * 创建电影项目V2
 * @param request - 创建项目请求参数
 * @returns Promise<QueueResponse>
 */
export const createMovieProjectV2 = async (
  request: CreateMovieProjectV2Request
): Promise<QueueResponse> => {
  const apiCall = (params: CreateMovieProjectV2Request) => 
    post<QueueResponse>("/movie/create_movie_project_v2", params);
  return withQueuePolling(apiCall, request);
};

/**
 * 创建电影项目V3
 * @param request - 创建项目请求参数
 * @returns Promise<QueueResponse>
 */
export const createMovieProjectV3 = async (
  request: CreateMovieProjectV3Request
): Promise<QueueResponse> => {
  const apiCall = (params: CreateMovieProjectV3Request) => 
    post<QueueResponse>("/movie/create_movie_project_v3", params);
  return withQueuePolling(apiCall, request);
};