import request from '@/utils/request'

// 查询教师实验室预约信息列表
export function listRecord(query, year, term) {
  return request({
    url: '/labbooking/record/list',
    method: 'get',
    params: query, year, term
  })
}

// 查询实验室管理员预约信息列表
export function listManagerRecord(query, year, term) {
  return request({
    url: '/labbooking/record/managerList',
    method: 'get',
    params: query, year, term
  })
}

export function collegeapply(year, term) {
  return request({
    url: '/labbooking/record/college',
    method: 'get',
    params: year, term
  })
}

export function cancel(recordIdList) {
  return request({
    url: '/labbooking/record/cancel',
    method: 'put',
    data: recordIdList
  })
}

// 新增实验室预约信息
export function addRecordAndWeek(data) {
  return request({
    url: '/labbooking/record/addRecordAndWeek',
    method: 'post',
    data: data
  })
}

// 导出实验室预约信息
export function exportRecord(query, year, term) {
  return request({
    url: '/labbooking/record/export',
    method: 'get',
    params: query, year, term
  })
}

// 管理员审批实验室预约信息
export function approve(query) {
  return request({
    url: '/labbooking/record/approve',
    method: 'put',
    data: query
  })
}

// 管理员取消实验室预约信息
export function managerCancel(query) {
  return request({
    url: '/labbooking/record/managerCancel',
    method: 'put',
    data: query
  })
}