每日刷题 核心接口契约

This commit is contained in:
堂吉诃德拉曼查的英豪
2026-08-21 11:43:17 +08:00
parent 6666307ce1
commit ffcabc9369
3 changed files with 32 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ use Dhd\Micro\Interface\ExamService\JsonRpcInterface\SmartPaperInterface;
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\CampusRelationInterface;
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\PaperImportInterface;
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\QuestionNoteInterface;
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\DailyPracticeInterface;
interface ExamService extends
ExamServiceInterface,
@@ -31,4 +32,5 @@ interface ExamService extends
SmartPaperInterface,
CampusRelationInterface,
PaperImportInterface,
QuestionNoteInterface {}
QuestionNoteInterface,
DailyPracticeInterface {}

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
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;
}

View File

@@ -89,4 +89,12 @@ interface QuestionInterface
* @return array
*/
public function getUserQuestionRecordDetailListV2(string $testCode, int $userId): array;
/**
* 获取刷题题目,V2版本(原抽题方式,无 success 包装)
* @param array $params 参数(num/category_id/parent_category_id/campus_id/exam_type_id/subject_id/test_type/is_fast/get_correct)
* @param int $userId 用户ID
* @return array 题目列表
*/
public function getExerciseQuestionListV2(array $params, int $userId): array;
}