import request from '/@/utils/request';

/**
 * 分页查询宿舍楼列表
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/dormbuilding/newPage',
    method: 'get',
    params: query
  });
};

/**
 * 获取楼号列表
 */
export const getBuildingList = () => {
  return request({
    url: '/stuwork/dormbuilding/list',
    method: 'get'
  });
};

/**
 * 新增宿舍楼
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/dormbuilding',
    method: 'post',
    data
  });
};

/**
 * 编辑宿舍楼
 */
export const putObj = (data: any) => {
  return request({
    url: '/stuwork/dormbuilding/edit',
    method: 'post',
    data
  });
};

/**
 * 删除宿舍楼
 */
export const delObjs = (ids: string[]) => {
  return request({
    url: '/stuwork/dormbuilding/delete',
    method: 'post',
    data: ids
  });
};

/**
 * 获取宿舍楼详情
 */
export const getObj = (id: string) => {
  return request({
    url: `/stuwork/dormbuilding/detail`,
    method: 'get',
    params: { id }
  });
};

