import { requestClient } from '#/api/request';

export namespace DatabaseApi {
  export interface DbTableItem {
    name: string;
    entityName: string;
    description: string;
  }

  export interface DbColumnItem {
    entityName: string;
    columnName: string;
    description: string;
    dataType: string;
    netType: string;
  }
  export const getList = (configid: string) =>
    requestClient.get<DbTableItem[]>(`/database/table/list/${configid}`);

  export const getColumnList = (tablename: string, configid: string) =>
    requestClient.get<DbColumnItem[]>(
      `/database/column/list/${tablename}/${configid}`,
    );
}
