import request from './config';

export const getDataMgmtList = (): any =>
  request({
    url: `/jpt/datamanagement/`,
    method: 'get'
  });

// 中间数据表查询暂停使用
export const fetchFile = (uri: string): any =>
  request({
    url: `/jpt/files/?uri=${uri}`,
    method: 'get'
  });

export const deleteDataMgmt = (id: string): any =>
  request({
    url: `/jpt/datamanagement/?data_management_id=${id}`,
    method: 'delete'
  });

interface ITableContent {
  table_name: string;
  page: number;
  size: number;
}

export const tableContent = (params: ITableContent): any =>
  request({
    url: `/jpt/datamanagement/table_content?table_name=${params.table_name}&page=${params.page}&size=${params.size}`,
    method: 'get'
  });

export const uploadTableStatus = (id: number): any =>
  request({
    url: `/jpt/datamanagement/info?id=${id}`,
    method: 'get'
  });
