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

/**
 * 分页查询教学楼列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/teachbuilding/page',
    method: 'get',
    params: query
  });
};

/**
 * 获取教学楼列表（不分页）
 */
export const getBuildingList = () => {
  return request({
    url: '/stuwork/teachbuilding/list',
    method: 'get'
  });
};

/**
 * 新增教学楼
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/teachbuilding',
    method: 'post',
    data
  });
};

/**
 * 获取详情
 * @param id
 */
export const getDetail = (id: string) => {
  return request({
    url: '/stuwork/teachbuilding/detail',
    method: 'get',
    params: { id }
  });
};

/**
 * 编辑教学楼
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/teachbuilding/edit',
    method: 'post',
    data
  });
};

/**
 * 删除教学楼
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/teachbuilding/delete',
    method: 'post',
    data: ids
  });
};

