import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ListConfigurationVO, ListConfigurationForm, ListConfigurationQuery } from '@/api/bfs/listConfiguration/types';

/**
 * 查询业务清单配置（三分四管住）列表
 * @param query
 * @returns {*}
 */

export const listListConfiguration = (query?: ListConfigurationQuery): AxiosPromise<ListConfigurationVO[]> => {
  return request({
    url: '/bfs/listConfiguration/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询业务清单配置（三分四管住）详细
 * @param id
 */
export const getListConfiguration = (id: string | number): AxiosPromise<ListConfigurationVO> => {
  return request({
    url: '/bfs/listConfiguration/' + id,
    method: 'get'
  });
};

/**
 * 新增业务清单配置（三分四管住）
 * @param data
 */
export const addListConfiguration = (data: ListConfigurationForm) => {
  return request({
    url: '/bfs/listConfiguration',
    method: 'post',
    data: data
  });
};

/**
 * 修改业务清单配置（三分四管住）
 * @param data
 */
export const updateListConfiguration = (data: ListConfigurationForm) => {
  return request({
    url: '/bfs/listConfiguration',
    method: 'put',
    data: data
  });
};

/**
 * 删除业务清单配置（三分四管住）
 * @param id
 */
export const delListConfiguration = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bfs/listConfiguration/' + id,
    method: 'delete'
  });
};
