import request from '@/utils/request'

// 获取下载文件链接
export function getDownloadUrl(type, fileName) {
  return request({
    url: `/api/file/Download/${type}/${fileName}`,
    method: 'get'
  })
}

export function getFileById(fileIds = []) {
  return request({
    url: `/api/file/getFileById`,
    method: 'post',
    data: fileIds
  })
}

export function getBySerialNumber(serialNumber) {
  return request({
    url: `/api/file/getBySerialNumber?serialNumber=` + serialNumber,
    method: 'post',
    data: {
      serialNumber
    }
  })
}

export function delBySerialNumber(serialNumber, fileUrl) {
  return request({
    url: `/api/file/delBySerialNumber?serialNumber=` + serialNumber + '&fileUrl=' + fileUrl + '&id=' + fileUrl,
    method: 'post',
    data: {
      serialNumber,
      fileUrl
    }
  })
}
