import request from '@/utils/request'

export function downloadFileByPath(resource, preview = true) {
  return request({
    url: '/common/download/resource',
    method: 'get',
    params: {resource},
    responseType: 'blob',
    preview
  })
}

export function  downloadPDF(params){
  return request({
    url: '/upload/downloadPDF',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

export function  saveFile(uploadDto){
  return request({
    url: '/upload/saveFile',
    method: 'post',
    data: uploadDto
  })
}


export function indexUploadFile(uploadDto) {
  return request({
    url: '/upload/updateAttachmentsBatch',
    method: 'post',
    data: uploadDto
  })
}


