import service from '@/utils/request'
// 查询文件类型
export const getFileType = () => {
  return service({
    url: '/file/queryFileGenre',
    method: 'get',
  })
}
// 新增文件类型
export const createFileType = (data) => {
  return service({
    url: '/file/createFileGenre',
    method: 'post',
    data: data
  })
}
// 修改文件类型
export const updateFileType = (data) => {
  return service({
    url: '/file/updateFileGenre',
    method: 'put',
    data: data
  })
}
// 删除文件类型
export const deleteFileType = (data) => {
  return service({
    url: '/file/deleteFileGenre',
    method: 'delete',
    data: data
  })
}
// 查询文件列表
export const queryFileList = (data) => {
  return service({
    url: '/project/queryFileList',
    method: 'post',
    data: data
  })
}

// 项目文件上传
export const createProjectFile = (data) => {
  return service({
    url: '/project/createProjectFile',
    method: 'post',
    data: data
  })
}

// 删除项目文件
export const deleteProjectFile = (data) => {
  return service({
    url: '/project/deleteProjectFile?id=' + data.ID + '&path=' + data.path,
    method: 'delete'
  })
}

// 删除多个项目文件
export const deleteProjectFiles = (data) => {
  return service({
    url: '/project/deleteProjectFiles',
    method: 'delete',
    data
  })
}

// 下载项目文件
export const downloadProjectFile = (data) => {
  return service({
    url: '/project/projectFilesDownload',
    method: 'post',
    responseType: 'blob',
    data: data
  })
}

// 查询所有必要文件
export const queryAllFileType = () => {
  return service({
    url: '/file/queryNecessaryDocuments',
    method: 'get',
  })
}
