import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ReceiversVO, ReceiversForm, ReceiversQuery } from '@/api/system/business/receivers/types';

/**
 * 查询【请填写功能名称】列表
 * @param query
 * @returns {*}
 */

export const listReceivers = (query?: ReceiversQuery): AxiosPromise<ReceiversVO[]> => {
  return request({
    url: '/business/receivers/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param id
 */
export const getReceivers = (id: string | number): AxiosPromise<ReceiversVO> => {
  return request({
    url: '/business/receivers/' + id,
    method: 'get'
  });
};

/**
 * 新增【请填写功能名称】
 * @param data
 */
export const addReceivers = (data: ReceiversForm) => {
  return request({
    url: '/business/receivers',
    method: 'post',
    data: data
  });
};

/**
 * 修改【请填写功能名称】
 * @param data
 */
export const updateReceivers = (data: ReceiversForm) => {
  return request({
    url: '/business/receivers',
    method: 'put',
    data: data
  });
};

/**
 * 删除【请填写功能名称】
 * @param id
 */
export const delReceivers = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/receivers/' + id,
    method: 'delete'
  });
};
