import request from '@/utils/request'

// 创建信用等级
export function createCredit(data) {
  return request({
    url: '/customer/credit/create',
    method: 'post',
    data: data
  })
}

// 更新信用等级
export function updateCredit(data) {
  return request({
    url: '/customer/credit/update',
    method: 'put',
    data: data
  })
}

// 删除信用等级
export function deleteCredit(id) {
  return request({
    url: '/customer/credit/delete?id=' + id,
    method: 'delete'
  })
}

// 获得信用等级
export function getCredit(id) {
  return request({
    url: '/customer/credit/get?id=' + id,
    method: 'get'
  })
}

// 获得信用等级分页
export function getCreditPage(query) {
  return request({
    url: '/customer/credit/page',
    method: 'get',
    params: query
  })
}

// 导出信用等级 Excel
export function exportCreditExcel(query) {
  return request({
    url: '/customer/credit/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
