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

/**
 * 分页查询教室安排及公物管理列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/teachclassroom/fetchClassRoomBaseList',
    method: 'get',
    params: query
  });
};

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

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

/**
 * 导出教室安排
 * @param query
 */
export const exportData = (query?: any) => {
  return request({
    url: '/stuwork/classroombase/export',
    method: 'post',
    data: query,
    responseType: 'blob'
  });
};

/**
 * 同步教室安排
 */
export const syncClassroomArrangement = () => {
  return request({
    url: '/stuwork/teachclassroom/initData',
    method: 'post'
  });
};

