import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { customerManagementForm, customerManagementQuery, customerManagementVO, customerManagementInfoVO } from './types';
/**
 * 查询用户客户列表
 * @param query
 */
export const customerUser = (query: customerManagementQuery): AxiosPromise<customerManagementVO[]> => {
  return request({
    url: '/api/customers/customer',
    method: 'get',
    params: query
  });
};
// *********新增客户*************
export const addCustomer = (data: any): AxiosPromise<customerManagementVO[]> => {
  return request({
    url: '/api/customers/addCustomer',
    method: 'post',
    data: data
  });
};

// 修改
export const updateCustomer = (data: any): AxiosPromise<customerManagementVO[]> => {
  return request({
    url: '/api/customers/updateCustomer',
    method: 'put',
    data
  })
}
// 删除
export const deleteCustomer = (ids: any): AxiosPromise<customerManagementVO[]> => {
  return request({
    url: '/api/customers/deleteCustomer',
    method: 'delete',
    data: ids
  })
}

export default { customerUser, addCustomer, updateCustomer, deleteCustomer }

