import request from '@/utils/request'

// 查询语音交互-方案列表
export function getTreeDataApi() {
  return request({
    url: '/ti/config/list',
    method: 'get'
  })
}

export function postTreeData(data) {
  return request({
    url: '/ti/config',
    method: 'post',
    data
  })
}

export function updateTreeData(data) {
  return request({
    url: '/ti/config',
    method: 'put',
    data
  })
}

export function deleteTreeData(ids) {
  return request({
    url: `/ti/config/${ids}`,
    method: 'delete'
  })
}

export function addFunction(data) {
  return request({
    url: '/ti/function',
    method: 'post',
    data
  })
}

export function getFunction(params) {
  return request({
    url: '/ti/function/list',
    method: 'get',
    params
  })
}

export function updateFunction(data) {
  return request({
    url: '/ti/function',
    method: 'put',
    data
  })
}

export function deleteFunction(ids) {
  return request({
    url: `/ti/function/${ids}`,
    method: 'delete'
  })
}