import { request } from '@/utils/request'

export function getCustomer(id) {
  return request({
    url: '/archieves/customer/' + id,
    method: 'get'
  })
}

export function listAllCustomer(query) {
  return request({
    url: '/archieves/customer/listAll',
    method: 'get',
    params: query
  })
}

// 新增用户
export function addCustomer(data) {
  return request({
    url: '/archieves/customer',
    method: 'post',
    data: data
  })
}

export function listCustomer(query) {
  return request({
    url: '/archieves/customer/list',
    method: 'get',
    data: query
  })
}

export function changeCustomerStatus(id, status) {
  return request({
    url: '/archieves/customer/changeStatus',
    method: 'put',
    data: { id, status }
  })
}

// 编辑用户
export function updateCustomer(data) {
  return request({
    url: '/archieves/customer',
    method: 'put',
    data: data
  })
}
/**
 * 下单页宠主列表
 * @Author: Antigravity
 */
export function listCustomerOnOrder(query) {
  return request({
    url: '/archieves/customer/listOnOrder',
    method: 'get',
    params: query
  })
}
