提交打包
This commit is contained in:
@@ -102,6 +102,25 @@ export interface UploadFileVo {
|
||||
relativePath?: string;
|
||||
}
|
||||
|
||||
export async function uploadTempFileToJava(file: File, relativePath?: string) {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
if (relativePath) {
|
||||
formData.append('relativePath', relativePath)
|
||||
}
|
||||
const response = await http.post<JavaApiResponse<UploadFileVo>>(
|
||||
`${JAVA_API_PREFIX}/files/upload`,
|
||||
formData,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
timeout: 120000,
|
||||
},
|
||||
)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export interface DedupeResultItem {
|
||||
resultId?: number;
|
||||
sourceFilename: string;
|
||||
@@ -1452,6 +1471,7 @@ export interface AppearancePatentParsedRow {
|
||||
groupKey?: string;
|
||||
asin: string;
|
||||
country: string;
|
||||
price?: string;
|
||||
url?: string;
|
||||
title?: string;
|
||||
}
|
||||
@@ -1479,6 +1499,16 @@ export interface AppearancePatentParseVo {
|
||||
groups?: AppearancePatentParsedGroup[];
|
||||
}
|
||||
|
||||
export interface AppearancePatentParsedPayloadDto {
|
||||
aiPrompt?: string;
|
||||
apiKey?: string;
|
||||
sourceFiles?: UploadedFileRef[];
|
||||
headers?: string[];
|
||||
items?: AppearancePatentParsedRow[];
|
||||
groups?: AppearancePatentParsedGroup[];
|
||||
allItems?: AppearancePatentParsedRow[];
|
||||
}
|
||||
|
||||
export interface AppearancePatentDashboardVo {
|
||||
pendingTaskCount: number;
|
||||
processedTaskCount: number;
|
||||
@@ -1545,6 +1575,24 @@ export function parseAppearancePatent(files: UploadedFileRef[], aiPrompt: string
|
||||
);
|
||||
}
|
||||
|
||||
export function getAppearancePatentParsedPayload(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<AppearancePatentParsedPayloadDto>>(
|
||||
`${JAVA_API_PREFIX}/appearance-patent/tasks/${taskId}/parsed-payload`,
|
||||
{ params: { user_id: getCurrentUserId() } },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getAppearancePatentQueuePayload(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<AppearancePatentParsedPayloadDto>>(
|
||||
`${JAVA_API_PREFIX}/appearance-patent/tasks/${taskId}/queue-payload`,
|
||||
{ params: { user_id: getCurrentUserId() } },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getAppearancePatentDashboard() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<AppearancePatentDashboardVo>>(
|
||||
|
||||
Reference in New Issue
Block a user