面试记录落 aihr_interview_result(GET /records 查询),候选人补充资料 走 OSS + aihr_candidate_material,管理端 AI 面试页可审核通过/驳回; 案例整理服务增强;两张新表纳入 reset 脚本。
138 lines
3.0 KiB
TypeScript
138 lines
3.0 KiB
TypeScript
import request from '@/utils/request';
|
|
|
|
type ApiResult<T> = {
|
|
code: number;
|
|
msg: string;
|
|
data: T;
|
|
};
|
|
|
|
export type InterviewStartRequest = {
|
|
candidateId: string;
|
|
positionCode: string;
|
|
mode: string;
|
|
};
|
|
|
|
export type InterviewQuestionResponse = {
|
|
questionId: string;
|
|
seq: number;
|
|
questionText: string;
|
|
point: string;
|
|
scenario: string;
|
|
sampleAnswer: string;
|
|
};
|
|
|
|
export type InterviewStartResponse = {
|
|
sessionId: string;
|
|
candidateId: string;
|
|
candidateName: string;
|
|
positionCode: string;
|
|
questions: InterviewQuestionResponse[];
|
|
source: string;
|
|
};
|
|
|
|
export type InterviewAnswerRequest = {
|
|
sessionId: string;
|
|
questionId: string;
|
|
answerText?: string;
|
|
answerAudioUrl?: string;
|
|
};
|
|
|
|
export type InterviewAnswerResponse = {
|
|
score: number;
|
|
dimensions: Record<string, number>;
|
|
aiComment: string;
|
|
};
|
|
|
|
export type InterviewFinishRequest = {
|
|
sessionId: string;
|
|
answers: Record<string, string>;
|
|
};
|
|
|
|
export type InterviewFinishResponse = {
|
|
totalScore: number;
|
|
suggestion: string;
|
|
result: string;
|
|
aiSummary: string;
|
|
evidence: string;
|
|
dimensions: Array<{
|
|
label: string;
|
|
value: number | string;
|
|
note: string;
|
|
}>;
|
|
records: InterviewRecord[];
|
|
source: string;
|
|
};
|
|
|
|
export type InterviewRecord = {
|
|
time: string;
|
|
candidate: string;
|
|
position: string;
|
|
score: number;
|
|
result: string;
|
|
summary: string;
|
|
};
|
|
|
|
export type CandidateMaterialReview = {
|
|
id: number | string;
|
|
candidateId: string;
|
|
candidateName: string;
|
|
ossId: number | string;
|
|
fileName: string;
|
|
materialType: string;
|
|
fileSize: number;
|
|
status: string;
|
|
time: string;
|
|
};
|
|
|
|
export function startInterview(data: InterviewStartRequest): Promise<ApiResult<InterviewStartResponse>> {
|
|
return request({
|
|
url: '/api/recruit/interview/start',
|
|
method: 'post',
|
|
data,
|
|
headers: { repeatSubmit: false }
|
|
});
|
|
}
|
|
|
|
export function submitInterviewAnswer(data: InterviewAnswerRequest): Promise<ApiResult<InterviewAnswerResponse>> {
|
|
return request({
|
|
url: '/api/recruit/interview/answer',
|
|
method: 'post',
|
|
data,
|
|
headers: { repeatSubmit: false }
|
|
});
|
|
}
|
|
|
|
export function finishInterview(data: InterviewFinishRequest): Promise<ApiResult<InterviewFinishResponse>> {
|
|
return request({
|
|
url: '/api/recruit/interview/finish',
|
|
method: 'post',
|
|
data,
|
|
headers: { repeatSubmit: false }
|
|
});
|
|
}
|
|
|
|
export function listInterviewRecords(limit = 20): Promise<ApiResult<InterviewRecord[]>> {
|
|
return request({
|
|
url: '/api/recruit/interview/records',
|
|
method: 'get',
|
|
params: { limit }
|
|
});
|
|
}
|
|
|
|
export function listCandidateMaterialsForReview(status = ''): Promise<ApiResult<CandidateMaterialReview[]>> {
|
|
return request({
|
|
url: '/api/aihr/hr/candidate/materials',
|
|
method: 'get',
|
|
params: { status }
|
|
});
|
|
}
|
|
|
|
export function reviewCandidateMaterial(id: number | string, status: string): Promise<ApiResult<CandidateMaterialReview>> {
|
|
return request({
|
|
url: `/api/aihr/hr/candidate/materials/${id}/review`,
|
|
method: 'post',
|
|
data: { status },
|
|
headers: { repeatSubmit: false }
|
|
});
|
|
}
|