// import request from '@/utils/request';
import { useHttp } from '@crami/http';
interface saveTransfer {
  transferStrategyName: string;
  transferStrategyDescription: string;
  transferStrategyCode: string;
  inUse: string;
  eid: string;
  strategyList: Array<any>;
  companyId: string;
}

interface deleteTransferr {
  eidList: Array<any>;
}

interface getOneTransfer {
  eid: string;
}

//替换当前版本

export async function getPluginList() {
  return await useHttp({
    method: 'get',
    url: '/api/file/transfer/getPluginList',
  });
}

// 传输策略新增

export async function saveTransfer(params: saveTransfer) {
  return await useHttp({
    method: 'post',
    url: '/api/file/transfer/saveTransfer',
    params,
  });
}

// 传输策略编辑

export async function editTransfer(params: saveTransfer) {
  return await useHttp({
    method: 'post',
    url: '/api/file/transfer/editTransfer',
    params,
  });
}

// 传输策略编辑回显

export async function getOneTransfer(eid: string) {
  return await useHttp({
    method: 'get',
    url: '/api/file/transfer/getOneTransfer?eid=' + eid,
  });
}

// 删除

export async function deleteTransferr(params: deleteTransferr) {
  return await useHttp({
    method: 'post',
    url: '/api/file/transfer/deleteTransfer',
    params,
  });
}

export async function getList() {
  return await useHttp({
    method: 'get',
    url: '/api/file/transfer/getPluginList',
  });
}

// 拓展插件删除

export async function deleteExtensions(eid: string) {
  return await useHttp({
    method: 'get',
    url: '/api/file/transfer/deleteExtensions?eid=' + eid,
  });
}

// 1.查看插件详情
export async function getExtensionsDetail(eid: string) {
  return await useHttp({
    method: 'get',
    url: `/api/file/transfer/getExtensionsDetail/${eid}`,
  });
}
