diff --git a/src/AIService/AiInterviewTtsInterface.php b/src/AIService/AiInterviewTtsInterface.php index b69e16d..90076ae 100644 --- a/src/AIService/AiInterviewTtsInterface.php +++ b/src/AIService/AiInterviewTtsInterface.php @@ -23,6 +23,15 @@ interface AiInterviewTtsInterface */ public function getInterviewQuestionAudioUrl(int $questionId): ?string; + /** + * 批量查询面试题音频生成状态(管理列表使用):仅查询不触发合成。 + * 以文件中心按当前题干哈希精确匹配为准判断是否已生成, + * 未生成时结合 Redis 状态键区分排队/合成中/失败。 + * @param array $questions 题目列表,元素结构 ['question_id'=>面试题ID, 'content'=>题干内容] + * @return array [面试题ID => ['status'=>queued|processing|success|failed|unknown, 'audio_url'=>?string]] + */ + public function getInterviewQuestionAudioMap(array $questions): array; + /** * 提交朗读任务(异步):已生成直接返回成功,未生成投递队列后台合成并返回排队状态 * 音频按题目(question_id)生成并全局复用,同一题目并发只合成一次 diff --git a/src/ExamService/JsonRpcInterface/AiInterviewQuestionInterface.php b/src/ExamService/JsonRpcInterface/AiInterviewQuestionInterface.php index 77161df..a4f897e 100644 --- a/src/ExamService/JsonRpcInterface/AiInterviewQuestionInterface.php +++ b/src/ExamService/JsonRpcInterface/AiInterviewQuestionInterface.php @@ -11,6 +11,20 @@ interface AiInterviewQuestionInterface */ public function getAiInterviewQuestionList(array $params): array; + /** + * 管理端获取面试题列表(平台方法):在通用列表基础上逐行附加音频生成状态 audio + * @param array $params 查询参数,同 getAiInterviewQuestionList + * @return array 同通用列表结构,行内新增 audio: ['status'=>string, 'audio_url'=>?string] + */ + public function adminGetAiInterviewQuestionList(array $params): array; + + /** + * 管理端批量查询面试题音频生成状态(前端轮询使用):仅查询不触发合成 + * @param array $questionIds 面试题ID列表 + * @return array [面试题ID => ['status'=>queued|processing|success|failed|unknown, 'audio_url'=>?string]] + */ + public function getAiInterviewQuestionTtsStatus(array $questionIds): array; + /** * 获取面试题详情 * @param int $id 面试题id