import request from '@/utils/request'

// 创建客诉档案
export function createElectronicCustomerComplaint(data) {
  return request({
    url: '/ea/electronic-customer-complaint/create',
    method: 'post',
    data: data
  })
}

// 更新客诉档案
export function updateElectronicCustomerComplaint(data) {
  return request({
    url: '/ea/electronic-customer-complaint/update',
    method: 'put',
    data: data
  })
}

// 删除客诉档案
export function deleteElectronicCustomerComplaint(id) {
  return request({
    url: '/ea/electronic-customer-complaint/delete?id=' + id,
    method: 'delete'
  })
}

// 获得客诉档案
export function getElectronicCustomerComplaint(id) {
  return request({
    url: '/ea/electronic-customer-complaint/get?id=' + id,
    method: 'get'
  })
}

// 获得客诉档案分页
export function getElectronicCustomerComplaintPage(query) {
  return request({
    url: '/ea/electronic-customer-complaint/page',
    method: 'get',
    params: query
  })
}

// 导出客诉档案 Excel
export function exportElectronicCustomerComplaintExcel(query) {
  return request({
    url: '/ea/electronic-customer-complaint/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
