Compare commits
35 Commits
zj
...
zd-feature
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f258560a4 | ||
|
|
9e3b6a400d | ||
|
|
bfe41c4b99 | ||
|
|
7e13db52bf | ||
|
|
885316c990 | ||
|
|
a2b3310860 | ||
| a0194a8d38 | |||
| 25bfb2aeea | |||
|
|
e1a0a2b638 | ||
|
|
4bf1c1fe56 | ||
| b2109af8a6 | |||
| 033ffc1acf | |||
| 058cf9b355 | |||
|
|
783888f12f | ||
|
|
ffcabc9369 | ||
| 6666307ce1 | |||
| 3a6983f9ac | |||
| 3fe6ef47b1 | |||
| 3ad0eb4824 | |||
| e768dfcbc3 | |||
| 716032432b | |||
| 2c1e4b2327 | |||
|
|
9d191c2875 | ||
|
|
89143b1cdd | ||
|
|
a038c07fbd | ||
|
|
94352fef12 | ||
| b9f70e9f1b | |||
| a118057cac | |||
| 443a4a4c29 | |||
|
|
397641cf52 | ||
| 5c229c226f | |||
| 4a257dfddb | |||
| d78e41e73e | |||
|
|
68e7f20c9c | ||
| 59dfc89c4c |
66
consumers/pg_service.php
Normal file
66
consumers/pg_service.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
use Dhd\Micro\Interface\PgService\PgService;
|
||||
|
||||
return [
|
||||
// 对应消费者类的 $serviceName
|
||||
'name' => 'PgService',
|
||||
// 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类
|
||||
'service' => PgService::class,
|
||||
// 对应容器对象 ID,可选,默认值等于 service 配置的值,用来定义依赖注入的 key
|
||||
// 'id' => \App\JsonRpc\File\FileServiceInterface::class,
|
||||
// 服务提供者的服务协议,可选,默认值为 jsonrpc-http
|
||||
// 可选 jsonrpc-http jsonrpc jsonrpc-tcp-length-check
|
||||
'protocol' => 'jsonrpc-http',
|
||||
// 负载均衡算法,可选,默认值为 random
|
||||
'load_balancer' => 'random',
|
||||
// 这个消费者要从哪个服务中心获取节点信息,如不配置则不会从服务中心获取节点信息
|
||||
'registry' => [
|
||||
'protocol' => env('CONSUMERS_PROTOCOL', 'nacos'),
|
||||
'address' => env('CONSUMERS_ADDRESS', 'http://192.168.28.199:8848'),
|
||||
],
|
||||
// 'nodes' => [
|
||||
// [
|
||||
// 'host' => env('NOTICE_SERVICE_HOST', '127.0.0.1'),
|
||||
// 'port' => env('NOTICE_SERVICE_PORT', 9610),
|
||||
// ],
|
||||
// ],
|
||||
// 配置项,会影响到 Packer 和 Transporter
|
||||
'options' => [
|
||||
'connect_timeout' => 5.0,
|
||||
'recv_timeout' => 5.0,
|
||||
'settings' => [
|
||||
// 根据协议不同,区分配置
|
||||
'open_eof_split' => true,
|
||||
'package_eof' => "\r\n",
|
||||
// 'open_length_check' => true,
|
||||
// 'package_length_type' => 'N',
|
||||
// 'package_length_offset' => 0,
|
||||
// 'package_body_offset' => 4,
|
||||
],
|
||||
// 重试次数,默认值为 2,收包超时不进行重试。暂只支持 JsonRpcPoolTransporter
|
||||
'retry_count' => 2,
|
||||
// 重试间隔,毫秒
|
||||
'retry_interval' => 100,
|
||||
// 使用多路复用 RPC 时的心跳间隔,null 为不触发心跳
|
||||
'heartbeat' => 30,
|
||||
// 当使用 JsonRpcPoolTransporter 时会用到以下配置
|
||||
'pool' => [
|
||||
'min_connections' => 1,
|
||||
'max_connections' => 32,
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => 60.0,
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -10,4 +10,5 @@ namespace Dhd\Micro\Interface\AIService;
|
||||
|
||||
interface AIService extends
|
||||
AiEssayCheckInterface,
|
||||
AiInterviewCheckInterface {}
|
||||
AiInterviewCheckInterface,
|
||||
AiInterviewTtsInterface {}
|
||||
|
||||
@@ -33,4 +33,10 @@ interface AiInterviewCheckInterface
|
||||
* @return int 记录ID
|
||||
*/
|
||||
public function submitAiInterviewCheck(int $userId, array $params): int;
|
||||
|
||||
/**
|
||||
* 获取面试题所有考试类型列表
|
||||
* @return array
|
||||
*/
|
||||
public function getInterviewQuestionExamTypeList(): array;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -36,6 +36,12 @@ interface ArticleService
|
||||
public function unbindCategoryTypes(int $categoryId, array $typeIds): bool;
|
||||
public function getCategoryBoundTypes(int $categoryId): array;
|
||||
|
||||
// 标签相关
|
||||
public function createTag(array $data): int;
|
||||
public function updateTag(int $id, array $data): bool;
|
||||
public function deleteTag(int $id): bool;
|
||||
public function getTagList(array $params = []): array;
|
||||
|
||||
// 附件
|
||||
public function createAttachment(array $data): int;
|
||||
public function updateAttachment(int $id, array $data): bool;
|
||||
|
||||
@@ -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 配置所属平台
|
||||
|
||||
@@ -10,6 +10,7 @@ interface DataService extends
|
||||
DataServiceInterface,
|
||||
AgreementInterface,
|
||||
ConfigInterface,
|
||||
HotSearchInterface,
|
||||
AppVersionInterface,
|
||||
RecruitUnitInterface,
|
||||
CampusRelationInterface,
|
||||
|
||||
19
src/DataService/HotSearchInterface.php
Normal file
19
src/DataService/HotSearchInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Dhd\Micro\Interface\DataService;
|
||||
|
||||
interface HotSearchInterface
|
||||
{
|
||||
/**
|
||||
* 记录搜索行为(热搜统计数据源,仅记录不返回榜单)
|
||||
* @param array $params 包含:platform 平台、keyword 关键词、user_id 用户ID(未登录0)、result_count 聚合搜索结果数
|
||||
*/
|
||||
public function recordSearchKeyword(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取热搜词列表:运营置顶词优先,其后为近7天真实搜索热度词
|
||||
* @param string $platform 平台
|
||||
* @param int $limit 获取数量
|
||||
*/
|
||||
public function getHotSearchList(string $platform = 'app', int $limit = 10): array;
|
||||
}
|
||||
@@ -4,10 +4,25 @@ declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
|
||||
/**
|
||||
* 试题中心聚合契约
|
||||
*/
|
||||
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\ExamServiceInterface;
|
||||
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\UserPaperInterface;
|
||||
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\AiInterviewQuestionInterface;
|
||||
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\CustomQuestionInterface;
|
||||
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\PaperInterface;
|
||||
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\GufenPaperInterface;
|
||||
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\QuestionInterface;
|
||||
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\QuestionTypeInterface;
|
||||
use Dhd\Micro\Interface\ExamService\JsonRpcInterface\QuestionCategoryInterface;
|
||||
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,
|
||||
UserPaperInterface,
|
||||
AiInterviewQuestionInterface,
|
||||
CustomQuestionInterface,
|
||||
PaperInterface,
|
||||
GufenPaperInterface,
|
||||
@@ -18,110 +33,4 @@ interface ExamService extends
|
||||
CampusRelationInterface,
|
||||
PaperImportInterface,
|
||||
QuestionNoteInterface,
|
||||
AiInterviewQuestionInterface
|
||||
{
|
||||
/**
|
||||
* 开始做卷.
|
||||
*/
|
||||
public function startDoPaper(int $userId, int $paperId): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷详情.
|
||||
*/
|
||||
public function getUserPaperDetail(int $paperRecordId, bool $getCorrect): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷记录列表.
|
||||
*/
|
||||
public function getUserPaperList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取练习列表.
|
||||
*/
|
||||
public function getPracticeList(int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取练习详情.
|
||||
*/
|
||||
public function getPracticeDetail(int $userId, int $id): array;
|
||||
|
||||
/**
|
||||
* 提交练习答案.
|
||||
*/
|
||||
public function submitPractice(int $userId, int $paperId, array $answers): array;
|
||||
|
||||
/**
|
||||
* 开始考试.
|
||||
*/
|
||||
public function startExam(array $params): array;
|
||||
|
||||
/**
|
||||
* 提交考试.
|
||||
*/
|
||||
public function submitExam(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户考试记录列表.
|
||||
*/
|
||||
public function getUserExamRecords(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取考试记录详情.
|
||||
*/
|
||||
public function getExamRecordDetail(int $recordId, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取考试记录题目列表.
|
||||
*/
|
||||
public function getByRecordId(int $userId, int $recordId): array;
|
||||
|
||||
/**
|
||||
* 保存用户答题记录.
|
||||
*/
|
||||
public function saveAnswer(array $params): bool;
|
||||
|
||||
/**
|
||||
* 获取用户错题列表.
|
||||
*/
|
||||
public function getUserWrongQuestions(array $params): array;
|
||||
|
||||
/**
|
||||
* 标记错题为已掌握.
|
||||
*/
|
||||
public function markAsMastered(int $userId, int $wrongId): bool;
|
||||
|
||||
/**
|
||||
* 添加错题笔记(避免与题目笔记 addNote 重名).
|
||||
*/
|
||||
public function addWrongQuestionNote(array $params): bool;
|
||||
|
||||
/**
|
||||
* 获取题目错误统计.
|
||||
*/
|
||||
public function getErrorStats(int $userId, int $questionId): array;
|
||||
|
||||
/**
|
||||
* 批量更新题目得分.
|
||||
*/
|
||||
public function batchUpdateScores(array $params): bool;
|
||||
|
||||
/**
|
||||
* 获取考试类型列表(V1 兼容接口).
|
||||
*/
|
||||
public function getExamTypeList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取考试类型详情(V1 兼容接口).
|
||||
*/
|
||||
public function getExamTypeDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 获取科目列表(V1 兼容接口).
|
||||
*/
|
||||
public function getSubjectList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取题库列表(V1 兼容接口).
|
||||
*/
|
||||
public function getQuestionStoreList(array $params): array;
|
||||
}
|
||||
DailyPracticeInterface {}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface AiInterviewQuestionInterface
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface CampusRelationInterface
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface CustomQuestionInterface
|
||||
{
|
||||
28
src/ExamService/JsonRpcInterface/DailyPracticeInterface.php
Normal file
28
src/ExamService/JsonRpcInterface/DailyPracticeInterface.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface DailyPracticeInterface
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
139
src/ExamService/JsonRpcInterface/ExamServiceInterface.php
Normal file
139
src/ExamService/JsonRpcInterface/ExamServiceInterface.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
/**
|
||||
* 试题中心聚合契约
|
||||
*/
|
||||
interface ExamServiceInterface
|
||||
{
|
||||
/**
|
||||
* 获取练习列表.
|
||||
*/
|
||||
public function getPracticeList(int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取练习详情.
|
||||
*/
|
||||
public function getPracticeDetail(int $userId, int $id): array;
|
||||
|
||||
/**
|
||||
* 提交练习答案.
|
||||
*/
|
||||
public function submitPractice(int $userId, int $paperId, array $answers): array;
|
||||
|
||||
/**
|
||||
* 开始考试.
|
||||
*/
|
||||
public function startExam(array $params): array;
|
||||
|
||||
/**
|
||||
* 提交考试.
|
||||
*/
|
||||
public function submitExam(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户考试记录列表.
|
||||
*/
|
||||
public function getUserExamRecords(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取考试记录详情.
|
||||
*/
|
||||
public function getExamRecordDetail(int $recordId, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取考试记录题目列表.
|
||||
*/
|
||||
public function getByRecordId(int $userId, int $recordId): array;
|
||||
|
||||
/**
|
||||
* 保存用户答题记录.
|
||||
*/
|
||||
public function saveAnswer(array $params): bool;
|
||||
|
||||
/**
|
||||
* 获取用户错题列表.
|
||||
*/
|
||||
public function getUserWrongQuestions(array $params): array;
|
||||
|
||||
/**
|
||||
* 标记错题为已掌握.
|
||||
*/
|
||||
public function markAsMastered(int $userId, int $wrongId): bool;
|
||||
|
||||
/**
|
||||
* 添加错题笔记(避免与题目笔记 addNote 重名).
|
||||
*/
|
||||
public function addWrongQuestionNote(array $params): bool;
|
||||
|
||||
/**
|
||||
* 获取题目错误统计.
|
||||
*/
|
||||
public function getErrorStats(int $userId, int $questionId): array;
|
||||
|
||||
/**
|
||||
* 批量更新题目得分.
|
||||
*/
|
||||
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 兼容接口).
|
||||
*/
|
||||
public function getExamTypeList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取考试类型详情(V1 兼容接口).
|
||||
*/
|
||||
public function getExamTypeDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 获取科目列表(V1 兼容接口).
|
||||
*/
|
||||
public function getSubjectList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取题库列表(V1 兼容接口).
|
||||
*/
|
||||
public function getQuestionStoreList(array $params): array;
|
||||
|
||||
/**
|
||||
* 提交题目答案,根据试卷类型自动选择智能组卷或普通试卷逻辑.
|
||||
*/
|
||||
public function submitAnswer(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 提交用户试卷,根据试卷类型自动选择智能组卷或普通试卷逻辑.
|
||||
*/
|
||||
public function submitUserPaper(array $params): array;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface GufenPaperInterface
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface PaperImportInterface
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface PaperInterface
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface QuestionCategoryInterface
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface QuestionInterface
|
||||
{
|
||||
@@ -63,4 +63,38 @@ interface QuestionInterface
|
||||
|
||||
//删除材料,仅限试卷里删除
|
||||
public function deleteMaterial(int $id): array;
|
||||
|
||||
/**
|
||||
* 刷题,批量提交用户答案
|
||||
* V2版本
|
||||
* @param int $userId 用户ID
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function submitUserAnswerV2(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户刷题记录
|
||||
* V2版本
|
||||
* @param array $params 参数
|
||||
* @param int $userId 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function getUserQuestionRecordListV2(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户刷题记录详情,V2版本
|
||||
* @param string $testCode 刷题代码
|
||||
* @param int $userId 用户ID
|
||||
* @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;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface QuestionNoteInterface
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface QuestionTypeInterface
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface SmartPaperInterface
|
||||
{
|
||||
@@ -22,21 +22,6 @@ interface SmartPaperInterface
|
||||
*/
|
||||
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
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService;
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface UserPaperInterface
|
||||
{
|
||||
@@ -11,16 +11,6 @@ interface UserPaperInterface
|
||||
*/
|
||||
public function startDoPaper(int $userId, int $paperId): array;
|
||||
|
||||
/**
|
||||
* 提交题目答案
|
||||
*/
|
||||
public function submitAnswer(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 提交用户试卷
|
||||
*/
|
||||
public function submitUserPaper(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷详情
|
||||
*/
|
||||
@@ -30,4 +20,12 @@ interface UserPaperInterface
|
||||
* 获取用户试卷记录列表
|
||||
*/
|
||||
public function getUserPaperList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷记录列表,V2
|
||||
* @param int $userId 用户ID
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function getUserPaperListV2(int $userId, 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;
|
||||
}
|
||||
|
||||
61
src/PgService/JsonRpcInterface/BaseData/StudentInterface.php
Normal file
61
src/PgService/JsonRpcInterface/BaseData/StudentInterface.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\PgService\JsonRpcInterface\BaseData;
|
||||
|
||||
interface StudentInterface
|
||||
{
|
||||
/**
|
||||
* 获取学生分页列表
|
||||
* @param array $params 请求参数
|
||||
* @return array
|
||||
*/
|
||||
public function getStudentPageList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取学生信息详情
|
||||
* @param int $studentId 学生ID
|
||||
* @return array
|
||||
*/
|
||||
public function getStudentDetail(int $studentId): ?array;
|
||||
|
||||
/**
|
||||
* APP获取学生信息
|
||||
* @param int $userId 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function appGetCrmStudentDetail(int $userId): array;
|
||||
|
||||
/**
|
||||
* 更新学生座位号
|
||||
* @param int $studentId 学生ID
|
||||
* @param int $seatNo 座位号
|
||||
* @return void
|
||||
*/
|
||||
public function updateStudentSeatNo(int $studentId, int $seatNo): void;
|
||||
|
||||
|
||||
/**
|
||||
* 更新学生分校
|
||||
* @param int $studentId 学生ID
|
||||
* @param int $schoolId 学校ID
|
||||
* @return void
|
||||
*/
|
||||
public function updateStudentSchool(int $studentId, int $schoolId): void;
|
||||
|
||||
/**
|
||||
* 获取学员分校下拉列表
|
||||
* @param string $mobile 手机号
|
||||
* @return array
|
||||
*/
|
||||
public function getStudentSchoolSelectList(string $mobile): array;
|
||||
|
||||
/**
|
||||
* 更新学生姓名
|
||||
* @param int $studentId 学生ID
|
||||
* @param string $name 姓名
|
||||
* @return void
|
||||
*/
|
||||
public function updateStudentName(int $studentId, string $name): void;
|
||||
}
|
||||
14
src/PgService/JsonRpcInterface/Crm/SchoolInterface.php
Normal file
14
src/PgService/JsonRpcInterface/Crm/SchoolInterface.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\PgService\JsonRpcInterface\Crm;
|
||||
|
||||
interface SchoolInterface
|
||||
{
|
||||
/**
|
||||
* 获取学校下拉列表
|
||||
* @return array
|
||||
*/
|
||||
public function getSchoolSelectList(): array;
|
||||
}
|
||||
59
src/PgService/JsonRpcInterface/PgPaperInterface.php
Normal file
59
src/PgService/JsonRpcInterface/PgPaperInterface.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\PgService\JsonRpcInterface;
|
||||
|
||||
interface PgPaperInterface
|
||||
{
|
||||
/**
|
||||
* 获取试卷分页列表
|
||||
* @param array $params 请求参数
|
||||
* @return array
|
||||
*/
|
||||
public function getPgPaperPageList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取试卷详情
|
||||
* @param int $id 试卷id
|
||||
* @return array
|
||||
*/
|
||||
public function getPgPaperDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 创建试卷及答案配置
|
||||
* @param array $params 请求参数
|
||||
* @return void
|
||||
*/
|
||||
public function createPgPaper(array $params): void;
|
||||
|
||||
/**
|
||||
* 更新试卷及答案配置
|
||||
* @param int $paperId 试卷ID
|
||||
* @param array $params 请求参数
|
||||
* @return void
|
||||
*/
|
||||
public function updatePgPaper(int $paperId, array $params): void;
|
||||
|
||||
/**
|
||||
* 删除试卷
|
||||
* @param int $id 试卷id
|
||||
* @return void
|
||||
*/
|
||||
public function deletePgPaper(int $id): void;
|
||||
|
||||
/**
|
||||
* 删除章节或答案配置
|
||||
* @param int $id 章节或答案配置id
|
||||
* @return void
|
||||
*/
|
||||
public function deletePgPaperAnswer(int $id): void;
|
||||
|
||||
/**
|
||||
* app获取试卷分页列表
|
||||
* @param int $userId 用户id
|
||||
* @param array $params 请求参数
|
||||
* @return array
|
||||
*/
|
||||
public function appGetPaperPageList(int $userId, array $params): array;
|
||||
}
|
||||
43
src/PgService/JsonRpcInterface/PgPhaseInterface.php
Normal file
43
src/PgService/JsonRpcInterface/PgPhaseInterface.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\PgService\JsonRpcInterface;
|
||||
|
||||
interface PgPhaseInterface
|
||||
{
|
||||
/**
|
||||
* 获取阶段分页列表
|
||||
* @param array $params 请求参数
|
||||
* @return array
|
||||
*/
|
||||
public function getPgPhasePageList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取阶段下拉列表
|
||||
* @return array
|
||||
*/
|
||||
public function getPgPhaseSelectList(): array;
|
||||
|
||||
/**
|
||||
* 创建阶段
|
||||
* @param array $params 请求参数
|
||||
* @return void
|
||||
*/
|
||||
public function createPgPhase(array $params): void;
|
||||
|
||||
/**
|
||||
* 更新阶段
|
||||
* @param int $id 阶段ID
|
||||
* @param array $params 请求参数
|
||||
* @return void
|
||||
*/
|
||||
public function updatePgPhase(int $id, array $params): void;
|
||||
|
||||
/**
|
||||
* 删除阶段
|
||||
* @param int $id 阶段ID
|
||||
* @return void
|
||||
*/
|
||||
public function deletePgPhase(int $id): void;
|
||||
}
|
||||
43
src/PgService/JsonRpcInterface/PgSubjectInterface.php
Normal file
43
src/PgService/JsonRpcInterface/PgSubjectInterface.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\PgService\JsonRpcInterface;
|
||||
|
||||
interface PgSubjectInterface
|
||||
{
|
||||
/**
|
||||
* 获取学科分页列表
|
||||
* @param array $params 请求参数
|
||||
* @return array
|
||||
*/
|
||||
public function getPgSubjectPageList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取学科下拉列表
|
||||
* @return array
|
||||
*/
|
||||
public function getPgSubjectSelectList(): array;
|
||||
|
||||
/**
|
||||
* 创建学科
|
||||
* @param array $params 请求参数
|
||||
* @return void
|
||||
*/
|
||||
public function createPgSubject(array $params): void;
|
||||
|
||||
/**
|
||||
* 更新学科
|
||||
* @param int $id 学科ID
|
||||
* @param array $params 请求参数
|
||||
* @return void
|
||||
*/
|
||||
public function updatePgSubject(int $id, array $params): void;
|
||||
|
||||
/**
|
||||
* 删除学科
|
||||
* @param int $id 学科ID
|
||||
* @return void
|
||||
*/
|
||||
public function deletePgSubject(int $id): void;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\PgService\JsonRpcInterface;
|
||||
|
||||
interface PgUserPaperRecordInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* App获取试卷章节列表
|
||||
* @param int $userId 用户id
|
||||
* @param int $paperId 试卷id
|
||||
* @return array
|
||||
*/
|
||||
public function appGetPgPaperSectionList(int $userId, int $paperId): array;
|
||||
|
||||
/**
|
||||
* App获取试卷章节详情
|
||||
* @param int $userId 用户id
|
||||
* @param int $sectionId 章节id
|
||||
* @return array
|
||||
*/
|
||||
public function appGetPgPaperSectionDetail(int $userId, int $sectionId): array;
|
||||
|
||||
/**
|
||||
* 获取用户答题卡记录分页列表
|
||||
* @param int $userId 用户id
|
||||
* @param array $params 查询参数
|
||||
* @return array
|
||||
*/
|
||||
public function appGetPgPaperHistory(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户学习统计数据
|
||||
* @param int $userId 用户id
|
||||
* @return array
|
||||
*/
|
||||
public function getPgUserTotal(int $userId): array;
|
||||
|
||||
/**
|
||||
* 用户提交答题卡
|
||||
* @param int $userId 用户id
|
||||
* @param array $params 答题卡数据
|
||||
* @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;
|
||||
}
|
||||
20
src/PgService/PgService.php
Normal file
20
src/PgService/PgService.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\PgService;
|
||||
|
||||
use Dhd\Micro\Interface\PgService\JsonRpcInterface\Crm\SchoolInterface;
|
||||
use Dhd\Micro\Interface\PgService\JsonRpcInterface\PgPaperInterface;
|
||||
use Dhd\Micro\Interface\PgService\JsonRpcInterface\PgSubjectInterface;
|
||||
use Dhd\Micro\Interface\PgService\JsonRpcInterface\PgPhaseInterface;
|
||||
use Dhd\Micro\Interface\PgService\JsonRpcInterface\PgUserPaperRecordInterface;
|
||||
use Dhd\Micro\Interface\PgService\JsonRpcInterface\BaseData\StudentInterface;
|
||||
|
||||
interface PgService extends
|
||||
SchoolInterface,
|
||||
PgPaperInterface,
|
||||
PgSubjectInterface,
|
||||
PgPhaseInterface,
|
||||
PgUserPaperRecordInterface,
|
||||
StudentInterface {}
|
||||
@@ -41,7 +41,7 @@ interface FeedbackInterface
|
||||
* @param int $id 反馈ID
|
||||
* @param int $handlerId 处理人ID(管理员ID)
|
||||
* @param array $params ['status' => int, 'handle_note' => string]
|
||||
* @return bool
|
||||
* @return array
|
||||
*/
|
||||
public function adminHandleFeedback(int $id, int $handlerId, array $params): bool;
|
||||
public function adminHandleFeedback(int $id, int $handlerId, array $params): array;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,29 @@ interface LoginServiceInterface
|
||||
*/
|
||||
public function wxBindUser(string $bindId, string $phone, string $smsCode, string $ip): array;
|
||||
|
||||
/**
|
||||
* 微信解绑
|
||||
* @param int $uid 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function wxUnbind(int $uid): array;
|
||||
|
||||
/**
|
||||
* 微信换绑
|
||||
* @param int $uid 用户ID
|
||||
* @param string $code 微信授权code
|
||||
* @param string $ip ip地址
|
||||
* @return array
|
||||
*/
|
||||
public function wxRebind(int $uid, string $code, string $ip): array;
|
||||
|
||||
/**
|
||||
* 获取用户绑定的微信信息
|
||||
* @param int $uid 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function wxGetBindInfo(int $uid): array;
|
||||
|
||||
/**
|
||||
* 获取官网登录二维码
|
||||
* @return array
|
||||
|
||||
@@ -24,4 +24,11 @@ interface UserCurriculumVitaeInterface
|
||||
* @return void
|
||||
*/
|
||||
public function deleteUserEducation(int $userId, int $educationId): array;
|
||||
/**
|
||||
* 删除用户工作经历
|
||||
* @param int $userId 用户id
|
||||
* @param int $index 工作经历下标(0-based)
|
||||
* @return array
|
||||
*/
|
||||
public function deleteUserWorkExperience(int $userId, int $index): array;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user