AI 面试 /start 动态出题、/finish 按真实回答结构化评分(未配模型用本地 Rubric 估分);案例沉淀 /upload 改 multipart 真实语音+ASR 转写, /organize 用真实 transcript 调 chat 模型整理;seed service 重构为 AihrInterviewService/AihrCaseService;前端面试/案例/对练页与移动端、 demo-check、验收文档同步真实链路口径。
76 lines
1.5 KiB
TypeScript
76 lines
1.5 KiB
TypeScript
import request from '@/utils/request';
|
|
|
|
type ApiResult<T> = {
|
|
code: number;
|
|
msg: string;
|
|
data: T;
|
|
};
|
|
|
|
export type CaseTag = {
|
|
text: string;
|
|
type: string;
|
|
};
|
|
|
|
export type CaseSummaryItem = {
|
|
label: string;
|
|
text: string;
|
|
};
|
|
|
|
export type CaseRecord = {
|
|
title: string;
|
|
type: string;
|
|
status: string;
|
|
time: string;
|
|
owner: string;
|
|
summary: string;
|
|
};
|
|
|
|
export type CaseUploadResponse = {
|
|
caseId: string;
|
|
fileName: string;
|
|
transcript: string;
|
|
tags: CaseTag[];
|
|
source: string;
|
|
};
|
|
|
|
export type CaseOrganizeResponse = {
|
|
caseId: string;
|
|
summary: CaseSummaryItem[];
|
|
tags: CaseTag[];
|
|
aiSummary: string;
|
|
source: string;
|
|
};
|
|
|
|
export type CaseCurateResponse = {
|
|
selectedCaseIds: string[];
|
|
records: CaseRecord[];
|
|
sampleHint: string;
|
|
};
|
|
|
|
export function uploadCaseAudio(data: FormData): Promise<ApiResult<CaseUploadResponse>> {
|
|
return request({
|
|
url: '/api/knowledge/case/upload',
|
|
method: 'post',
|
|
data,
|
|
headers: { repeatSubmit: false }
|
|
});
|
|
}
|
|
|
|
export function organizeKnowledgeCase(data: { caseId: string }): Promise<ApiResult<CaseOrganizeResponse>> {
|
|
return request({
|
|
url: '/api/knowledge/case/organize',
|
|
method: 'post',
|
|
data,
|
|
headers: { repeatSubmit: false }
|
|
});
|
|
}
|
|
|
|
export function curateKnowledgeCase(data: { caseId: string; criteria: string; limit: number }): Promise<ApiResult<CaseCurateResponse>> {
|
|
return request({
|
|
url: '/api/knowledge/case/curate',
|
|
method: 'post',
|
|
data,
|
|
headers: { repeatSubmit: false }
|
|
});
|
|
}
|