import request from '@/utils/request'

// 创建客户投诉
export function createCustomerComplaint(data) {
  return request({
    url: '/ecw/customer-complaint/create',
    method: 'post',
    data: data
  })
}

// 更新客户投诉
export function updateCustomerComplaint(data) {
  return request({
    url: '/ecw/customer-complaint/update',
    method: 'put',
    data: data
  })
}

// 删除客户投诉
export function deleteCustomerComplaint(id) {
  return request({
    url: '/ecw/customer-complaint/delete?id=' + id,
    method: 'delete'
  })
}

// 获得客户投诉
export function getCustomerComplaint(id) {
  return request({
    url: '/ecw/customer-complaint/get?id=' + id,
    method: 'get'
  })
}

// 获得客户投诉分页
export function getCustomerComplaintPage(query) {
  return request({
    url: '/ecw/customer-complaint/page',
    method: 'get',
    params: query
  })
}

// 导出客户投诉 Excel
export function exportCustomerComplaintExcel(query) {
  return request({
    url: '/ecw/customer-complaint/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
