Compare commits
44 Commits
40bfa96b90
...
ffcabc9369
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffcabc9369 | ||
| 6666307ce1 | |||
| 3a6983f9ac | |||
| 3fe6ef47b1 | |||
| 3ad0eb4824 | |||
| e768dfcbc3 | |||
| 716032432b | |||
| 2c1e4b2327 | |||
|
|
9d191c2875 | ||
|
|
89143b1cdd | ||
|
|
a038c07fbd | ||
|
|
94352fef12 | ||
| b9f70e9f1b | |||
| a118057cac | |||
| 443a4a4c29 | |||
|
|
397641cf52 | ||
| 5c229c226f | |||
| 4a257dfddb | |||
| d78e41e73e | |||
|
|
68e7f20c9c | ||
| 59dfc89c4c | |||
| 0f3ede5741 | |||
|
|
ef8909f94b | ||
|
|
5b6a21e148 | ||
| 923d2987e3 | |||
| 2b8b21f497 | |||
| 4e5ca7c017 | |||
| eb7d3bae5e | |||
| cca345b188 | |||
| 594fa66a4e | |||
|
|
d56b6cd206 | ||
|
|
0159960728 | ||
| a5366fda86 | |||
|
|
84a118b5ea | ||
|
|
a9a26fe20f | ||
|
|
57912c1198 | ||
|
|
30e2f6c771 | ||
|
|
ae0b543bf1 | ||
|
|
5d86bde7a6 | ||
|
|
4d44d7b40e | ||
|
|
161d92b37b | ||
|
|
f39cdca8ff | ||
| 93a165aed2 | |||
| 6b23e9d45d |
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Dhd\Micro\Interface\ArticleService\ArticleService;
|
||||
use function Hyperf\Support\env;
|
||||
|
||||
return [
|
||||
// 对应消费者类的 $serviceName
|
||||
|
||||
@@ -8,7 +8,7 @@ return [
|
||||
// 对应消费者类的 $serviceName
|
||||
'name' => 'CourseService',
|
||||
// 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类
|
||||
'service' => \Dhd\Micro\CourseService\CourseService::class,
|
||||
'service' => \Dhd\Micro\Interface\CourseService\CourseService::class,
|
||||
// 对应容器对象 ID,可选,默认值等于 service 配置的值,用来定义依赖注入的 key
|
||||
// 'id' => \App\JsonRpc\File\FileServiceInterface::class,
|
||||
// 服务提供者的服务协议,可选,默认值为 jsonrpc-http
|
||||
|
||||
39
consumers/exam_service.php
Normal file
39
consumers/exam_service.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Dhd\Micro\Interface\ExamService\ExamService;
|
||||
|
||||
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,
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -8,7 +8,7 @@ return [
|
||||
// 对应消费者类的 $serviceName
|
||||
'name' => 'FileService',
|
||||
// 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类
|
||||
'service' => \Dhd\Micro\Interface\FileService\FileServiceInterface::class,
|
||||
'service' => \Dhd\Micro\Interface\FileService\FileService::class,
|
||||
// 对应容器对象 ID,可选,默认值等于 service 配置的值,用来定义依赖注入的 key
|
||||
// 'id' => \Dhd\Micro\Interface\FileService\FileServiceInterface::class,
|
||||
// 服务提供者的服务协议,可选,默认值为 jsonrpc-http
|
||||
|
||||
39
consumers/notice_service.php
Normal file
39
consumers/notice_service.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Dhd\Micro\Interface\NoticeService\NoticeService;
|
||||
|
||||
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,
|
||||
],
|
||||
],
|
||||
];
|
||||
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,
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -8,7 +8,7 @@ return [
|
||||
// 对应消费者类的 $serviceName
|
||||
'name' => 'WecheatMiniService',
|
||||
// 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类
|
||||
'service' => \App\JsonRpcService\UserService\WecheatMiniService::class,
|
||||
'service' => \Dhd\Micro\Interface\UserService\WecheatMiniService::class,
|
||||
// 服务提供者的服务协议,可选,默认值为 jsonrpc-http
|
||||
// 可选 jsonrpc-http jsonrpc jsonrpc-tcp-length-check
|
||||
'protocol' => 'jsonrpc-http',
|
||||
|
||||
@@ -9,4 +9,5 @@ declare(strict_types=1);
|
||||
namespace Dhd\Micro\Interface\AIService;
|
||||
|
||||
interface AIService extends
|
||||
AiEssayCheckInterface {}
|
||||
AiEssayCheckInterface,
|
||||
AiInterviewCheckInterface {}
|
||||
|
||||
42
src/AIService/AiInterviewCheckInterface.php
Normal file
42
src/AIService/AiInterviewCheckInterface.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AI面试批改相关接口
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\AIService;
|
||||
|
||||
interface AiInterviewCheckInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* 获取用户批改记录
|
||||
* @param int $userId 用户ID
|
||||
* @param array $params 查询参数
|
||||
* @return array
|
||||
*/
|
||||
public function getAiInterviewCheckHistoryList(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 获取面试批改详情
|
||||
* @param int $id 记录ID
|
||||
* @return array|null
|
||||
*/
|
||||
public function getAiInterviewCheckDetail(int $id): ?array;
|
||||
|
||||
/**
|
||||
* 提交面试批改
|
||||
* @param int $userId 用户ID
|
||||
* @param array $params 提交参数
|
||||
* @return int 记录ID
|
||||
*/
|
||||
public function submitAiInterviewCheck(int $userId, array $params): int;
|
||||
|
||||
/**
|
||||
* 获取面试题所有考试类型列表
|
||||
* @return array
|
||||
*/
|
||||
public function getInterviewQuestionExamTypeList(): array;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ interface CourseServiceInterface
|
||||
* @param string $inviteCode 领取码
|
||||
* @return void
|
||||
*/
|
||||
public function virfyInviteCode(int $courseId, int $userId, string $inviteCode);
|
||||
public function virfyInviteCode(int $courseId, int $userId, string $inviteCode): array;
|
||||
|
||||
/**
|
||||
* 搜索课程
|
||||
|
||||
@@ -65,4 +65,12 @@ interface CourseVideoInterface
|
||||
* @param int $userId 用户ID
|
||||
*/
|
||||
public function addVideoBrowse(int $id, int $userId);
|
||||
|
||||
/**
|
||||
* 修改课程视频是否可下载
|
||||
* @param int $id 课程视频ID
|
||||
* @param int $canDownload 是否可下载 0-不可下载 1-可下载
|
||||
* @return void
|
||||
*/
|
||||
public function updateCanDownload(int $id, int $canDownload): void;
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\DataService\Course;
|
||||
|
||||
/**
|
||||
* 课程服务接口
|
||||
*/
|
||||
interface CourseServiceInterface
|
||||
{
|
||||
/**
|
||||
* 根据教师ID获取课程列表
|
||||
* @param int $teacherId 教师ID
|
||||
* @param string $platform 平台 admin-后台 app-APP
|
||||
*/
|
||||
public function getCoursesByTeacherId(int $teacherId, string $platform = 'app'): array;
|
||||
}
|
||||
@@ -6,13 +6,11 @@
|
||||
|
||||
namespace Dhd\Micro\Interface\DataService;
|
||||
|
||||
use Dhd\Micro\Interface\DataService\Course\CourseServiceInterface;
|
||||
use Dhd\Micro\Interface\DataService\Exam\ExamServiceInterface;
|
||||
|
||||
interface DataService extends
|
||||
DataServiceInterface,
|
||||
AgreementInterface,
|
||||
ConfigInterface,
|
||||
HotSearchInterface,
|
||||
AppVersionInterface,
|
||||
RecruitUnitInterface,
|
||||
CampusRelationInterface,
|
||||
@@ -24,6 +22,4 @@ interface DataService extends
|
||||
ExcelHeaderFieldsInterface,
|
||||
DictionaryInterface,
|
||||
MajorsInterface,
|
||||
GuideNavInterface,
|
||||
CourseServiceInterface,
|
||||
ExamServiceInterface {}
|
||||
GuideNavInterface {}
|
||||
|
||||
@@ -40,12 +40,25 @@ 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;
|
||||
|
||||
/**
|
||||
* 获取招考类型(公告类型统一由数据中心提供).
|
||||
* @param int $regionId 招考地区ID,0=全部
|
||||
* @return array 招考类型列表
|
||||
*/
|
||||
public function appGetExamTypes(int $regionId = 0): array;
|
||||
}
|
||||
|
||||
@@ -1,546 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Dhd\Micro\Interface\DataService\Exam;
|
||||
|
||||
interface ExamServiceInterface extends GufenPaperInterface
|
||||
{
|
||||
// 练习相关
|
||||
/**
|
||||
* 获取练习列表.
|
||||
* @param int $userId 用户ID
|
||||
* @return array 练习列表
|
||||
*/
|
||||
public function getPracticeList(int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取练习详情.
|
||||
* @param int $userId 用户ID
|
||||
* @param int $id 练习ID
|
||||
* @return array 练习详情
|
||||
*/
|
||||
public function getPracticeDetail(int $userId, int $id): array;
|
||||
|
||||
// 考试类型相关
|
||||
|
||||
/**
|
||||
* 获取考试类型列表.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getExamTypeList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取考试类型详情.
|
||||
* @param int $id 考试类型ID
|
||||
* @return array 考试类型详情
|
||||
*/
|
||||
public function getExamTypeDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 创建考试类型.
|
||||
* @param array $params
|
||||
* @return bool 创建结果
|
||||
*/
|
||||
public function createExamType(array $params): bool;
|
||||
|
||||
/**
|
||||
* 更新考试类型.
|
||||
* @param int $id 考试类型ID
|
||||
* @param array $params
|
||||
* @return bool 更新结果
|
||||
*/
|
||||
public function updateExamType(int $id, array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除考试类型.
|
||||
* @param int $id 考试类型ID
|
||||
* @return bool 删除结果
|
||||
*/
|
||||
public function deleteExamType(int $id): bool;
|
||||
|
||||
// 题目素材相关
|
||||
|
||||
/**
|
||||
* 获取素材列表.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getQuestionMaterialList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取素材详情.
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getQuestionMaterialDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 创建素材.
|
||||
* @param array $params
|
||||
* @return bool 创建结果
|
||||
*/
|
||||
public function createQuestionMaterial(array $params): bool;
|
||||
|
||||
/**
|
||||
* 更新素材.
|
||||
* @param int $id 素材ID
|
||||
* @param array $params
|
||||
* @return bool 更新结果
|
||||
*/
|
||||
public function updateQuestionMaterial(int $id, array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除素材.
|
||||
* @param int $id 素材ID
|
||||
* @return bool 删除结果
|
||||
*/
|
||||
public function deleteQuestionMaterial(int $id): bool;
|
||||
|
||||
// 题目相关
|
||||
|
||||
/**
|
||||
* 获取题目列表.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getQuestionList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取题目详情.
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getQuestionDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 创建题目.
|
||||
* @param array $params
|
||||
* @return bool 创建结果
|
||||
*/
|
||||
public function createQuestion(array $params): bool;
|
||||
|
||||
/**
|
||||
* 更新题目.
|
||||
* @param int $id 题目ID
|
||||
* @param array $params
|
||||
* @return bool 更新结果
|
||||
*/
|
||||
public function updateQuestion(int $id, array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除题目.
|
||||
* @param int $id 素材ID
|
||||
* @return bool 删除结果
|
||||
*/
|
||||
public function deleteQuestion(int $id): bool;
|
||||
|
||||
/**
|
||||
* 搜索题目.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function searchQuestion(array $params): array;
|
||||
|
||||
// 题目选项相关
|
||||
|
||||
/**
|
||||
* 批量创建题目选项.
|
||||
* @param int $questionId
|
||||
* @param array $options
|
||||
* @return bool
|
||||
*/
|
||||
public function batchCreateQuestionOptions(int $questionId, array $options): bool;
|
||||
|
||||
/**
|
||||
* 调整题目选项排序.
|
||||
* @param int $questionId
|
||||
* @param array $sortData
|
||||
* @return bool
|
||||
*/
|
||||
public function adjustQuestionOptionSort(int $questionId, array $sortData): bool;
|
||||
|
||||
/**
|
||||
* 删除题目选项.
|
||||
* @param int $questionId
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteQuestionOptionsByQuestionId(int $questionId): bool;
|
||||
|
||||
// 题库相关
|
||||
|
||||
/**
|
||||
* 获取题库列表.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getQuestionStoreList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取题库详情.
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getQuestionStoreDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 创建题库.
|
||||
* @param array $params
|
||||
* @return bool 创建结果
|
||||
*/
|
||||
public function createQuestionStore(array $params): bool;
|
||||
|
||||
/**
|
||||
* 更新题库.
|
||||
* @param int $id 题库ID
|
||||
* @param array $params
|
||||
* @return bool 更新结果
|
||||
*/
|
||||
public function updateQuestionStore(int $id, array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除题库.
|
||||
* @param int $id 题库ID
|
||||
* @return bool 删除结果
|
||||
*/
|
||||
public function deleteQuestionStore(int $id): bool;
|
||||
|
||||
// 题型相关
|
||||
|
||||
/**
|
||||
* 获取题型列表.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getQuestionTypeList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取题型详情.
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getQuestionTypeDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 创建题型.
|
||||
* @param array $params
|
||||
* @return bool 创建结果
|
||||
*/
|
||||
public function createQuestionType(array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除题型.
|
||||
* @param int $id 题型ID
|
||||
* @return bool 删除结果
|
||||
*/
|
||||
public function updateQuestionType(int $id, array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除题型.
|
||||
* @param int $id 题型ID
|
||||
* @return bool 删除结果
|
||||
*/
|
||||
public function deleteQuestionType(int $id): bool;
|
||||
|
||||
// 科目相关
|
||||
|
||||
/**
|
||||
* 获取科目列表.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getSubjectList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取科目详情.
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getSubjectDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 创建科目.
|
||||
* @param array $params
|
||||
* @return bool 创建结果
|
||||
*/
|
||||
public function createSubject(array $params): bool;
|
||||
|
||||
/**
|
||||
* 更新科目.
|
||||
* @param int $id 科目ID
|
||||
* @return bool 更新结果
|
||||
*/
|
||||
public function updateSubject(int $id, array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除科目.
|
||||
* @param int $id 科目ID
|
||||
* @return bool 删除结果
|
||||
*/
|
||||
public function deleteSubject(int $id): bool;
|
||||
|
||||
// 用户试卷记录相关
|
||||
|
||||
/**
|
||||
* 开始考试(创建试卷记录).
|
||||
* @param array $params
|
||||
* - user_id: 用户ID
|
||||
* - paper_id: 试卷ID
|
||||
* @return array 试卷记录信息
|
||||
*/
|
||||
public function startExam(array $params): array;
|
||||
|
||||
/**
|
||||
* 提交试卷.
|
||||
* @param array $params
|
||||
* - record_id: 试卷记录ID
|
||||
* - user_id: 用户ID(验证权限)
|
||||
* @return array 考试结果
|
||||
*/
|
||||
public function submitExam(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷记录列表.
|
||||
* @param array $params
|
||||
* - user_id: 用户ID
|
||||
* - page: 页码
|
||||
* - size: 每页条数
|
||||
* - status: 状态筛选
|
||||
* @return array 分页记录
|
||||
*/
|
||||
public function getUserRecords(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取试卷记录详情.
|
||||
* @param int $recordId 记录ID
|
||||
* @param int $userId 用户ID(验证权限)
|
||||
* @return array 详情信息
|
||||
*/
|
||||
public function getRecordDetail(int $recordId, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取用户考试记录列表.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getUserExamRecords(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取考试记录详情.
|
||||
* @param int $recordId 考试记录ID
|
||||
* @param int $userId 用户ID(验证权限)
|
||||
* @return array 详情信息
|
||||
*/
|
||||
public function getExamRecordDetail(int $recordId, int $userId): array;
|
||||
|
||||
// 试卷相关
|
||||
|
||||
// 试卷相关
|
||||
/**
|
||||
* 创建试卷.
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function createPaper(array $params): bool;
|
||||
|
||||
/**
|
||||
* 更新试卷.
|
||||
* @param int $id 试卷ID
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function updatePaper(int $id, array $params): bool;
|
||||
|
||||
/**
|
||||
* 添加题目到试卷.
|
||||
* @param int $paperId
|
||||
* @param array $questionData
|
||||
* @return bool
|
||||
*/
|
||||
public function addQuestionsToPaper(int $paperId, array $questionData): bool;
|
||||
|
||||
/**
|
||||
* 从试卷中移除题目.
|
||||
* @param int $paperId
|
||||
* @param array $questionIds
|
||||
* @return bool
|
||||
*/
|
||||
public function removeQuestionsFromPaper(int $paperId, array $questionIds): bool;
|
||||
|
||||
/**
|
||||
* 获取试卷详情.
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getPaperDetail(int $id): array;
|
||||
|
||||
// 试卷生成相关
|
||||
|
||||
/**
|
||||
* 根据策略生成试卷.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function generateByStrategy(array $params): array;
|
||||
|
||||
/**
|
||||
* 手动生成试卷.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function generateManual(array $params): array;
|
||||
|
||||
// 素材相关
|
||||
|
||||
/**
|
||||
* 获取素材列表.
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getMaterialList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取素材详情.
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getMaterialDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 创建素材.
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function createMaterial(array $params): bool;
|
||||
|
||||
/**
|
||||
* 更新素材.
|
||||
* @param int $id 素材ID
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function updateMaterial(int $id, array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除素材.
|
||||
* @param int $id 素材ID
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteMaterial(int $id): bool;
|
||||
|
||||
// 题目标签关联相关
|
||||
|
||||
/**
|
||||
* 添加题目标签.
|
||||
* @param int $questionId
|
||||
* @param array $tagIds
|
||||
* @return bool
|
||||
*/
|
||||
public function attachQuestionTags(int $questionId, array $tagIds): bool;
|
||||
|
||||
/**
|
||||
* 删除题目标签.
|
||||
* @param int $questionId
|
||||
* @param array $tagIds
|
||||
* @return bool
|
||||
*/
|
||||
public function detachQuestionTags(int $questionId, array $tagIds = []): bool;
|
||||
|
||||
/**
|
||||
* 获取题目标签.
|
||||
* @param int $questionId
|
||||
* @return array
|
||||
*/
|
||||
public function getQuestionTags(int $questionId): array;
|
||||
|
||||
/**
|
||||
* 获取用户错题列表.
|
||||
* @param array $params
|
||||
* - user_id: 用户ID
|
||||
* - page: 页码
|
||||
* - size: 每页条数
|
||||
* - subject_id: 科目筛选
|
||||
* @return array 分页错题列表
|
||||
*/
|
||||
public function getUserWrongQuestions(array $params): array;
|
||||
|
||||
/**
|
||||
* 标记错题为已掌握
|
||||
* @param int $userId 用户ID
|
||||
* @param int $wrongId 错题ID
|
||||
* @return bool 操作结果
|
||||
*/
|
||||
public function markAsMastered(int $userId, int $wrongId): bool;
|
||||
|
||||
/**
|
||||
* 添加错题笔记.
|
||||
* @param array $params
|
||||
* - wrong_id: 错题ID
|
||||
* - user_id: 用户ID
|
||||
* - note: 笔记内容
|
||||
* @return bool 操作结果
|
||||
*/
|
||||
public function addNote(array $params): bool;
|
||||
|
||||
/**
|
||||
* 获取题目错误统计
|
||||
* @param int $userId 用户ID
|
||||
* @param int $questionId 题目ID
|
||||
* @return array 统计信息
|
||||
*/
|
||||
public function getErrorStats(int $userId, int $questionId): array;
|
||||
|
||||
|
||||
/**
|
||||
* 保存用户答题记录.
|
||||
* @param array $params
|
||||
* - user_id: 用户ID
|
||||
* - record_id: 试卷记录ID
|
||||
* - question_id: 题目ID
|
||||
* - user_answer: 用户答案
|
||||
* @return bool 操作结果
|
||||
*/
|
||||
public function saveAnswer(array $params): bool;
|
||||
|
||||
/**
|
||||
* 获取试卷内用户答题记录.
|
||||
* @param int $userId 用户ID
|
||||
* @param int $recordId 试卷记录ID
|
||||
* @return array 答题记录列表
|
||||
*/
|
||||
public function getByRecordId(int $userId, int $recordId): array;
|
||||
|
||||
/**
|
||||
* 批量更新题目得分.
|
||||
* @param array $params
|
||||
* - record_id: 试卷记录ID
|
||||
* - scores: 得分数据 [{question_id: 1, score: 5, is_correct: true}, ...]
|
||||
* @return bool 操作结果
|
||||
*/
|
||||
public function batchUpdateScores(array $params): bool;
|
||||
|
||||
|
||||
public function getCategoryList(array $params): array;
|
||||
|
||||
public function getSubQuestionCategoryList(array $data): 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;
|
||||
|
||||
/**
|
||||
* 查询指定分类下的题库数量
|
||||
* @param int $categoryId 分类ID
|
||||
* @return int 题库数量
|
||||
*/
|
||||
public function getQuestionCountByCategory(int $categoryId): int;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Dhd\Micro\Interface\DataService\Exam;
|
||||
|
||||
interface GufenPaperInterface
|
||||
{
|
||||
//更新估分职位信息
|
||||
public function editGufenPosition(array $params): array;
|
||||
}
|
||||
@@ -37,6 +37,15 @@ interface ExamTypeSubjectInterface
|
||||
*/
|
||||
public function getSubjectsByRegionExamType(int $regionId, int $examTypeId): array;
|
||||
|
||||
/**
|
||||
* App 平台方法:指定地区+招考类型下的科目列表。
|
||||
* region_id=0 聚合全部地区去重;具体地区同时包含通用关系(region_id=0)。
|
||||
* @param int $regionId 招考地区ID,0=全部
|
||||
* @param int $examTypeId 招考类型ID
|
||||
* @return array
|
||||
*/
|
||||
public function appGetSubjectsByRegionExamType(int $regionId, int $examTypeId): array;
|
||||
|
||||
/**
|
||||
* 获取多个适用地区共同可用的科目,避免调用方分别查询后自行求交集。
|
||||
* @param int[] $regionIds
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -34,6 +34,14 @@ interface RegionExamTypeInterface
|
||||
*/
|
||||
public function getExamTypesByRegion(int $regionId): array;
|
||||
|
||||
/**
|
||||
* App 平台方法:指定地区可用的招考类型列表。
|
||||
* 全国类型始终包含;地区专属类型仅返回该地区启用关系,展示名优先使用地区别名。
|
||||
* @param int $regionId 招考地区ID,0=全部
|
||||
* @return array
|
||||
*/
|
||||
public function appGetExamTypesByRegion(int $regionId): array;
|
||||
|
||||
/**
|
||||
* 覆盖设置招考类型的适用地区(多选地区一次性写入)
|
||||
* @param int $examTypeId 招考类型ID
|
||||
|
||||
@@ -14,6 +14,13 @@ interface RegionInterface
|
||||
|
||||
public function appGetRegionCampus(int $id): array;
|
||||
|
||||
/**
|
||||
* App 招考地区菜单(V2):首项固定 id=0/region_id=0 表示全部,不再输出历史全国值 1。
|
||||
* @param array $params 兼容分页/过滤参数
|
||||
* @return array
|
||||
*/
|
||||
public function appGetRegionsV2(array $params = []): array;
|
||||
|
||||
public function getRegionBy(int $id): array;
|
||||
|
||||
public function createRegion(array $data): int;
|
||||
|
||||
36
src/ExamService/ExamService.php
Normal file
36
src/ExamService/ExamService.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
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,
|
||||
QuestionInterface,
|
||||
QuestionTypeInterface,
|
||||
QuestionCategoryInterface,
|
||||
SmartPaperInterface,
|
||||
CampusRelationInterface,
|
||||
PaperImportInterface,
|
||||
QuestionNoteInterface,
|
||||
DailyPracticeInterface {}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface AiInterviewQuestionInterface
|
||||
{
|
||||
/**
|
||||
* 获取面试题列表
|
||||
* @param array $params 查询参数
|
||||
* @return array
|
||||
*/
|
||||
public function getAiInterviewQuestionList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取面试题详情
|
||||
* @param int $id 面试题id
|
||||
* @return array|null
|
||||
*/
|
||||
public function getAiInterviewQuestionDetail(int $id): ?array;
|
||||
|
||||
/**
|
||||
* 创建面试题
|
||||
* @param array $params 面试题参数
|
||||
* @return void
|
||||
*/
|
||||
public function createAiInterviewQuestion(array $params): void;
|
||||
|
||||
/**
|
||||
* 更新面试题
|
||||
* @param int $id 面试题id
|
||||
* @param array $params 面试题参数
|
||||
*/
|
||||
public function updateAiInterviewQuestion(int $id, array $params): void;
|
||||
|
||||
/**
|
||||
* 删除面试题
|
||||
* @param int $id 面试题id
|
||||
* @return void
|
||||
*/
|
||||
public function deleteAiInterviewQuestion(int $id): void;
|
||||
|
||||
/**
|
||||
* 随机获取一个问题
|
||||
* @param int $examTypeId 考试类型
|
||||
* @param int $interviewType 面试类型
|
||||
* @return array|null
|
||||
*/
|
||||
public function getAiInterviewQuestionRandom(int $examTypeId, int $interviewType): ?array;
|
||||
}
|
||||
37
src/ExamService/JsonRpcInterface/CampusRelationInterface.php
Normal file
37
src/ExamService/JsonRpcInterface/CampusRelationInterface.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface CampusRelationInterface
|
||||
{
|
||||
/**
|
||||
* 获取考区关联信息(校区/考试类型/科目/题型分类).
|
||||
*/
|
||||
public function getCampusRelationData(int $campusId = 1, int $examTypeId = 1, int $subjectId = 1, int $userId = 0): array;
|
||||
|
||||
/**
|
||||
* App 平台方法:首页级联数据(地区/招考类型/科目/题型分类)。
|
||||
* @param int $regionId 招考地区ID,0=全部
|
||||
* @param int $examTypeId 招考类型ID,0=不限制
|
||||
* @param int $subjectId 考试科目ID,0=不限制
|
||||
* @param int $userId 用户ID,0=未登录
|
||||
* @return array
|
||||
*/
|
||||
public function appGetCampusRelationData(int $regionId = 0, int $examTypeId = 0, int $subjectId = 0, int $userId = 0): array;
|
||||
|
||||
/**
|
||||
* 按条件获取题型分类树.
|
||||
*/
|
||||
public function getCategoriesByConditions(int $campusId, int $examTypeId, int $subjectId): array;
|
||||
|
||||
/**
|
||||
* App 平台方法:指定地区+招考类型+科目下的题型分类树。
|
||||
* @param int $regionId 招考地区ID,0=全部
|
||||
* @param int $examTypeId 招考类型ID
|
||||
* @param int $subjectId 考试科目ID
|
||||
* @return array
|
||||
*/
|
||||
public function appGetCategoriesByRegionExamTypeSubject(int $regionId, int $examTypeId, int $subjectId): array;
|
||||
}
|
||||
67
src/ExamService/JsonRpcInterface/CustomQuestionInterface.php
Normal file
67
src/ExamService/JsonRpcInterface/CustomQuestionInterface.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
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);
|
||||
}
|
||||
21
src/ExamService/JsonRpcInterface/DailyPracticeInterface.php
Normal file
21
src/ExamService/JsonRpcInterface/DailyPracticeInterface.php
Normal 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;
|
||||
}
|
||||
112
src/ExamService/JsonRpcInterface/ExamServiceInterface.php
Normal file
112
src/ExamService/JsonRpcInterface/ExamServiceInterface.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* 获取考试类型列表(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;
|
||||
}
|
||||
71
src/ExamService/JsonRpcInterface/GufenPaperInterface.php
Normal file
71
src/ExamService/JsonRpcInterface/GufenPaperInterface.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
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/JsonRpcInterface/PaperImportInterface.php
Normal file
41
src/ExamService/JsonRpcInterface/PaperImportInterface.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
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;
|
||||
}
|
||||
69
src/ExamService/JsonRpcInterface/PaperInterface.php
Normal file
69
src/ExamService/JsonRpcInterface/PaperInterface.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 按年份统计试卷数量
|
||||
* @param int $paperType 试卷类型
|
||||
* @param int $campusId 校区ID
|
||||
* @param int $examTypeId 考试类型ID
|
||||
* @return array 统计结果
|
||||
*/
|
||||
public function getPaperTotalByYear(int $paperType, int $campusId, int $examTypeId): array;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface QuestionCategoryInterface
|
||||
{
|
||||
public function getCategoryList(array $params): array;
|
||||
|
||||
public function getSubQuestionCategoryList(array $data): 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;
|
||||
}
|
||||
100
src/ExamService/JsonRpcInterface/QuestionInterface.php
Normal file
100
src/ExamService/JsonRpcInterface/QuestionInterface.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 刷题,批量提交用户答案
|
||||
* 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;
|
||||
}
|
||||
48
src/ExamService/JsonRpcInterface/QuestionNoteInterface.php
Normal file
48
src/ExamService/JsonRpcInterface/QuestionNoteInterface.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
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/JsonRpcInterface/QuestionTypeInterface.php
Normal file
18
src/ExamService/JsonRpcInterface/QuestionTypeInterface.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
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;
|
||||
}
|
||||
67
src/ExamService/JsonRpcInterface/SmartPaperInterface.php
Normal file
67
src/ExamService/JsonRpcInterface/SmartPaperInterface.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
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 参数: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;
|
||||
}
|
||||
31
src/ExamService/JsonRpcInterface/UserPaperInterface.php
Normal file
31
src/ExamService/JsonRpcInterface/UserPaperInterface.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\ExamService\JsonRpcInterface;
|
||||
|
||||
interface UserPaperInterface
|
||||
{
|
||||
/**
|
||||
* 开始做卷
|
||||
*/
|
||||
public function startDoPaper(int $userId, int $paperId): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷详情
|
||||
*/
|
||||
public function getUserPaperDetail(int $paperRecordId, bool $getCorrect): array;
|
||||
|
||||
/**
|
||||
* 获取用户试卷记录列表
|
||||
*/
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
17
src/NoticeService/NoticeService.php
Normal file
17
src/NoticeService/NoticeService.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
/**
|
||||
* 公告中心聚合契约(管理后台使用范围)
|
||||
*/
|
||||
interface NoticeService extends
|
||||
NoticeServiceInterface,
|
||||
NoticePositionInterface,
|
||||
NoticePositionHistoryInterface,
|
||||
NoticePositionCollectInterface,
|
||||
NoticePositionPkInterface
|
||||
{
|
||||
}
|
||||
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 appGetList(array $params): array;
|
||||
|
||||
public function officialGetList(array $params): array;
|
||||
|
||||
public function officialGetAllList(array $params): array;
|
||||
|
||||
public function officialGetHomeList(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;
|
||||
}
|
||||
46
src/PgService/JsonRpcInterface/BaseData/StudentInterface.php
Normal file
46
src/PgService/JsonRpcInterface/BaseData/StudentInterface.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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;
|
||||
}
|
||||
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,48 @@
|
||||
<?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;
|
||||
}
|
||||
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 {}
|
||||
47
src/UserService/JsonRpcInterface/user/FeedbackInterface.php
Normal file
47
src/UserService/JsonRpcInterface/user/FeedbackInterface.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 用户反馈服务接口
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\user;
|
||||
|
||||
interface FeedbackInterface
|
||||
{
|
||||
/**
|
||||
* App提交反馈
|
||||
* @param array $params ['user_id' => int, 'content' => string, 'images' => array, 'contact_phone' => string]
|
||||
* @return array ['id' => int]
|
||||
*/
|
||||
public function submitFeedback(array $params): array;
|
||||
|
||||
/**
|
||||
* App我的反馈列表
|
||||
* @param array $params ['user_id' => int, 'page' => int, 'size' => int]
|
||||
* @return array ['list' => array, 'page' => int, 'size' => int, 'total' => int]
|
||||
*/
|
||||
public function getFeedbackList(array $params): array;
|
||||
|
||||
/**
|
||||
* 后台反馈列表
|
||||
* @param array $params ['status' => int, 'keyword' => string, 'contact_phone' => string, 'page' => int, 'size' => int]
|
||||
* @return array ['list' => array, 'page' => int, 'size' => int, 'total' => int]
|
||||
*/
|
||||
public function adminGetFeedbackList(array $params): array;
|
||||
|
||||
/**
|
||||
* 后台反馈详情
|
||||
* @param int $id 反馈ID
|
||||
* @return array
|
||||
*/
|
||||
public function adminGetFeedbackDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 后台处理反馈
|
||||
* @param int $id 反馈ID
|
||||
* @param int $handlerId 处理人ID(管理员ID)
|
||||
* @param array $params ['status' => int, 'handle_note' => string]
|
||||
* @return array
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -12,4 +12,5 @@ interface UserService extends
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\UserInfoCheckInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\UserCurriculumVitaeInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\UserDownloadRecordInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\StudentScoreInterface {}
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\StudentScoreInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\FeedbackInterface {}
|
||||
|
||||
Reference in New Issue
Block a user