diff --git a/dinky-web/src/pages/DataStudio/LeftContainer/DataSource/service.tsx b/dinky-web/src/pages/DataStudio/LeftContainer/DataSource/service.tsx index e2e9869007..5a5b6245ec 100644 --- a/dinky-web/src/pages/DataStudio/LeftContainer/DataSource/service.tsx +++ b/dinky-web/src/pages/DataStudio/LeftContainer/DataSource/service.tsx @@ -18,13 +18,14 @@ */ import { handleGetOption, queryDataByParams } from '@/services/BusinessCrud'; +import { API_CONSTANTS } from '@/services/endpoints'; import { l } from '@/utils/intl'; /*--- 刷新 元数据表 ---*/ export async function showDataSourceTable(id: number) { try { const result = await handleGetOption( - 'api/database/getSchemasAndTables', + API_CONSTANTS.DATASOURCE_GET_SCHEMA_TABLES, l('pages.metadata.DataSearch'), { id: id } ); @@ -37,8 +38,8 @@ export async function showDataSourceTable(id: number) { /*--- 清理 元数据表缓存 ---*/ export function clearDataSourceTable(id: number) { - return queryDataByParams('api/database/unCacheSchemasAndTables', { id: id }); + return queryDataByParams(API_CONSTANTS.DATASOURCE_UN_CACHE_SCHEMA_TABLES, { id: id }); } export function getDataSourceList() { - return queryDataByParams('api/database/listEnabledAll'); + return queryDataByParams(API_CONSTANTS.DATASOURCE_LIST_ENABLE_ALL); } diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index 553c5d9c01..b597be5dfe 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -107,6 +107,8 @@ export enum API_CONSTANTS { DATASOURCE_CHECK_HEARTBEAT_BY_ID = '/api/database/checkHeartBeatByDataSourceId', DATASOURCE_COPY = '/api/database/copyDatabase', DATASOURCE_GET_SCHEMA_TABLES = '/api/database/getSchemasAndTables', + DATASOURCE_UN_CACHE_SCHEMA_TABLES = '/api/database/unCacheSchemasAndTables', + DATASOURCE_LIST_ENABLE_ALL = '/api/database/listEnabledAll', DATASOURCE_GET_COLUMNS_BY_TABLE = '/api/database/listColumns', DATASOURCE_GET_GEN_SQL = '/api/database/getSqlGeneration', DATASOURCE_QUERY_DATA = '/api/database/queryData',