import { api, downloadFile, createApiUrl} from '~/utils/axios';


                       /**
                       * 导出留言
                       * @param {Object} data
                       * @return {Promise} api
                       */
                       export function exportExcel(data) {
                           downloadFile(createApiUrl('LeaveMessage.LeaveMessage/exportExcel'), data);
                       }
                       







/**
 * 获取留言列表
 * @param {Object} data
 * @return {Promise} api
 */
export function getLeaveMessageList(data) {
  return api.post('LeaveMessage.LeaveMessage/getLeaveMessageList', data);
}

/**
 * 删除留言
 * @param {Object} data
 * @return {Promise} api
 */
export function deleteLeaveMessage(data) {
  return api.post('LeaveMessage.LeaveMessage/deleteLeaveMessage', data, {
    isTransformResponse: true,
    isShowSuccessMessage: true,
    errorMessageText: '删除失败'
  });
}

/**
 * 添加留言
 * @param {Object} data
 * @return {Promise} api
 */
export function addLeaveMessage(data) {
  return api.post('LeaveMessage.LeaveMessage/addLeaveMessage', data, {
    isTransformResponse: true,
    isShowSuccessMessage: true,
    errorMessageText: '添加失败'
  });
}
/**
 * 编辑留言
 * @param {Object} data
 * @return {Promise} api
 */
export function editLeaveMessage(data) {
  return api.post('LeaveMessage.LeaveMessage/editLeaveMessage', data, {
    isTransformResponse: true,
    isShowSuccessMessage: true,
    errorMessageText: '编辑失败'
  });
}
