import request from '@/utils/request'

// 查询题库列表
export function listRepo(query) {
  return request({
    url: '/exam/repo/list',
    method: 'get',
    params: query
  })
}

// 查询题库下拉列表
export function optionRepo(data) {
  return request({
    url: '/exam/repo/queryOption',
    method: 'post',
    data: data
  })
}

// 查询题库详细
export function getRepo(id) {
  return request({
    url: '/exam/repo/' + id,
    method: 'get'
  })
}
// 根据主键查询考试明细
export function getRepoInfo(id) {
  return request({
    url: '/exam/exam/' + id,
    method: 'get'
  })
}

// 新增题库
export function addRepo(data) {
  return request({
    url: '/exam/repo',
    method: 'post',
    data: data
  })
}

// 修改题库
export function updateRepo(data) {
  return request({
    url: '/exam/repo',
    method: 'put',
    data: data
  })
}

// 删除题库
export function delRepo(id) {
  return request({
    url: '/exam/repo/' + id,
    method: 'delete'
  })
}

// 新增考试
export function addExam(data) {
  return request({
    url: '/exam/exam',
    method: 'post',
    data: data
  })
}
// 修改考试
export function upExam(data) {
  return request({
    url: '/exam/exam',
    method: 'put',
    data: data
  })
}
