mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-13 08:28:22 +08:00
Refactor: Standardize naming convention to camelCase (#14079)
### What problem does this PR solve? Refactor: Standardize naming convention to camelCase ### Type of change - [x] Refactoring
This commit is contained in:
@@ -9,30 +9,30 @@ import registerServer from '@/utils/register-server';
|
||||
import request, { post } from '@/utils/request';
|
||||
|
||||
const {
|
||||
create_kb,
|
||||
rm_kb,
|
||||
get_kb_detail,
|
||||
kb_list,
|
||||
get_document_list,
|
||||
document_change_status,
|
||||
document_rm,
|
||||
document_delete,
|
||||
document_create,
|
||||
document_change_parser,
|
||||
document_thumbnails,
|
||||
chunk_list,
|
||||
create_chunk,
|
||||
set_chunk,
|
||||
get_chunk,
|
||||
switch_chunk,
|
||||
rm_chunk,
|
||||
retrieval_test,
|
||||
document_rename,
|
||||
document_run,
|
||||
document_upload,
|
||||
web_crawl,
|
||||
knowledge_graph,
|
||||
document_infos,
|
||||
createKb,
|
||||
rmKb,
|
||||
getKbDetail,
|
||||
kbList,
|
||||
getDocumentList,
|
||||
documentChangeStatus,
|
||||
documentRm,
|
||||
documentDelete,
|
||||
documentCreate,
|
||||
documentChangeParser,
|
||||
documentThumbnails,
|
||||
chunkList,
|
||||
createChunk,
|
||||
setChunk,
|
||||
getChunk,
|
||||
switchChunk,
|
||||
rmChunk,
|
||||
retrievalTest,
|
||||
documentRename,
|
||||
documentRun,
|
||||
documentUpload,
|
||||
webCrawl,
|
||||
knowledgeGraph,
|
||||
documentInfos,
|
||||
listTagByKnowledgeIds,
|
||||
setMeta,
|
||||
getMeta,
|
||||
@@ -40,71 +40,71 @@ const {
|
||||
getKnowledgeBasicInfo,
|
||||
fetchDataPipelineLog,
|
||||
fetchPipelineDatasetLogs,
|
||||
check_embedding,
|
||||
checkEmbedding,
|
||||
kbUpdateMetaData,
|
||||
documentUpdateMetaData,
|
||||
} = api;
|
||||
|
||||
const methods = {
|
||||
createKb: {
|
||||
url: create_kb,
|
||||
url: createKb,
|
||||
method: 'post',
|
||||
},
|
||||
rmKb: {
|
||||
url: rm_kb,
|
||||
url: rmKb,
|
||||
method: 'delete',
|
||||
},
|
||||
get_kb_detail: {
|
||||
url: get_kb_detail,
|
||||
getKbDetail: {
|
||||
url: getKbDetail,
|
||||
method: 'get',
|
||||
},
|
||||
getList: {
|
||||
url: kb_list,
|
||||
url: kbList,
|
||||
method: 'get',
|
||||
},
|
||||
// document manager
|
||||
get_document_list: {
|
||||
url: get_document_list,
|
||||
getDocumentList: {
|
||||
url: getDocumentList,
|
||||
method: 'get',
|
||||
},
|
||||
document_change_status: {
|
||||
url: document_change_status,
|
||||
documentChangeStatus: {
|
||||
url: documentChangeStatus,
|
||||
method: 'post',
|
||||
},
|
||||
document_rm: {
|
||||
url: document_rm,
|
||||
documentRm: {
|
||||
url: documentRm,
|
||||
method: 'post',
|
||||
},
|
||||
document_rename: {
|
||||
url: document_rename,
|
||||
documentRename: {
|
||||
url: documentRename,
|
||||
method: 'put',
|
||||
},
|
||||
document_create: {
|
||||
url: document_create,
|
||||
documentCreate: {
|
||||
url: documentCreate,
|
||||
method: 'post',
|
||||
},
|
||||
document_run: {
|
||||
url: document_run,
|
||||
documentRun: {
|
||||
url: documentRun,
|
||||
method: 'post',
|
||||
},
|
||||
document_change_parser: {
|
||||
url: document_change_parser,
|
||||
documentChangeParser: {
|
||||
url: documentChangeParser,
|
||||
method: 'post',
|
||||
},
|
||||
document_thumbnails: {
|
||||
url: document_thumbnails,
|
||||
documentThumbnails: {
|
||||
url: documentThumbnails,
|
||||
method: 'get',
|
||||
},
|
||||
document_upload: {
|
||||
url: document_upload,
|
||||
documentUpload: {
|
||||
url: documentUpload,
|
||||
method: 'post',
|
||||
},
|
||||
web_crawl: {
|
||||
url: web_crawl,
|
||||
webCrawl: {
|
||||
url: webCrawl,
|
||||
method: 'post',
|
||||
},
|
||||
document_infos: {
|
||||
url: document_infos,
|
||||
documentInfos: {
|
||||
url: documentInfos,
|
||||
method: 'post',
|
||||
},
|
||||
setMeta: {
|
||||
@@ -112,40 +112,40 @@ const methods = {
|
||||
method: 'post',
|
||||
},
|
||||
// chunk管理
|
||||
chunk_list: {
|
||||
url: chunk_list,
|
||||
chunkList: {
|
||||
url: chunkList,
|
||||
method: 'post',
|
||||
},
|
||||
create_chunk: {
|
||||
url: create_chunk,
|
||||
createChunk: {
|
||||
url: createChunk,
|
||||
method: 'post',
|
||||
},
|
||||
set_chunk: {
|
||||
url: set_chunk,
|
||||
setChunk: {
|
||||
url: setChunk,
|
||||
method: 'post',
|
||||
},
|
||||
get_chunk: {
|
||||
url: get_chunk,
|
||||
getChunk: {
|
||||
url: getChunk,
|
||||
method: 'get',
|
||||
},
|
||||
switch_chunk: {
|
||||
url: switch_chunk,
|
||||
switchChunk: {
|
||||
url: switchChunk,
|
||||
method: 'post',
|
||||
},
|
||||
rm_chunk: {
|
||||
url: rm_chunk,
|
||||
rmChunk: {
|
||||
url: rmChunk,
|
||||
method: 'post',
|
||||
},
|
||||
retrieval_test: {
|
||||
url: retrieval_test,
|
||||
retrievalTest: {
|
||||
url: retrievalTest,
|
||||
method: 'post',
|
||||
},
|
||||
knowledge_graph: {
|
||||
url: knowledge_graph,
|
||||
knowledgeGraph: {
|
||||
url: knowledgeGraph,
|
||||
method: 'get',
|
||||
},
|
||||
document_delete: {
|
||||
url: document_delete,
|
||||
documentDelete: {
|
||||
url: documentDelete,
|
||||
method: 'delete',
|
||||
},
|
||||
listTagByKnowledgeIds: {
|
||||
@@ -153,7 +153,7 @@ const methods = {
|
||||
method: 'get',
|
||||
},
|
||||
documentFilter: {
|
||||
url: api.get_dataset_filter,
|
||||
url: api.getDatasetFilter,
|
||||
method: 'post',
|
||||
},
|
||||
getMeta: {
|
||||
@@ -176,8 +176,8 @@ const methods = {
|
||||
url: fetchPipelineDatasetLogs,
|
||||
method: 'post',
|
||||
},
|
||||
get_pipeline_detail: {
|
||||
url: api.get_pipeline_detail,
|
||||
getPipelineDetail: {
|
||||
url: api.getPipelineDetail,
|
||||
method: 'get',
|
||||
},
|
||||
|
||||
@@ -187,7 +187,7 @@ const methods = {
|
||||
},
|
||||
|
||||
checkEmbedding: {
|
||||
url: check_embedding,
|
||||
url: checkEmbedding,
|
||||
method: 'post',
|
||||
},
|
||||
kbUpdateMetaData: {
|
||||
@@ -226,10 +226,10 @@ export function deleteKnowledgeGraph(knowledgeId: string) {
|
||||
}
|
||||
|
||||
export const listDataset = (params?: IFetchKnowledgeListRequestParams) =>
|
||||
request.get(api.kb_list, { params });
|
||||
request.get(api.kbList, { params });
|
||||
|
||||
export const updateKb = (datasetId: string, data: Record<string, any>) =>
|
||||
request.put(api.update_kb(datasetId), { data });
|
||||
request.put(api.updateKb(datasetId), { data });
|
||||
|
||||
export const runGraphRag = (datasetId: string) =>
|
||||
request.post(api.runGraphRag(datasetId));
|
||||
@@ -246,16 +246,16 @@ export const traceRaptor = (datasetId: string) =>
|
||||
export const listDocument = (
|
||||
params?: IFetchKnowledgeListRequestParams,
|
||||
body?: IFetchDocumentListRequestBody,
|
||||
) => request.post(api.get_document_list, { data: body || {}, params });
|
||||
) => request.post(api.getDocumentList, { data: body || {}, params });
|
||||
|
||||
export const documentFilter = (kb_id: string) =>
|
||||
request.post(api.get_dataset_filter, { kb_id });
|
||||
request.post(api.getDatasetFilter, { kb_id });
|
||||
|
||||
export const renameDocument = (
|
||||
datasetId: string,
|
||||
documentId: string,
|
||||
data: { name?: string },
|
||||
) => request.put(api.document_rename(datasetId, documentId), { data });
|
||||
) => request.put(api.documentRename(datasetId, documentId), { data });
|
||||
|
||||
export const getMetaDataService = ({
|
||||
kb_id,
|
||||
@@ -282,7 +282,10 @@ export const listDataPipelineLogDocument = (
|
||||
body?: IFetchDocumentListRequestBody,
|
||||
) => request.post(api.fetchDataPipelineLog, { data: body || {}, params });
|
||||
export const listPipelineDatasetLogs = (
|
||||
params?: IFetchKnowledgeListRequestParams,
|
||||
params?: IFetchKnowledgeListRequestParams & {
|
||||
kb_id?: string;
|
||||
keywords?: string;
|
||||
},
|
||||
body?: IFetchDocumentListRequestBody,
|
||||
) => request.post(api.fetchPipelineDatasetLogs, { data: body || {}, params });
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ const {
|
||||
ask,
|
||||
chatsMindmap,
|
||||
chatsRelatedQuestions,
|
||||
upload_and_parse,
|
||||
uploadAndParse,
|
||||
fetchExternalChatInfo,
|
||||
} = api;
|
||||
|
||||
@@ -99,7 +99,7 @@ const methods = {
|
||||
},
|
||||
uploadAndParse: {
|
||||
method: 'post',
|
||||
url: upload_and_parse,
|
||||
url: uploadAndParse,
|
||||
},
|
||||
fetchExternalChatInfo: {
|
||||
url: fetchExternalChatInfo,
|
||||
|
||||
@@ -3,12 +3,12 @@ import registerServer from '@/utils/register-server';
|
||||
import request from '@/utils/request';
|
||||
|
||||
const {
|
||||
llm_tools
|
||||
llmTools
|
||||
} = api;
|
||||
|
||||
const methods = {
|
||||
getLlmTools: {
|
||||
url: llm_tools,
|
||||
url: llmTools,
|
||||
method: 'get',
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -7,16 +7,16 @@ const {
|
||||
logout,
|
||||
register,
|
||||
setting,
|
||||
user_info,
|
||||
tenant_info,
|
||||
factories_list,
|
||||
llm_list,
|
||||
my_llm,
|
||||
set_api_key,
|
||||
set_tenant_info,
|
||||
add_llm,
|
||||
delete_llm,
|
||||
enable_llm,
|
||||
userInfo,
|
||||
tenantInfo,
|
||||
factoriesList,
|
||||
llmList,
|
||||
myLlm,
|
||||
setApiKey,
|
||||
setTenantInfo,
|
||||
addLlm,
|
||||
deleteLlm,
|
||||
enableLlm,
|
||||
deleteFactory,
|
||||
getSystemVersion,
|
||||
getSystemTokenList,
|
||||
@@ -43,44 +43,44 @@ const methods = {
|
||||
url: setting,
|
||||
method: 'post',
|
||||
},
|
||||
user_info: {
|
||||
url: user_info,
|
||||
userInfo: {
|
||||
url: userInfo,
|
||||
method: 'get',
|
||||
},
|
||||
get_tenant_info: {
|
||||
url: tenant_info,
|
||||
getTenantInfo: {
|
||||
url: tenantInfo,
|
||||
method: 'get',
|
||||
},
|
||||
set_tenant_info: {
|
||||
url: set_tenant_info,
|
||||
setTenantInfo: {
|
||||
url: setTenantInfo,
|
||||
method: 'post',
|
||||
},
|
||||
factories_list: {
|
||||
url: factories_list,
|
||||
factoriesList: {
|
||||
url: factoriesList,
|
||||
method: 'get',
|
||||
},
|
||||
llm_list: {
|
||||
url: llm_list,
|
||||
llmList: {
|
||||
url: llmList,
|
||||
method: 'get',
|
||||
},
|
||||
my_llm: {
|
||||
url: my_llm,
|
||||
myLlm: {
|
||||
url: myLlm,
|
||||
method: 'get',
|
||||
},
|
||||
set_api_key: {
|
||||
url: set_api_key,
|
||||
setApiKey: {
|
||||
url: setApiKey,
|
||||
method: 'post',
|
||||
},
|
||||
add_llm: {
|
||||
url: add_llm,
|
||||
addLlm: {
|
||||
url: addLlm,
|
||||
method: 'post',
|
||||
},
|
||||
delete_llm: {
|
||||
url: delete_llm,
|
||||
deleteLlm: {
|
||||
url: deleteLlm,
|
||||
method: 'post',
|
||||
},
|
||||
enable_llm: {
|
||||
url: enable_llm,
|
||||
enableLlm: {
|
||||
url: enableLlm,
|
||||
method: 'post',
|
||||
},
|
||||
getSystemVersion: {
|
||||
@@ -123,9 +123,9 @@ const methods = {
|
||||
|
||||
const userService = registerServer<keyof typeof methods>(methods, request);
|
||||
|
||||
export const getLoginChannels = () => request.get(api.login_channels);
|
||||
export const getLoginChannels = () => request.get(api.loginChannels);
|
||||
export const loginWithChannel = (channel: string) =>
|
||||
(window.location.href = api.login_channel(channel));
|
||||
(window.location.href = api.loginChannel(channel));
|
||||
|
||||
export const listTenantUser = (tenantId: string) =>
|
||||
request.get(api.listTenantUser(tenantId));
|
||||
|
||||
Reference in New Issue
Block a user