import request from '@/utils/request';
import { AxiosPromise } from 'axios';

// 获取数据源列表
export function getDataSources(): AxiosPromise<any> {
  return request({
    url: '/system/report/datasource/list',
    method: 'get'
  });
}

// 获取数据源字段
export function getDataSourceFields(params: { viewIds: string[] }): AxiosPromise<any> {
  return request({
    url: '/system/report/datasource/fields',
    method: 'get',
    params: params
  });
}

// 获取数据字典
export function getDictionaries(dictTypes: string[]): AxiosPromise<any> {
  return request({
    url: '/system/report/datasource/dict',
    method: 'get',
    params: { dictTypes }
  });
}
