// 数据导入相关

import { request } from '@/utils/request/index.ts';
// 列表接口
export const listApi = async () => {
  return await request({
    url: `/data/list_data`,
    method: 'GET',
  })
};

export const deleteApi = async (data: Record<string, any>) => {
  return await request({
    url: `/data/delete/${data.fileName}`,
    method: 'DELETE',
  })
}

export const importApi = async (data: Record<string, any>) => {
  console.log('importApi', data)
  return await request({
    url: `/data/import`,
    method: 'POST',
    headers: {
      Accept: 'application/json',
      authorization: `Bearer ${localStorage.token}`
    },
    data,
    dataRaw: true,
  })

}



  // 更新
  export const updateApi = async (data: Record<string, any>) => {
    return await request({
      url: `/data/data`,
      method: 'POST',
      data: data
    })
  }
