import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ParticipantsVO, ParticipantsForm, ParticipantsQuery } from '@/api/system/business/participants/types';

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

export const listParticipants = (query?: ParticipantsQuery): AxiosPromise<ParticipantsVO[]> => {
  return request({
    url: '/business/participants/list',
    method: 'get',
    params: query
  });
};

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

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

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

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