import request from "../axios";

export const tableFileUpload = data => {
  return request({
    url: '/api/cube/file/uploadToDs',
    method: 'post',
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  })
}
export const tableFileList = params => {
  return request({
    url: '/api/cube/tableFile/list',
    method: 'get',
    params
  })
}
export const tableFieldList = params => {
  return request({
    url: '/api/cube/tableColumn/listByTableName',
    method: 'get',
    params
  })
}
export const tableFunctionList = params => {
  return request({
    url: '/api/cube/function/list',
    method: 'get',
    params
  })
}
export const cubePreview = data => {
  return request({
    url: '/api/cube/data/preview',
    method: 'post',
    data
  })
}
export const cubeSave = data => {
  return request({
    url: '/api/cube/data/saveOrUpdate',
    method: 'post',
    data
  })
}
export const cubeList = params => {
  return request({
    url: '/api/cube/data/list',
    method: 'get',
    params
  })
}
export const cubeDetail = params => {
  return request({
    url: '/api/cube/data/info',
    method: 'get',
    params
  })
}
export const cubeFieldList = params => {
  return request({
    url: '/api/cube/tableColumn/list',
    method: 'get',
    params
  })
}
export const categoryList = params => {
  return request({
    url: '/api/cube/workspace/list',
    method: 'get',
    params
  })
}
export const categorySave = data => {
  return request({
    url: '/api/cube/workspace/saveOrUpdate',
    method: 'post',
    data
  })
}
export const categoryDel = params => {
  return request.post('/api/cube/workspace/delete', {}, {
    params
  })
}
export const cubeFieldDel = params => {
  return request.post('/api/cube/tableColumn/delete', {}, {
    params
  })
}
