import request from '@/config/axios'

export interface UserExtensionVO {
  id: number
  userId: number
  firstName: string
  lastName: string
  email: string
  country: string
  streetAddress: string
  state: string
  postalCode: string
  language: string
  userZone: string
}

// 查询用户信息扩展列表
export const getUserExtensionPage = async (params) => {
  return await request.get({ url: `/member/user-extension/page`, params })
}

// 查询用户信息扩展详情
export const getUserExtension = async (id: number) => {
  return await request.get({ url: `/member/user-extension/get?id=` + id })
}

// 新增用户信息扩展
export const createUserExtension = async (data: UserExtensionVO) => {
  return await request.post({ url: `/member/user-extension/create`, data })
}

// 修改用户信息扩展
export const updateUserExtension = async (data: UserExtensionVO) => {
  return await request.put({ url: `/member/user-extension/update`, data })
}

// 删除用户信息扩展
export const deleteUserExtension = async (id: number) => {
  return await request.delete({ url: `/member/user-extension/delete?id=` + id })
}

// 导出用户信息扩展 Excel
export const exportUserExtension = async (params) => {
  return await request.download({ url: `/member/user-extension/export-excel`, params })
}
