import request from '@/utils/request'

// 查询知识点树列表
export function listKnowledge(query) {
  return request({
    url: '/learn/knowledgeTree/list',
    method: 'get',
    params: query
  })
}

export function listKnowledgeTree(query) {
  return request({
    url: '/learn/knowledgeTree/tree',
    method: 'get',
    params: query
  })
}

// 查询知识点树详细
export function getKnowledgeTree(id) {
  return request({
    url: '/learn/knowledgeTree/' + id,
    method: 'get'
  })
}

// 批量查询知识点树详细
export function getKnowledgeTreeBatch(ids) {
  return request({
    url: '/learn/knowledgeTree/getKnowledgeByIds',
    method: 'post',
    data: ids
  })
}

// 新增知识点树
export function addKnowledgeTree(data) {
  return request({
    url: '/learn/knowledgeTree',
    method: 'post',
    data: data
  })
}

// 修改知识点树
export function updateKnowledgeTree(data) {
  return request({
    url: '/learn/knowledgeTree',
    method: 'put',
    data: data
  })
}

// 删除知识点树
export function delKnowledgeTree(id) {
  return request({
    url: '/learn/knowledgeTree/' + id,
    method: 'delete'
  })
}
