补充公告与试题中心RPC契约,DataService补考试类型与科目增删改方法
This commit is contained in:
18
src/ExamService/CampusRelationInterface.php
Normal file
18
src/ExamService/CampusRelationInterface.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface CampusRelationInterface
|
||||
{
|
||||
/**
|
||||
* 获取地区的考试类型
|
||||
*/
|
||||
public function getExamTypesByCampus(int $campusId): array;
|
||||
|
||||
/**
|
||||
* 获取考试类型的科目
|
||||
*/
|
||||
public function getSubjectsByExamType(int $examTypeId): array;
|
||||
}
|
||||
67
src/ExamService/CustomQuestionInterface.php
Normal file
67
src/ExamService/CustomQuestionInterface.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface CustomQuestionInterface
|
||||
{
|
||||
/**
|
||||
* 获取自定义PDF题库分类
|
||||
* @param array $params 查询参数,分页参数
|
||||
*/
|
||||
public function getCustomQuestionCategoryList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取自定义PDF题库分类下拉列表
|
||||
*/
|
||||
public function getCustomQuestionCategorySelectList(): array;
|
||||
|
||||
/**
|
||||
* 新增、编辑自定义PDF题库分类
|
||||
*/
|
||||
public function editCustomQuestionCategory(array $params);
|
||||
|
||||
/**
|
||||
* 删除自定义PDF题库分类
|
||||
* @param int $id 分类ID
|
||||
*/
|
||||
public function deleteCustomQuestionCategory(int $id);
|
||||
|
||||
/**
|
||||
* 获取自定义PDF题库列表
|
||||
* @param array $params 筛选参数,分页参数
|
||||
*/
|
||||
public function getCustomQuestionList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取自定义PDF题库详情
|
||||
* @param int $id 题库ID
|
||||
*/
|
||||
public function getCustomQuestionDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 新增、编辑自定义PDF题库
|
||||
*/
|
||||
public function editCustomQuestion(array $params);
|
||||
|
||||
/**
|
||||
* 编辑自定义PDF题库状态
|
||||
* @param int $id 题库ID
|
||||
* @param int $status 状态
|
||||
*/
|
||||
public function editCustomQuestionStatus(int $id, int $status);
|
||||
|
||||
/**
|
||||
* 编辑自定义PDF题库排序
|
||||
* @param int $id 题库ID
|
||||
* @param int $sort 排序
|
||||
*/
|
||||
public function editCustomQuestionSort(int $id, int $sort);
|
||||
|
||||
/**
|
||||
* 删除自定义PDF题库
|
||||
* @param int $id 题库ID
|
||||
*/
|
||||
public function deleteCustomQuestion(int $id);
|
||||
}
|
||||
23
src/ExamService/ExamService.php
Normal file
23
src/ExamService/ExamService.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
/**
|
||||
* 试题中心聚合契约
|
||||
*/
|
||||
interface ExamService extends
|
||||
CustomQuestionInterface,
|
||||
PaperInterface,
|
||||
GufenPaperInterface,
|
||||
QuestionInterface,
|
||||
QuestionNoteInterface,
|
||||
QuestionTypeInterface,
|
||||
QuestionCategoryInterface,
|
||||
SmartPaperInterface,
|
||||
UserPaperInterface,
|
||||
CampusRelationInterface,
|
||||
PaperImportInterface
|
||||
{
|
||||
}
|
||||
71
src/ExamService/GufenPaperInterface.php
Normal file
71
src/ExamService/GufenPaperInterface.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface GufenPaperInterface
|
||||
{
|
||||
/**
|
||||
* 后台获取估分考卷列表.
|
||||
*/
|
||||
public function adminGetGufenPaperList(array $params = []): array;
|
||||
|
||||
/**
|
||||
* 获取估分考卷详情.
|
||||
*/
|
||||
public function getGufenPaperDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 新增、编辑估分考卷.
|
||||
*/
|
||||
public function editGufenPaper(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取估分考卷信息
|
||||
*/
|
||||
public function getGufenPaperConfig(int $campusId): array;
|
||||
|
||||
/**
|
||||
* app获取估分卷列表
|
||||
*/
|
||||
public function appGetGufenPaperList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取估分试卷历史列表
|
||||
*/
|
||||
public function getHistoryList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 开始估分考卷
|
||||
*/
|
||||
public function startGufen(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取用户估分排名
|
||||
*/
|
||||
public function getUserPaperRank(int $paperRecordId, int $userId): array;
|
||||
|
||||
//为估分卷添加估分职位
|
||||
public function addGufenPaperPosition(array $params): array;
|
||||
|
||||
//更新估分职位信息
|
||||
public function editGufenPosition(array $params): array;
|
||||
|
||||
//管理后台获取估分职位列表
|
||||
public function adminGetGufenPositionList(array $params): array;
|
||||
|
||||
//获取估分城市列表
|
||||
public function getGufenCityList(array $params): array;
|
||||
|
||||
//获取估分单位列表
|
||||
public function getGufenUnitList(array $params): array;
|
||||
|
||||
//获取估分职位列表
|
||||
public function getGufenPositionList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取估分筛选下拉树
|
||||
*/
|
||||
public function getGufenSelectTree(): array;
|
||||
}
|
||||
41
src/ExamService/PaperImportInterface.php
Normal file
41
src/ExamService/PaperImportInterface.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface PaperImportInterface
|
||||
{
|
||||
public function createPaperImportBatch(array $params, int $operatorId, string $traceId): array;
|
||||
|
||||
public function commitPaperImportBatch(string $batchNo, array $params, int $operatorId, string $traceId): array;
|
||||
|
||||
public function getPaperImportBatch(string $batchNo): array;
|
||||
|
||||
public function getPaperImportBatchList(array $params): array;
|
||||
|
||||
/**
|
||||
* 解析上传的试卷word文档(通用试卷导入)
|
||||
*/
|
||||
public function parsePaperImportFile(int $fileId): array;
|
||||
|
||||
/**
|
||||
* 预校验:对解析结果做完整性校验,不写业务库
|
||||
*/
|
||||
public function previewPaperImport(array $params, int $operatorId): array;
|
||||
|
||||
/**
|
||||
* 提交导入:全部合法才写库,否则返回与预校验一致的报告
|
||||
*/
|
||||
public function commitPaperImport(array $params, int $operatorId): array;
|
||||
|
||||
/**
|
||||
* 导入日志列表
|
||||
*/
|
||||
public function getPaperImportLogList(array $params): array;
|
||||
|
||||
/**
|
||||
* 导入日志详情
|
||||
*/
|
||||
public function getPaperImportLogDetail(array $params): array;
|
||||
}
|
||||
60
src/ExamService/PaperInterface.php
Normal file
60
src/ExamService/PaperInterface.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface PaperInterface
|
||||
{
|
||||
/**
|
||||
* 解析上传的题目word文档
|
||||
*/
|
||||
public function paraseQuestionFile(int $fileId): array;
|
||||
|
||||
/**
|
||||
* 后台获取考卷列表
|
||||
*/
|
||||
public function adminGetPaperList(array $params): array;
|
||||
|
||||
/**
|
||||
* app获取考卷列表
|
||||
*/
|
||||
public function appGetPaperList(array $params): array;
|
||||
|
||||
/**
|
||||
* 官网历年考卷:按地区+年份+科目聚合,返回 [{year, subject_id, paper_count}]
|
||||
*/
|
||||
public function appGetPaperGroupedByYear(array $params): array;
|
||||
|
||||
/**
|
||||
* 创建、编辑试卷
|
||||
*/
|
||||
public function editPaper(array $params): array;
|
||||
|
||||
/**
|
||||
* 编辑试卷状态.
|
||||
*/
|
||||
public function editPaperStatus(int $id, int $status): array;
|
||||
|
||||
/**
|
||||
* 删除试卷.
|
||||
*/
|
||||
public function deletePaper(int $id): array;
|
||||
|
||||
/**
|
||||
* 获取试卷详情
|
||||
* @param int $id 试卷ID
|
||||
* @return array 试卷详情
|
||||
*/
|
||||
public function getPaperDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* APP获取试卷详情.
|
||||
*/
|
||||
public function appGetPaperDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 获取试卷的题目列表
|
||||
*/
|
||||
public function getPaperQuestionList(int $paperId, bool $getCorrect = false, string $platform = 'admin'): array;
|
||||
}
|
||||
31
src/ExamService/QuestionCategoryInterface.php
Normal file
31
src/ExamService/QuestionCategoryInterface.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface QuestionCategoryInterface
|
||||
{
|
||||
public function getCategoryList(array $params): array;
|
||||
|
||||
public function getCategoryDetail(int $id): array;
|
||||
|
||||
public function getCategoriesByIds(array $ids): array;
|
||||
|
||||
public function createCategory(array $params): array;
|
||||
|
||||
public function updateCategory(int $id, array $params): array;
|
||||
|
||||
public function deleteCategory(int $id): array;
|
||||
|
||||
public function getCategoryTree(array $ids = []): array;
|
||||
|
||||
public function getCategoryOptions(): array;
|
||||
|
||||
/**
|
||||
* 查询指定分类下的题库数量(按理应该属于Question,为了不冲突暂时放在这里).
|
||||
* @param int $categoryId 分类ID
|
||||
* @return array 题库数量
|
||||
*/
|
||||
public function getQuestionCountByCategory(int $categoryId): array;
|
||||
}
|
||||
66
src/ExamService/QuestionInterface.php
Normal file
66
src/ExamService/QuestionInterface.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface QuestionInterface
|
||||
{
|
||||
//搜索题库
|
||||
public function searchQuestion(array $params): array;
|
||||
|
||||
/**
|
||||
* 根据code确认导入题目,保存到题库.
|
||||
*/
|
||||
public function submitImportQuestion(array $params): array;
|
||||
|
||||
/**
|
||||
* 随机获取用户错题
|
||||
* @param $userId 用户id
|
||||
* @param $num 获取数量
|
||||
* @return array
|
||||
*/
|
||||
public function getWrongQuestions(int $userId, int $num): array;
|
||||
|
||||
public function getQuestionList(array $filters = []): array;
|
||||
|
||||
public function getQuestionDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* APP移动端获取题目详情
|
||||
*/
|
||||
public function appGetQuestionDetail(int $id): array;
|
||||
|
||||
public function editQuestion(array $data): array;
|
||||
|
||||
public function deleteQuestion(int $id): array;
|
||||
|
||||
/**
|
||||
* 刷题,批量提交用户答案
|
||||
*/
|
||||
public function submitUserAnswer(array $answerList, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取刷题,排除估分考卷题目、做对的题
|
||||
*/
|
||||
public function getExerciseQuestionList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取用户刷题记录
|
||||
*/
|
||||
public function getUserQuestionRecordList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取用户刷题记录详情
|
||||
*/
|
||||
public function getUserQuestionRecordDetailList(string $dateTime, int $userId): array;
|
||||
|
||||
//材料写作型题目编辑
|
||||
public function editSubjectiveQuestion(array $data): array;
|
||||
|
||||
//材料写作型材料编辑
|
||||
public function editSubjectiveMaterial(array $data): array;
|
||||
|
||||
//删除材料,仅限试卷里删除
|
||||
public function deleteMaterial(int $id): array;
|
||||
}
|
||||
48
src/ExamService/QuestionNoteInterface.php
Normal file
48
src/ExamService/QuestionNoteInterface.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface QuestionNoteInterface
|
||||
{
|
||||
/**
|
||||
* 新增笔记
|
||||
*/
|
||||
public function addNote(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 编辑笔记
|
||||
*/
|
||||
public function editNote(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 删除笔记
|
||||
*/
|
||||
public function deleteNote(int $noteId, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取笔记详情
|
||||
*/
|
||||
public function getNoteDetail(int $noteId, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取用户笔记列表
|
||||
*/
|
||||
public function getNoteList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 根据题目ID获取用户笔记
|
||||
*/
|
||||
public function getNoteByQuestionId(int $questionId, int $userId): array;
|
||||
|
||||
/**
|
||||
* 批量获取题目笔记
|
||||
*/
|
||||
public function getBatchNotesByQuestionIds(array $questionIds, int $userId): array;
|
||||
|
||||
/**
|
||||
* 批量获取题目笔记状态
|
||||
*/
|
||||
public function getBatchNotesStatusByQuestionIds(array $questionIds, int $userId): array;
|
||||
}
|
||||
18
src/ExamService/QuestionTypeInterface.php
Normal file
18
src/ExamService/QuestionTypeInterface.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface QuestionTypeInterface
|
||||
{
|
||||
public function getQuestionTypeList(array $filters = []): array;
|
||||
|
||||
public function getQuestionTypeDetail(int $id): array;
|
||||
|
||||
public function createQuestionType(array $data): array;
|
||||
|
||||
public function updateQuestionType(int $id, array $data): array;
|
||||
|
||||
public function deleteQuestionType(int $id): array;
|
||||
}
|
||||
82
src/ExamService/SmartPaperInterface.php
Normal file
82
src/ExamService/SmartPaperInterface.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface SmartPaperInterface
|
||||
{
|
||||
/**
|
||||
* 开始智能组卷
|
||||
* @param int $userId 用户ID
|
||||
* @param array $params 参数:campus_id, exam_type_id(subject由关联关系表查询is_smart_paper=1确定)
|
||||
* @return array 返回UserPaperRecord的toArray(),参考startGufen
|
||||
*/
|
||||
public function startSmartPaper(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷详情
|
||||
* @param int $paperRecordId 用户试卷记录ID
|
||||
* @param bool $getCorrect 是否需要获取正确答案及解析
|
||||
* @return array
|
||||
*/
|
||||
public function getUserSmartPaperDetail(int $paperRecordId, bool $getCorrect): array;
|
||||
|
||||
/**
|
||||
* 提交题目答案
|
||||
* @param array $params 参数:paper_record_id, question_id, user_answer, used_time
|
||||
* @param int $userId 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function submitAnswer(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 提交用户试卷
|
||||
* @param array $params 参数:paper_record_id, used_time
|
||||
* @return array
|
||||
*/
|
||||
public function submitUserPaper(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷历史列表
|
||||
* @param array $params 参数:campus_id, exam_type_id, page, limit
|
||||
* @param int $userId 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function getUserSmartPaperList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 后台获取模板列表
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function adminGetTemplateList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取模板详情
|
||||
* @param int $id 模板ID
|
||||
* @return array
|
||||
*/
|
||||
public function getTemplateDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 新增、编辑模板
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function editTemplate(array $params): array;
|
||||
|
||||
/**
|
||||
* 删除模板
|
||||
* @param int $id 模板ID
|
||||
* @return array
|
||||
*/
|
||||
public function deleteTemplate(int $id): array;
|
||||
|
||||
/**
|
||||
* 诊断模板题目数量情况
|
||||
* @param int $templateId 模板ID
|
||||
* @return array 各分类题目数量诊断结果
|
||||
*/
|
||||
public function diagnoseTemplateQuestions(int $templateId): array;
|
||||
}
|
||||
33
src/ExamService/UserPaperInterface.php
Normal file
33
src/ExamService/UserPaperInterface.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
interface UserPaperInterface
|
||||
{
|
||||
/**
|
||||
* 开始做卷
|
||||
*/
|
||||
public function startDoPaper(int $userId, int $paperId): array;
|
||||
|
||||
/**
|
||||
* 提交题目答案
|
||||
*/
|
||||
public function submitAnswer(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 提交用户试卷
|
||||
*/
|
||||
public function submitUserPaper(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷详情
|
||||
*/
|
||||
public function getUserPaperDetail(int $paperRecordId, bool $getCorrect): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷记录列表
|
||||
*/
|
||||
public function getUserPaperList(array $params, int $userId): array;
|
||||
}
|
||||
Reference in New Issue
Block a user