import request from '@/utils/request'

// 查询学生列表
export function listStudent(query) {
  return request({
    url: '/learn/student/list',
    method: 'get',
    params: query
  })
}

// 查询学生详细
export function getStudent(studentId) {
  return request({
    url: '/learn/student/' + studentId,
    method: 'get'
  })
}

// 新增学生
export function addStudent(data) {
  return request({
    url: '/learn/student',
    method: 'post',
    data: data
  })
}

// 修改学生
export function updateStudent(data) {
  return request({
    url: '/learn/student',
    method: 'put',
    data: data
  })
}

// 删除学生
export function delStudent(studentId) {
  return request({
    url: '/learn/student/' + studentId,
    method: 'delete'
  })
}

// 统计学习记录
export function statisticStudyRecord(query) {
  return request({
    url: '/learn/student/statisticStudyRecord',
    method: 'get',
    params: query,
    timeout: 40000  // 设置超时时间为40秒
  })
}
