// @ts-ignore
/* eslint-disable */
import { request } from '@wisdom-utils/utils';

/** 单文件上传 POST /FileCenter/UploadSingleFile */
export async function UploadSingleFile(body, options) {
  const formData = new FormData();

  Object.keys(body).forEach(ele => {
    const item = body[ele];

    if (item !== undefined && item !== null) {
      form.append(ele, typeof item === 'object' ? JSON.stringify(item) : item);
    }
  });

  return request('/FileCenter/UploadSingleFile', {
    method: 'POST',
    data: formData,
    ...(options || {}),
  });
}

/** 获取文件路径 moduleName 可选 CityTemp\icon\androidMenu\menuNew\logo\menu 支持多选用逗号隔开 GET /FileCenter/GetFileUrls */
export async function GetFileUrls(params, options) {
  return request('/FileCenter/GetFileUrls', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 保存小程序apk文件 POST /FileCenter/SaveMobileApk */
export async function SaveMobileApk(body, options) {
  const formData = new FormData();

  Object.keys(body).forEach(ele => {
    const item = body[ele];

    if (item !== undefined && item !== null) {
      form.append(ele, typeof item === 'object' ? JSON.stringify(item) : item);
    }
  });

  return request('/FileCenter/SaveMobileApk', {
    method: 'POST',
    data: formData,
    ...(options || {}),
  });
}

/** 获取移动应用上传apk信息 GET /FileCenter/GetMobileFiles */
export async function GetMobileFiles(params, options) {
  return request('/FileCenter/GetMobileFiles', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
