import request from '@/utils/request'
export function getAllDataSources() {
  return request({
    url: '/dataSources',
    method: 'get'
  })
}



export function addDataSource(data) {
  return request({
    url: '/dataSources',
    method: 'post',
    data
  })
}
export function deleteDataSource(data) {
  return request({
    url: `/dataSources/${data.id}`,
    method: 'delete'
  })
}
export function getChartData(data) {
  // let tmp={
  //   url: '/chartDataDTO/'+data.startTime+'/'+data.endTime,
  //   method: 'get',
  //   data:data.sources
  // }
 // console.log('data', data)
  return request({
    url: '/chartDataDTOList/'+data.startTime+'/'+data.endTime,
    // url: '/chartDataDTO/2022-10-6 16:05:01/2022-10-11 19:35:01/',
    method: 'get',
    params:{
      param:data.param
    }
  })
}