import request from '@/utils/request'

// 查询国家列表
export function listCountry(query) {
  return request({
    url: '/user/country/list',
    method: 'get',
    params: query
  })
}

// 查询所有国家列表
export function getAllNationList() {
  return request({
    url: '/user/country/getAllNationList',
    method: 'get'
  })
}

export function getAllNationNeedLanguageList(language) {
  return request({
    url: '/user/country/getAllNationNeedLanguageList/' + language,
    method: 'get'
  })
}

// 查询国家详细
export function getCountry(countryId) {
  return request({
    url: '/user/country/' + countryId,
    method: 'get'
  })
}

// 新增国家
export function addCountry(data) {
  return request({
    url: '/user/country',
    method: 'post',
    data: data
  })
}

// 修改国家
export function updateCountry(data) {
  return request({
    url: '/user/country',
    method: 'put',
    data: data
  })
}

// 删除国家
export function delCountry(countryId) {
  return request({
    url: '/user/country/' + countryId,
    method: 'delete'
  })
}
