import request from '@/utils/request'

// 查询错题本列表
export function listUserBook(query) {
  return request({
    url: '/elearn/userBook/list',
    method: 'get',
    params: query
  })
}

// 查询错题本详细
export function getUserBook(id) {
  return request({
    url: '/elearn/userBook/' + id,
    method: 'get'
  })
}

// 题库练习
export function nextBookQu(data) {
  return request({
    url: '/elearn/userBook/nextBookQu',
    method: 'post',
    data: data
  })
}

// 题库练习
export function removBookQu(data) {
  return request({
    url: '/elearn/userBook/removBookQu',
    method: 'post',
    data: data
  })
}



// 新增错题本
export function addUserBook(data) {
  return request({
    url: '/elearn/userBook',
    method: 'post',
    data: data
  })
}

// 修改错题本
export function updateUserBook(data) {
  return request({
    url: '/elearn/userBook',
    method: 'put',
    data: data
  })
}

// 删除错题本
export function delUserBook(id) {
  return request({
    url: '/elearn/userBook/' + id,
    method: 'delete'
  })
}

// 导出错题本
export function exportUserBook(query) {
  return request({
    url: '/elearn/userBook/export',
    method: 'get',
    params: query
  })
}
