import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CustomerServiceInfoVO, CustomerServiceInfoForm, CustomerServiceInfoQuery } from '@/api/system/physical/customerServiceInfo/types';

/**
 * 查询客服基础信息列表
 * @param query
 * @returns {*}
 */

export const listCustomerServiceInfo = (query?: CustomerServiceInfoQuery): AxiosPromise<CustomerServiceInfoVO[]> => {
  return request({
    url: '/physical/customerServiceInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询客服基础信息详细
 * @param id
 */
export const getCustomerServiceInfo = (id: string | number): AxiosPromise<CustomerServiceInfoVO> => {
  return request({
    url: '/physical/customerServiceInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增客服基础信息
 * @param data
 */
export const addCustomerServiceInfo = (data: CustomerServiceInfoForm) => {
  return request({
    url: '/physical/customerServiceInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改客服基础信息
 * @param data
 */
export const updateCustomerServiceInfo = (data: CustomerServiceInfoForm) => {
  return request({
    url: '/physical/customerServiceInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除客服基础信息
 * @param id
 */
export const delCustomerServiceInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/physical/customerServiceInfo/' + id,
    method: 'delete'
  });
};
