import request from '@/config/axios'

export interface CountriesVO {
  id: number
  cnName: string
  enName: string
  localName: string
  countryCode: string
  phoneCode: string
  flagIcon: string
}

// 查询国家列列表
export const getCountriesPage = async (params) => {
  return await request.get({ url: `/member/countries/page`, params })
}

// 查询国家列详情
export const getCountries = async (id: number) => {
  return await request.get({ url: `/member/countries/get?id=` + id })
}

// 新增国家列
export const createCountries = async (data: CountriesVO) => {
  return await request.post({ url: `/member/countries/create`, data })
}

// 修改国家列
export const updateCountries = async (data: CountriesVO) => {
  return await request.put({ url: `/member/countries/update`, data })
}

// 删除国家列
export const deleteCountries = async (id: number) => {
  return await request.delete({ url: `/member/countries/delete?id=` + id })
}

// 导出国家列 Excel
export const exportCountries = async (params) => {
  return await request.download({ url: `/member/countries/export-excel`, params })
}
