补充公告与试题中心RPC契约,DataService补考试类型与科目增删改方法
This commit is contained in:
40
consumers/exam_service.php
Normal file
40
consumers/exam_service.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Dhd\Micro\Interface\ExamService\ExamService;
|
||||
use function Hyperf\Support\env;
|
||||
|
||||
return [
|
||||
// 对应消费者类的 $serviceName
|
||||
'name' => 'ExamService',
|
||||
// 服务接口名
|
||||
'service' => ExamService::class,
|
||||
// 服务提供者的服务协议,可选,默认值为 jsonrpc-http
|
||||
'protocol' => 'jsonrpc-http',
|
||||
// 负载均衡算法,可选,默认值为 random
|
||||
'load_balancer' => 'random',
|
||||
// 这个消费者要从哪个服务中心获取节点信息,如不配置则不会从服务中心获取节点信息
|
||||
'registry' => [
|
||||
'protocol' => env('CONSUMERS_PROTOCOL', 'consul'),
|
||||
'address' => env('CONSUMERS_ADDRESS', 'http://127.0.0.1:8500'),
|
||||
],
|
||||
// 配置项,会影响到 Packer 和 Transporter
|
||||
'options' => [
|
||||
'connect_timeout' => 5.0,
|
||||
'recv_timeout' => 5.0,
|
||||
'settings' => [
|
||||
'open_eof_split' => true,
|
||||
'package_eof' => "\r\n",
|
||||
],
|
||||
'retry_count' => 2,
|
||||
'retry_interval' => 100,
|
||||
'heartbeat' => 30,
|
||||
'pool' => [
|
||||
'min_connections' => 1,
|
||||
'max_connections' => 32,
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => 60.0,
|
||||
],
|
||||
],
|
||||
];
|
||||
40
consumers/notice_service.php
Normal file
40
consumers/notice_service.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Dhd\Micro\Interface\NoticeService\NoticeService;
|
||||
use function Hyperf\Support\env;
|
||||
|
||||
return [
|
||||
// 对应消费者类的 $serviceName
|
||||
'name' => 'NoticeService',
|
||||
// 服务接口名
|
||||
'service' => NoticeService::class,
|
||||
// 服务提供者的服务协议,可选,默认值为 jsonrpc-http
|
||||
'protocol' => 'jsonrpc-http',
|
||||
// 负载均衡算法,可选,默认值为 random
|
||||
'load_balancer' => 'random',
|
||||
// 这个消费者要从哪个服务中心获取节点信息,如不配置则不会从服务中心获取节点信息
|
||||
'registry' => [
|
||||
'protocol' => env('CONSUMERS_PROTOCOL', 'consul'),
|
||||
'address' => env('CONSUMERS_ADDRESS', 'http://127.0.0.1:8500'),
|
||||
],
|
||||
// 配置项,会影响到 Packer 和 Transporter
|
||||
'options' => [
|
||||
'connect_timeout' => 5.0,
|
||||
'recv_timeout' => 5.0,
|
||||
'settings' => [
|
||||
'open_eof_split' => true,
|
||||
'package_eof' => "\r\n",
|
||||
],
|
||||
'retry_count' => 2,
|
||||
'retry_interval' => 100,
|
||||
'heartbeat' => 30,
|
||||
'pool' => [
|
||||
'min_connections' => 1,
|
||||
'max_connections' => 32,
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => 60.0,
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -40,11 +40,17 @@ interface DataServiceInterface
|
||||
public function getExamTypeBy(int $id): array;
|
||||
public function getExamTypesByCampusId(int $campusId): array;
|
||||
public function getExamTypeByIds(array $ids): array;
|
||||
public function createExamType(array $data): int;
|
||||
public function updateExamType(int $id, array $data): bool;
|
||||
public function deleteExamType(int $id): bool;
|
||||
|
||||
// 科目相关
|
||||
public function getSubjects(array $data): array;
|
||||
public function getSubjectBy(int $id): array;
|
||||
public function getSubjectsByExamTypeId(int $examTypeId): array;
|
||||
public function createSubject(array $data): int;
|
||||
public function updateSubject(int $id, array $data): bool;
|
||||
public function deleteSubject(int $id): bool;
|
||||
|
||||
// 批量更新校区排序
|
||||
public function batchUpdateCampusSort(array $sorts): bool;
|
||||
|
||||
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;
|
||||
}
|
||||
33
src/NoticeService/NoticeAttachmentInterface.php
Normal file
33
src/NoticeService/NoticeAttachmentInterface.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticeAttachmentInterface
|
||||
{
|
||||
/**
|
||||
* 根据公告ID获取附件列表
|
||||
*/
|
||||
public function getByNoticeId(int $noticeId): array;
|
||||
|
||||
/**
|
||||
* 批量创建附件
|
||||
*/
|
||||
public function batchCreate(int $noticeId, array $attachments): bool;
|
||||
|
||||
/**
|
||||
* 删除公告的所有附件
|
||||
*/
|
||||
public function deleteByNoticeId(int $noticeId): bool;
|
||||
|
||||
/**
|
||||
* 删除单个附件
|
||||
*/
|
||||
public function delete(int $id): bool;
|
||||
|
||||
/**
|
||||
* 增加下载次数
|
||||
*/
|
||||
public function incrementDownloadCount(int $id): bool;
|
||||
}
|
||||
24
src/NoticeService/NoticePositionCollectInterface.php
Normal file
24
src/NoticeService/NoticePositionCollectInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticePositionCollectInterface
|
||||
{
|
||||
/**
|
||||
* 获取职位收藏列表
|
||||
* @param int $userId 用户ID
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function getPositionCollectList(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 职位收藏/取消收藏
|
||||
* @param int $userId 用户ID
|
||||
* @param int $positionId 职位ID
|
||||
* @return string
|
||||
*/
|
||||
public function positionCollect(int $userId, int $positionId): string;
|
||||
}
|
||||
82
src/NoticeService/NoticePositionHistoryInterface.php
Normal file
82
src/NoticeService/NoticePositionHistoryInterface.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticePositionHistoryInterface
|
||||
{
|
||||
public function getPositionHistoryGroups(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取岗位历史数据列表
|
||||
* @param array $params 查询参数
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionHistoryList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取岗位历史数据详情
|
||||
* @param int $id 岗位历史数据id
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionHistoryDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 获取岗位历史数据年份列表
|
||||
* @param string $originUnitName 岗位名称
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionHistoryYearList(string $originUnitName): array;
|
||||
|
||||
/**
|
||||
* 获取岗位历史数据考区列表
|
||||
* @param string $originUnitName 岗位名称
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionHistoryExamCityList(string $originUnitName): array;
|
||||
|
||||
/**
|
||||
* app端获取岗位历史数据列表
|
||||
* @param array $params
|
||||
* @param int $userId 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function appGetNoticePositionHistoryList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* app端获取岗位历史数据详情
|
||||
* @param array $ids
|
||||
* @param int $userId
|
||||
* @return array
|
||||
*/
|
||||
public function appGetNoticePositionHistoryDetail(array $ids, int $userId): array;
|
||||
|
||||
/**
|
||||
* 编辑/创建岗位历史数据
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function editNoticePositionHistory(array $params): bool;
|
||||
|
||||
/**
|
||||
* 批量导入岗位历史数据
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function importNoticePositionHistory(array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除岗位历史数据
|
||||
* @param int $id 岗位历史数据id
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteNoticePositionHistory(int $id): bool;
|
||||
|
||||
/**
|
||||
* 清空岗位
|
||||
* @param array $params 参数
|
||||
* @return bool
|
||||
*/
|
||||
public function cleanNoticePositionHistory(array $params): bool;
|
||||
}
|
||||
80
src/NoticeService/NoticePositionInterface.php
Normal file
80
src/NoticeService/NoticePositionInterface.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticePositionInterface
|
||||
{
|
||||
/**
|
||||
* 获取岗位列表
|
||||
* @param array $params 查询参数
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取岗位详情
|
||||
* @param int $id 岗位id
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 编辑/创建岗位,若公告ID、单位名称、岗位名称对应的记录存在则进行编辑,否则进行创建
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function editNoticePosition(array $params): bool;
|
||||
|
||||
/**
|
||||
* 批量导入岗位
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function importNoticePosition(array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
* @param int $id 岗位id
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteNoticePosition(int $id): bool;
|
||||
|
||||
/**
|
||||
* app端获取岗位列表
|
||||
* @param array $params
|
||||
* @param int $userId 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function appGetNoticePositionList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* app端获取岗位详情
|
||||
* @param array $ids
|
||||
* @param int $userId
|
||||
* @return array
|
||||
*/
|
||||
public function appGetNoticePositionDetail(array $ids, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取公告岗位城市下拉树
|
||||
* @param int $noticeId 公告ID
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionCityList(int $noticeId): array;
|
||||
|
||||
/**
|
||||
* 清空岗位
|
||||
* @param int $noticeId 公告ID
|
||||
* @return bool
|
||||
*/
|
||||
public function cleanNoticePosition(int $noticeId): bool;
|
||||
|
||||
/**
|
||||
* 更新岗位信息
|
||||
* @param array $params 参数
|
||||
* @return bool
|
||||
*/
|
||||
public function updatePositionInfo(array $params): bool;
|
||||
}
|
||||
24
src/NoticeService/NoticePositionPkInterface.php
Normal file
24
src/NoticeService/NoticePositionPkInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticePositionPkInterface
|
||||
{
|
||||
/**
|
||||
* 获取职位Pk列表
|
||||
* @param int $userId 用户ID
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function getPositionPkList(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 职位Pk/取消Pk
|
||||
* @param int $userId 用户ID
|
||||
* @param int $positionId 职位ID
|
||||
* @return int
|
||||
*/
|
||||
public function positionPk(int $userId, int $positionId): int;
|
||||
}
|
||||
20
src/NoticeService/NoticeService.php
Normal file
20
src/NoticeService/NoticeService.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
/**
|
||||
* 公告中心聚合契约
|
||||
*/
|
||||
interface NoticeService extends
|
||||
NoticeServiceInterface,
|
||||
NoticePositionInterface,
|
||||
NoticePositionHistoryInterface,
|
||||
NoticePositionCollectInterface,
|
||||
NoticePositionPkInterface,
|
||||
NoticeAttachmentInterface,
|
||||
NoticeStatsInterface,
|
||||
NoticeStatsLogInterface
|
||||
{
|
||||
}
|
||||
109
src/NoticeService/NoticeServiceInterface.php
Normal file
109
src/NoticeService/NoticeServiceInterface.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticeServiceInterface
|
||||
{
|
||||
// 公告管理
|
||||
public function getList(array $params): array;
|
||||
|
||||
public function appGetNoticeTypes(int $regionId = 0): array;
|
||||
|
||||
public function appGetList(array $params): array;
|
||||
|
||||
public function officialGetList(array $params): array;
|
||||
|
||||
public function officialGetAllList(array $params): array;
|
||||
|
||||
public function adminGetList(array $params): array;
|
||||
|
||||
public function detail(int $id, ?int $userId = null): array;
|
||||
|
||||
public function create(array $data): int;
|
||||
|
||||
public function update(int $id, array $data): bool;
|
||||
|
||||
public function delete(int $id): bool;
|
||||
|
||||
public function changeStatus(int $id, int $status): bool;
|
||||
|
||||
public function toggleTop(int $id, bool $isTop): bool;
|
||||
|
||||
// 附件管理
|
||||
public function getAttachmentsByNoticeId(int $noticeId): array;
|
||||
|
||||
public function batchCreateAttachments(int $noticeId, array $attachments): bool;
|
||||
|
||||
public function deleteNoticeAttachments(int $noticeId): bool;
|
||||
|
||||
public function deleteAttachment(int $id): bool;
|
||||
|
||||
public function incrementAttachmentDownload(int $id): bool;
|
||||
|
||||
// 点赞收藏
|
||||
public function like(int $noticeId, int $userId): array;
|
||||
public function unLike(int $noticeId, int $userId): array;
|
||||
public function collect(int $noticeId, int $userId): array;
|
||||
public function unCollect(int $noticeId, int $userId): array;
|
||||
|
||||
public function userCollectedNotices(int $userId, array $params): array;
|
||||
|
||||
// 统计日志
|
||||
public function logNoticeView(int $noticeId): void;
|
||||
|
||||
public function logNoticeShare(int $noticeId): void;
|
||||
|
||||
public function logNoticeLike(int $noticeId): void;
|
||||
|
||||
public function logNoticeCancelLike(int $noticeId): void;
|
||||
|
||||
public function logAttachmentDownload(int $noticeId, int $attachmentId): void;
|
||||
|
||||
public function getNoticeStatsLogs(int $noticeId, array $params = []): array;
|
||||
|
||||
public function searchNotices(string $keyword, array $params = []): array;
|
||||
|
||||
public function getChildNotices(int $parentId, array $params = []): array;
|
||||
|
||||
public function attachChildNotices(int $parentId, array $childIds): bool;
|
||||
|
||||
public function detachChildNotices(int $parentId, array $childIds): bool;
|
||||
|
||||
public function getNoticeCalendar(int $year, int $month, int $campusId = 0, int $typeId = 0, int $maxRows = 5): array;
|
||||
|
||||
// 官网备考倒计时
|
||||
public function getExamCountdowns(array $params): array;
|
||||
public function getExamCountdownById(int $id): array;
|
||||
public function createExamCountdown(array $data): int;
|
||||
public function updateExamCountdown(int $id, array $data): bool;
|
||||
public function deleteExamCountdown(int $id): bool;
|
||||
public function changeExamCountdownStatus(int $id, int $status): bool;
|
||||
public function officialGetExamCountdowns(): array;
|
||||
|
||||
// 招考指南
|
||||
public function getStageOptions(): array;
|
||||
|
||||
public function getExamYears(int $typeId = 0, int $campusId = 0): array;
|
||||
|
||||
public function getExamTimeline(int $noticeId = 0, int $typeId = 0, int $examYear = 0, int $campusId = 0): array;
|
||||
|
||||
/**
|
||||
* 按年份分组获取所有主公告及其时间轴
|
||||
*
|
||||
* 返回结构:
|
||||
* [
|
||||
* ['year' => 2025, 'notices' => [
|
||||
* ['notice_id'=>1, 'title'=>'...', 'campus_id'=>5, 'timeline'=>[...]]
|
||||
* ]],
|
||||
* ]
|
||||
*/
|
||||
public function getTimelinesByYear(int $typeId = 0, int $campusId = 0): array;
|
||||
|
||||
public function getTimelineCampuses(int $typeId, int $examYear): array;
|
||||
|
||||
public function getNoticesByYear(array $params): array;
|
||||
|
||||
public function getRelatedNotices(int $noticeId): array;
|
||||
}
|
||||
12
src/NoticeService/NoticeStatsInterface.php
Normal file
12
src/NoticeService/NoticeStatsInterface.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
/**
|
||||
* 公告统计聚合契约(空,预留)
|
||||
*/
|
||||
interface NoticeStatsInterface
|
||||
{
|
||||
}
|
||||
26
src/NoticeService/NoticeStatsLogInterface.php
Normal file
26
src/NoticeService/NoticeStatsLogInterface.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticeStatsLogInterface
|
||||
{
|
||||
// 记录浏览日志
|
||||
public function logView(int $noticeId): int;
|
||||
|
||||
// 记录分享日志
|
||||
public function logShare(int $noticeId): int;
|
||||
|
||||
// 记录点赞日志
|
||||
public function logLike(int $noticeId): int;
|
||||
|
||||
// 记录取消点赞日志
|
||||
public function logCancelLike(int $noticeId): int;
|
||||
|
||||
// 记录下载日志
|
||||
public function logDownload(int $noticeId, int $attachmentId): int;
|
||||
|
||||
// 获取公告的统计日志
|
||||
public function getLogsByNoticeId(int $noticeId, array $params = []): array;
|
||||
}
|
||||
Reference in New Issue
Block a user