import request, { postBlob, getBlob, handleImport } from '@/utils/request'

export function enginPayList(data) {
  return request({
    url: `/engin/pay/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function enginPayListExport(data, name) {
  return postBlob({
    url: '/engin/pay/list/export',
    data,
    name
  })
}

export function enginPayImport(data) {
  return handleImport('/engin/pay/import', data.formdata, data.id || '')
}

export function enginPayGatherList(data) {
  return request({
    url: `/engin/pay/gather/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function enginPayGatherListExport(data, name) {
  return postBlob({
    url: '/engin/pay/gather/list/export',
    data,
    name
  })
}

export function enginPaySave(data) {
  return request({
    url: `/engin/pay/save`,
    method: 'post',
    data
  })
}

export function enginPayConfirm(params) {
  return request({
    url: `/engin/pay/confirm`,
    method: 'post',
    params
  })
}

export function enginPayPay(params) {
  return request({
    url: `/engin/pay/pay`,
    method: 'post',
    params
  })
}

export function enginPayDetail(params) {
  return request({
    url: `/engin/pay/detail`,
    method: 'post',
    params
  })
}