import request from '@/utils/request'

// 创建留言
export function createMessageLeave(data) {
  return request({
    url: '/ecw/message-leave/create',
    method: 'post',
    data: data
  })
}

// 回复留言
export function replyMessageLeave(data) {
  return request({
    url: '/ecw/message-leave/reply',
    method: 'put',
    data: data
  })
}

// 编辑留言的回复
export function updateReply(data) {
  return request({
    url: '/ecw/message-leave/updateReply',
    method: 'put',
    data: data
  })
}

// 删除留言
export function deleteMessageLeave(id) {
  return request({
    url: '/ecw/message-leave/delete?id=' + id,
    method: 'delete'
  })
}

// 获得留言
export function getMessageLeave(id) {
  return request({
    url: '/ecw/message-leave/get?id=' + id,
    method: 'get'
  })
}

// 获得留言分页
export function getMessageLeavePage(query) {
  return request({
    url: '/ecw/message-leave/page',
    method: 'get',
    params: query
  })
}

// 导出留言 Excel
export function exportMessageLeaveExcel(query) {
  return request({
    url: '/ecw/message-leave/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
