chore: initialize wygj monorepo

This commit is contained in:
2026-07-03 01:25:10 +08:00
commit 62ffcb6e99
1248 changed files with 137340 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
import request from '@/utils/request';
type ApiResult<T> = {
code: number;
msg: string;
data: T;
};
export type SopDoc = {
title: string;
desc: string;
hit: string;
type: string;
};
export type SopSnippet = {
title: string;
text: string;
};
export type SopRecord = {
title: string;
category: string;
version: string;
status: string;
owner: string;
summary: string;
};
export type SopSearchResponse = {
queryText: string;
category: string;
answer: string;
reference: string;
docs: SopDoc[];
snippets: SopSnippet[];
training: string[];
records: SopRecord[];
};
export type SopUploadResponse = {
docId: string;
ossId: number;
fileName: string;
category: string;
fragments: number;
summary: string;
tags: string[];
snippets: SopSnippet[];
};
export function searchKnowledgeSop(data: { queryText: string; category: string; limit: number }): Promise<ApiResult<SopSearchResponse>> {
return request({
url: '/api/knowledge/search',
method: 'post',
data,
headers: { repeatSubmit: false }
});
}
export function uploadKnowledgeDoc(data: FormData): Promise<ApiResult<SopUploadResponse>> {
return request({
url: '/api/knowledge/doc/upload',
method: 'post',
data,
headers: { repeatSubmit: false }
});
}