// import request from '@/utils/request';
import { useHttp } from '@crami/http';

export interface fileUpload {
  file: string;
  filePath: string;
  fileShowName: string;
}
export async function FileUploadAPI(data: any) {
  return await useHttp({
    url: '/api/file/applicationFile/upload',
    method: 'post',
    data,
    timeout: 999999999,
  });
}

export interface downloadUrl {
  fileId: string;
}
export async function downloadUrlAPI(fileId: string) {
  return await useHttp({
    url: `/api/file/applicationFile/template/downloadUrl/${fileId}`,
    method: 'get',
  });
}

export interface soleData {
  Data: {
    coding: string;
  };
  NewObject: boolean;
  connect: string;
  lang: string;
  objectID: string;
  objectType: string;
  companyId: string;
}
export async function soleDataAPI(data: soleData) {
  return await useHttp({
    url: '/api/system/model/CheckObjectUnique',
    method: 'post',
    data,
  });
}
//导入接口替换
export async function ImpDataAPI(data: soleData) {
  return await useHttp({
    url: '/importservice/importMaintain/checkObjectUnique',
    method: 'post',
    data,
  });
}

//导出接口替换
export async function ExpDataAPI(data: soleData) {
  return await useHttp({
    url: '/exportservice/exportMaintain/checkObjectUnique',
    method: 'post',
    data,
  });
}
