import service from '@/utils/request'
// 新增车主
export const addCarOwner = (data) => {
  return service({
    url: '/owner/create',
    method: 'post',
    data
  })
}

// 编辑车主
export const editCarOwner = (data) => {
  return service({
    url: '/owner/update',
    method: 'put',
    data
  })
}

// 根据id获取车主信息
export const carOwnerInfoId = (id) => {
  return service({
    url: '/owner/get?id=' + id,
    method: 'get'
  })
}

// 根据手机号获取车主信息
export const carOwnerInfoPhone = (phone) => {
  return service({
    url: '/owner/get-by-phone?phone=' + phone,
    method: 'get'
  })
}

// 获取车主列表
export const obtainCarOwnerList = (params) => {
  return service({
    url: '/owner/list',
    method: 'get',
    params
  })
}

// 删除车主
export const removeCarOwner = (id) => {
  return service({
    url: '/owner/delete?id=' + id,
    method: 'delete',
  })
}
