import request from '@/config/axios'

// 创建
export const createCustomer = (data) => {
  return request.post({ url: '/admin-api/applet/xunjia/user/add', data, isSubmitForm: true })
}

// 修改
export const updateCustomer = (data) => {
  return request.put({ url: '/admin-api/applet/xunjia/user/update', data })
}

// 分页
export const getCustomerPage = (params) => {
  return request.get({ url: '/admin-api/applet/xunjia/user/page', params })
}

// 删除
export const deleteCustomer = (userId) => {
  return request.delete({ url: '/admin-api/applet/xunjia/user/delete', params: { userId } })
}

// 获取考试车型
export const getCustomerExamCarType = () => {
  return request.post({ url: 'https://cloud.ahduima.com//driver-api/tdTenantCar/list' })
  // return request.post({ url: import.meta.env.VITE_BASE_URL + '/driver-api/tdTenantCar/list' })
}

// 导入学员
export const importStudent = async (data) => {
  return await request.upload({ url: '/admin-api/applet/xunjia/user/import', data })
}

export const getAppletUserList = async (params) => {
  return await request.get({
    url: '/admin-api/applet/xunjia/user/pageList',
    params: params
  })
}
