import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FacilitiesVO, FacilitiesForm, FacilitiesQuery } from '@/api/system/facilities/types';

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

export const listFacilities = (query?: FacilitiesQuery): AxiosPromise<FacilitiesVO[]> => {
  return request({
    url: '/system/facilities/list',
    method: 'get',
    params: query
  });
};

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

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

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

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