import request from '@/utils/request'

// 创建客户等级规则
export function createLevelRule(data) {
  return request({
    url: '/customer/level-rule/create',
    method: 'post',
    data: data
  })
}

// 更新客户等级规则
export function updateLevelRule(data) {
  return request({
    url: '/customer/level-rule/update',
    method: 'put',
    data: data
  })
}

// 删除客户等级规则
export function deleteLevelRule(id) {
  return request({
    url: '/customer/level-rule/delete?id=' + id,
    method: 'delete'
  })
}

// 获得客户等级规则
export function getLevelRule(id) {
  return request({
    url: '/customer/level-rule/get?id=' + id,
    method: 'get'
  })
}

// 获得客户等级规则分页
export function getLevelRulePage(query) {
  return request({
    url: '/customer/level-rule/page',
    method: 'get',
    params: query
  })
}

// 导出客户等级规则 Excel
export function exportLevelRuleExcel(query) {
  return request({
    url: '/customer/level-rule/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
