Compare commits
10 Commits
b2109af8a6
...
zd-feature
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f258560a4 | ||
|
|
9e3b6a400d | ||
|
|
bfe41c4b99 | ||
|
|
7e13db52bf | ||
|
|
885316c990 | ||
|
|
a2b3310860 | ||
| a0194a8d38 | |||
| 25bfb2aeea | |||
|
|
e1a0a2b638 | ||
|
|
4bf1c1fe56 |
@@ -10,4 +10,5 @@ namespace Dhd\Micro\Interface\AIService;
|
||||
|
||||
interface AIService extends
|
||||
AiEssayCheckInterface,
|
||||
AiInterviewCheckInterface {}
|
||||
AiInterviewCheckInterface,
|
||||
AiInterviewTtsInterface {}
|
||||
|
||||
47
src/AIService/AiInterviewTtsInterface.php
Normal file
47
src/AIService/AiInterviewTtsInterface.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AI面试朗读(TTS)相关接口
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\AIService;
|
||||
|
||||
interface AiInterviewTtsInterface
|
||||
{
|
||||
/**
|
||||
* 朗读面试题(文字转语音):懒生成并缓存,已存在则直接返回已有音频
|
||||
* 音频按题目(question_id)生成并全局复用
|
||||
* @param array $params 参数,['question_id'=>面试题ID]
|
||||
*/
|
||||
public function interviewTtsAudio(array $params): array;
|
||||
|
||||
/**
|
||||
* 查询面试题是否已生成音频,仅查缓存不触发合成(供取题接口附带音频使用)
|
||||
* @param int $questionId 面试题ID
|
||||
*/
|
||||
public function getInterviewQuestionAudioUrl(int $questionId): ?string;
|
||||
|
||||
/**
|
||||
* 提交朗读任务(异步):已生成直接返回成功,未生成投递队列后台合成并返回排队状态
|
||||
* 音频按题目(question_id)生成并全局复用,同一题目并发只合成一次
|
||||
* @param array $params 参数,['question_id'=>面试题ID]
|
||||
*/
|
||||
public function submitInterviewTts(array $params): array;
|
||||
|
||||
/**
|
||||
* 同步面试题音频(后台创建/编辑题目后调用):按题干内容哈希判断是否已生成,
|
||||
* 内容未变跳过,内容变化或首次生成则投递队列后台合成
|
||||
* @param array $params 参数,['question_id'=>面试题ID, 'content'=>题干内容]
|
||||
* 返回 ['question_id'=>int, 'status'=>success|queued]
|
||||
*/
|
||||
public function syncInterviewQuestionTts(array $params): array;
|
||||
|
||||
/**
|
||||
* 查询朗读任务状态(供前端轮询使用)
|
||||
* @param int $questionId 面试题ID
|
||||
* 返回 ['question_id'=>int, 'status'=>queued|processing|success|failed|unknown, 'url'=>?string]
|
||||
*/
|
||||
public function getInterviewTtsStatus(int $questionId): array;
|
||||
}
|
||||
@@ -27,6 +27,12 @@ interface ConfigInterface
|
||||
*/
|
||||
public function getPublicConfigs(string $platform = '', array $types = [], array $configNames = []): array;
|
||||
|
||||
/**
|
||||
* App 端配置列表(支持 route_path / config_name 过滤,不含过滤条件时行为与 getPublicConfigs 一致).
|
||||
* @param array $params {platform:string, types:array<int>, route_path?:string, config_name?:string}
|
||||
*/
|
||||
public function appGetConfigList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取配置列表
|
||||
* @param string $platform 配置所属平台
|
||||
|
||||
@@ -6,16 +6,23 @@ namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface DailyPracticeInterface
|
||||
{
|
||||
/**
|
||||
* App 每日刷题:今日刷题情况 + 每日题目分类列表.
|
||||
*
|
||||
* 分类由编码按日期确定性随机选取;
|
||||
* 抽题复用 getExerciseQuestionList(test_type=4 每日刷题)。
|
||||
*
|
||||
* @param int $userId 用户ID
|
||||
* @return array {today_completed:int, today_total:int, list:list<{
|
||||
* category_id:int, category_name:string, question_num:int, completed:bool
|
||||
* }>}
|
||||
*/
|
||||
public function appGetDailyPractice(int $userId): array;
|
||||
}
|
||||
/**
|
||||
* App 每日刷题:今日刷题情况 + 每日题目分类列表.
|
||||
*
|
||||
* 分类由编码按日期确定性随机选取;
|
||||
* 抽题复用 getExerciseQuestionList(test_type=4 每日刷题)。
|
||||
* completed 表示该分类今日已作答 >= 组题数(默认5),部分作答未完成时下次继续展示。
|
||||
* @param int $userId 用户ID
|
||||
*/
|
||||
public function appGetDailyPractice(int $userId): array;
|
||||
|
||||
/**
|
||||
* App 每日刷题:指定分类今日作答进度与已答题目(断点续答:恢复已答题并展示剩余题数).
|
||||
*
|
||||
* 返回已答题目详情(题干/选项/用户答案/判分)供二次进入做题页恢复展示;
|
||||
*
|
||||
* @param int $userId 用户ID
|
||||
* @param int $categoryId 分类ID
|
||||
*/
|
||||
public function appGetDailyPracticeProgress(int $userId, int $categoryId): array;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,34 @@ interface ExamServiceInterface
|
||||
*/
|
||||
public function batchUpdateScores(array $params): bool;
|
||||
|
||||
/**
|
||||
* 获取错题记录首页统计(总错题数、顽固错题数、模块错题数与正确率、薄弱项).
|
||||
*/
|
||||
public function appGetWrongRecordStats(int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取错题记录模块明细(模块错题数与正确率、二级知识点错题数).
|
||||
*/
|
||||
public function appGetWrongRecordModuleDetail(int $userId, int $categoryId): array;
|
||||
|
||||
/**
|
||||
* 获取错题记录首页明细(融合首页统计与各模块知识点明细,一次返回).
|
||||
*/
|
||||
public function appGetWrongRecordDetail(int $userId): array;
|
||||
|
||||
/**
|
||||
* 提交错题记录发起的专项练习(写做题记录并更新错题,返回判分结果与正确率对比).
|
||||
*/
|
||||
public function submitWrongPractice(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户薄弱项(有错题且正确率低于阈值且正确率最低的模块;无则 null).
|
||||
*
|
||||
* 用于首页弹窗「薄弱项:{模块名}正确率低 → 攻克它 → 专项刷题」,
|
||||
* 以及错题记录页面薄弱项展示;与错题记录首页统计字段 weak_category 同口径.
|
||||
*/
|
||||
public function appGetWeakPoint(int $userId): ?array;
|
||||
|
||||
/**
|
||||
* 获取考试类型列表(V1 兼容接口).
|
||||
*/
|
||||
@@ -99,7 +127,6 @@ interface ExamServiceInterface
|
||||
*/
|
||||
public function getQuestionStoreList(array $params): array;
|
||||
|
||||
|
||||
/**
|
||||
* 提交题目答案,根据试卷类型自动选择智能组卷或普通试卷逻辑.
|
||||
*/
|
||||
|
||||
@@ -27,4 +27,10 @@ interface FileServiceInterface
|
||||
* 获取文件列表
|
||||
*/
|
||||
public function getFileList(array $params): array;
|
||||
|
||||
/**
|
||||
* 保存二进制(base64)文件,用于服务端生成的文件
|
||||
* @param array $params 参数,如 ['base64'=>.., 'file_name'=>.., 'file_type'=>.., 'group_id'=>.., 'channel'=>.., 'uploader_id'=>..]
|
||||
*/
|
||||
public function saveBase64File(array $params): array;
|
||||
}
|
||||
|
||||
@@ -45,4 +45,21 @@ interface PgUserPaperRecordInterface
|
||||
* @return void
|
||||
*/
|
||||
public function submitPgUserPaper(int $userId, array $params): void;
|
||||
|
||||
/**
|
||||
* APP获取试卷详情
|
||||
* @param int $userId 用户id
|
||||
* @param int $paperId 试卷id
|
||||
* @return array
|
||||
*/
|
||||
public function appGetPgPaperDetail(int $userId, int $paperId): array;
|
||||
|
||||
/**
|
||||
* 删除用户答题记录
|
||||
* @param int $userId 用户id
|
||||
* @param int $paperId 试卷id
|
||||
* @param int $sectionId 章节id
|
||||
* @return void
|
||||
*/
|
||||
public function deleteUserPaperRecord(int $userId, int $paperId, int $sectionId = 0): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user