import { defHttp } from '/@/utils/http/axios';
import {
  PageParams,
  RentListGetResultModel,
  SceneEditParam,
  SceneDownloadParam,
  GetDownloadProcessModel,
  SceneDownloadModel,
} 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',

  pageList = '/kankan-api/api/manager/scene/list',
  generateSceneEditToken = '/kankan-api/api/manager/platform/generateSceneEditToken',
  downloadSceneData = '/kankan-api/api/user/scene/downloadScene',
  getDownloadProcess = '/kankan-api/api/user/scene/downloadProcess',
  addDownloadNum = '/kankan-api/api/scene/addDownloadNum',
  checkDownload = '/kankan-api/api/user/scene/checkDownload',
}

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

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

export const downloadSceneDataAPi = (params: SceneDownloadParam) =>
  defHttp.post<SceneDownloadModel>({
    url: Api.downloadSceneData,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const getDownloadProcessApi = (params: SceneDownloadParam) =>
  defHttp.post<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 addDownloadNumApi = (params: SceneDownloadParam) =>
  defHttp.get<Result>({
    url: Api.addDownloadNum,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const checkDownloadApi = (params: SceneDownloadParam) =>
  defHttp.post<SceneDownloadModel>({
    url: Api.checkDownload,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
