import { defHttp } from '/@/utils/http/axios';
import {
  PageParams,
  RentListGetResultModel,
  SceneEditParam,
  SceneDownloadParam,
  GetDownloadProcessModel,
  UpdateParams,
} from './model';
import { Result } from '/#/axios';

enum Api {
  pageList = '/zfb-api/zfb/scene/pageList',
  generateSceneEditToken = '/zfb-api/zfb/api/platform/generateSceneEditToken',
  downloadSceneData = '/zfb-api/zfb/scene/downloadSceneData',
  getDownloadProcess = '/zfb-api/zfb/scene/getDownloadProcess',
  update = '/zfb-api/zfb/scene/update',
  generateDefaultLiveRoom = '/basic-api/scene/generateDefaultLiveRoom',
}

/**
 * @description: Get sample list value
 */

export const UpdateApi = (params: UpdateParams) =>
  defHttp.post<Result>({
    url: Api.update,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const ListApi = (params: PageParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.pageList,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const downloadSceneDataAPi = (params: SceneDownloadParam) =>
  defHttp.get<Result>({
    url: Api.downloadSceneData,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const getDownloadProcessApi = (params: SceneDownloadParam) =>
  defHttp.get<GetDownloadProcessModel>({
    url: Api.getDownloadProcess,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const generateSceneEditTokenApi = (params: SceneEditParam) =>
  defHttp.post<Result>({
    url: Api.generateSceneEditToken,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const generateDefaultLiveRoomApi = (params: SceneDownloadParam) =>
  defHttp.post<Result>({
    url: Api.generateDefaultLiveRoom,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
