import request from '@/utils/request'

// 创建国家区号
export function createCountry(data) {
  return request({
    url: '/ecw/country/create',
    method: 'post',
    data: data
  })
}

// 更新国家区号
export function updateCountry(data) {
  return request({
    url: '/ecw/country/update',
    method: 'put',
    data: data
  })
}

// 删除国家区号
export function deleteCountry(id) {
  return request({
    url: '/ecw/country/delete?id=' + id,
    method: 'delete'
  })
}

// 获得国家区号
export function getCountry(id) {
  return request({
    url: '/ecw/country/get?id=' + id,
    method: 'get'
  })
}

// 获得所有国家区号
export function getCountryListAll() {
  return request({
    url: '/ecw/country/list-all',
    method: 'get'
  })
}

// 获得国家区号分页
export function getCountryPage(query) {
  return request({
    url: '/ecw/country/page',
    method: 'get',
    params: query
  })
}

// 导出国家区号 Excel
export function exportCountryExcel(query) {
  return request({
    url: '/ecw/country/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
