import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { RoomVO, RoomForm, RoomQuery } from '@/api/system/room/types';

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

export const listRoom = (query?: RoomQuery): AxiosPromise<RoomVO[]> => {
  return request({
    url: '/system/room/list',
    method: 'get',
    params: query
  });
};

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

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

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

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