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

/**
 * 分页查询留宿申请列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/dormliveapply/page',
    method: 'get',
    params: query
  });
};

/**
 * 新增留宿申请
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/dormliveapply',
    method: 'post',
    data
  });
};

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

/**
 * 编辑留宿申请
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/dormliveapply/edit',
    method: 'post',
    data
  });
};

/**
 * 删除留宿申请
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/dormliveapply/delete',
    method: 'post',
    data: ids
  });
};

/**
 * 导出留宿申请
 * @param query
 */
export const exportData = (query?: any) => {
  return request({
    url: '/stuwork/dormliveapply/export',
    method: 'post',
    data: query,
    responseType: 'blob'
  });
};

