import { request } from 'umi';

export const queryDirList = async (data) => {
  return await request('/api/archive/v1/dir/list', {
    method: 'POST',
    data,
  });
};
export const queryFileList = async (data) => {
  return await request('/api/archive/v1/file/list', {
    method: 'POST',
    data,
  });
};
// 获取OA文件列表(合同文件&投标文件)
// params: page_size, current_page, classify_id = 42/43
export const queryOAFile = async (data) => {
  return await request(`/api/v1/oa/file/list`, { params: data });
};
export const queryDirCreate = async (data) => {
  return await request('/api/archive/v1/dir/create', {
    method: 'POST',
    data,
  });
};

export const querySetPermit = async (data) => {
  return await request('/api/archive/v1/set/permit', {
    method: 'POST',
    data,
  });
};

export const queryFileUpload = async (data) => {
  return await request('/api/archive/v1/file/upload', {
    method: 'POST',
    data,
    headers: { 'content-type': 'mutipart/form-data' },
  });
};

export const queryPermitList = async (data) => {
  return await request('/api/archive/v1/permit/list', {
    method: 'POST',
    data,
  });
};

export const queryFileDelete = async (data) => {
  return await request('/api/archive/v1/file/delete', {
    method: 'POST',
    data,
  });
};
