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

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

/**
 * 申请免学费
 * @param data
 */
export const applyObj = (data: any) => {
  return request({
    url: '/stuwork/tuitionfreestu/apply',
    method: 'post',
    data
  });
};

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

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

/**
 * 编辑
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/tuitionfreestu',
    method: 'put',
    data
  });
};

/**
 * 删除
 * @param id
 */
export const delObj = (id: string) => {
  return request({
    url: `/stuwork/tuitionfreestu/${id}`,
    method: 'delete'
  });
};

/**
 * 导出
 * @param query
 */
export const exportExcel = (query?: any) => {
  return request({
    url: '/stuwork/tuitionfreestu/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  });
};

