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

/**
 * 分页查询在线书浏览记录列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/onlinebooksbrowsinghistory/page',
    method: 'get',
    params: query
  });
};

/**
 * 获取在线书浏览记录列表（用于下拉选择）
 * @param query
 */
export const getList = (query?: any) => {
  return request({
    url: '/stuwork/onlinebooksbrowsinghistory/list',
    method: 'get',
    params: query
  });
};

/**
 * 新增在线书浏览记录
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/onlinebooksbrowsinghistory',
    method: 'post',
    data
  });
};

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

/**
 * 编辑在线书浏览记录
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/onlinebooksbrowsinghistory/edit',
    method: 'post',
    data
  });
};

/**
 * 删除在线书浏览记录
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/onlinebooksbrowsinghistory/delete',
    method: 'post',
    data: ids
  });
};

