import request from '@/utils/request';

// 查询题目列表
export function listQuestion(query: any) {
  return request({
    url: '/system/question/list',
    method: 'get',
    params: query
  });
}

// 查询题目详细
export function getQuestion(id: string | number) {
  return request({
    url: '/system/question/' + id,
    method: 'get'
  });
}

// 新增题目
export function addQuestion(data: any) {
  return request({
    url: '/system/question',
    method: 'post',
    data: data
  });
}

// 修改题目
export function updateQuestion(data: any) {
  return request({
    url: '/system/question',
    method: 'put',
    data: data
  });
}

// 删除题目
export function delQuestion(id: string | number | (string | number)[]) {
  return request({
    url: '/system/question/' + id,
    method: 'delete'
  });
}

// 查询分类树
export function getCategoryTree() {
  return request({
    url: '/system/question/category/tree',
    method: 'get'
  });
}

// 获取级别配置
export function getLevelConfig() {
  return request({
    url: '/system/question/level/list',
    method: 'get'
  });
}

// 保存级别配置
export function saveLevelConfig(data: any) {
  return request({
    url: '/system/question/level',
    method: 'post',
    data: data
  });
}
