From 96cc30763dc72adde9029023dae0d597300910d8 Mon Sep 17 00:00:00 2001 From: zj Date: Thu, 6 Aug 2026 09:50:28 +0800 Subject: [PATCH 1/2] update --- src/DataService/DataServiceInterface.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/DataService/DataServiceInterface.php b/src/DataService/DataServiceInterface.php index 0d87469..c378e10 100644 --- a/src/DataService/DataServiceInterface.php +++ b/src/DataService/DataServiceInterface.php @@ -38,7 +38,6 @@ interface DataServiceInterface // 招考类型相关 public function getExamTypes(array $data): array; public function getExamTypeBy(int $id): array; - public function deleteExamType(int $id): bool; public function getExamTypesByCampusId(int $campusId): array; public function getExamTypeByIds(array $ids): array; From 32b627c3006a30cfeca05c6b31c2bb14d8655678 Mon Sep 17 00:00:00 2001 From: zj Date: Thu, 6 Aug 2026 10:40:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8F=8A=E7=AE=A1=E7=90=86=E5=91=98=E7=9B=B8=E5=85=B3=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=8E=A5=E5=8F=A3=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consumers/admin_user_service.php | 54 ++++++++ consumers/user_service.php | 54 ++++++++ consumers/wecheat_service.php | 54 ++++++++ src/FileService/FileService.php | 8 +- .../ExcelParseInterface.php | 2 +- .../FileServiceInterface.php | 2 +- .../QuestionParseInterface.php | 2 +- .../QuestionQrCodeInterface.php | 2 +- src/UserService/AdminUserService.php | 9 ++ .../UserDownloadRecordInterface.php | 66 ++++++++++ .../admin/AdminLoginInterface.php | 26 ++++ .../admin/AdminMenuInterface.php | 67 ++++++++++ .../admin/AdminRoleInterface.php | 46 +++++++ .../admin/AdminUserServiceInterface.php | 44 +++++++ .../user/LoginServiceInterface.php | 121 ++++++++++++++++++ .../user/StudentScoreInterface.php | 51 ++++++++ .../user/UserCurriculumVitaeInterface.php | 27 ++++ .../user/UserInfoCheckInterface.php | 30 +++++ .../user/UserServiceInterface.php | 78 +++++++++++ .../wechat/WecheatMiniInterface.php | 14 ++ src/UserService/UserService.php | 15 +++ src/UserService/WecheatMiniService.php | 11 ++ 22 files changed, 775 insertions(+), 8 deletions(-) create mode 100644 consumers/admin_user_service.php create mode 100755 consumers/user_service.php create mode 100755 consumers/wecheat_service.php rename src/FileService/{ => JsonRpcInterface}/ExcelParseInterface.php (79%) rename src/FileService/{ => JsonRpcInterface}/FileServiceInterface.php (89%) rename src/FileService/{ => JsonRpcInterface}/QuestionParseInterface.php (89%) rename src/FileService/{ => JsonRpcInterface}/QuestionQrCodeInterface.php (85%) create mode 100644 src/UserService/AdminUserService.php create mode 100644 src/UserService/JsonRpcInterface/UserDownloadRecordInterface.php create mode 100644 src/UserService/JsonRpcInterface/admin/AdminLoginInterface.php create mode 100644 src/UserService/JsonRpcInterface/admin/AdminMenuInterface.php create mode 100644 src/UserService/JsonRpcInterface/admin/AdminRoleInterface.php create mode 100644 src/UserService/JsonRpcInterface/admin/AdminUserServiceInterface.php create mode 100755 src/UserService/JsonRpcInterface/user/LoginServiceInterface.php create mode 100644 src/UserService/JsonRpcInterface/user/StudentScoreInterface.php create mode 100644 src/UserService/JsonRpcInterface/user/UserCurriculumVitaeInterface.php create mode 100644 src/UserService/JsonRpcInterface/user/UserInfoCheckInterface.php create mode 100755 src/UserService/JsonRpcInterface/user/UserServiceInterface.php create mode 100644 src/UserService/JsonRpcInterface/wechat/WecheatMiniInterface.php create mode 100755 src/UserService/UserService.php create mode 100644 src/UserService/WecheatMiniService.php diff --git a/consumers/admin_user_service.php b/consumers/admin_user_service.php new file mode 100644 index 0000000..d1844a7 --- /dev/null +++ b/consumers/admin_user_service.php @@ -0,0 +1,54 @@ + 'AdminUserService', + // 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类 + 'service' => \App\JsonRpcService\UserService\AdminUserService::class, + // 服务提供者的服务协议,可选,默认值为 jsonrpc-http + // 可选 jsonrpc-http jsonrpc jsonrpc-tcp-length-check + 'protocol' => 'jsonrpc-http', + // 负载均衡算法,可选,默认值为 random + 'load_balancer' => 'random', + // 这个消费者要从哪个服务中心获取节点信息,如不配置则不会从服务中心获取节点信息 + 'registry' => [ + 'protocol' => env("CONSUMERS_PROTOCOL", "consul"), + 'address' => env("CONSUMERS_ADDRESS", "http://127.0.0.1:8500"), + ], + // 'nodes' => [ + // ['host' => '172.18.0.4', 'port' => 9502], + // ], + // 配置项,会影响到 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, + ], + ], +]; diff --git a/consumers/user_service.php b/consumers/user_service.php new file mode 100755 index 0000000..2a1ddd5 --- /dev/null +++ b/consumers/user_service.php @@ -0,0 +1,54 @@ + 'UserService', + // 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类 + 'service' => \App\JsonRpcService\UserService\UserService::class, + // 服务提供者的服务协议,可选,默认值为 jsonrpc-http + // 可选 jsonrpc-http jsonrpc jsonrpc-tcp-length-check + 'protocol' => 'jsonrpc-http', + // 负载均衡算法,可选,默认值为 random + 'load_balancer' => 'random', + // 这个消费者要从哪个服务中心获取节点信息,如不配置则不会从服务中心获取节点信息 + 'registry' => [ + 'protocol' => env("CONSUMERS_PROTOCOL", "consul"), + 'address' => env("CONSUMERS_ADDRESS", "http://127.0.0.1:8500"), + ], + // 'nodes' => [ + // ['host' => '172.18.0.4', 'port' => 9502], + // ], + // 配置项,会影响到 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, + ], + ], +]; diff --git a/consumers/wecheat_service.php b/consumers/wecheat_service.php new file mode 100755 index 0000000..33a669d --- /dev/null +++ b/consumers/wecheat_service.php @@ -0,0 +1,54 @@ + 'WecheatMiniService', + // 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类 + 'service' => \App\JsonRpcService\UserService\WecheatMiniService::class, + // 服务提供者的服务协议,可选,默认值为 jsonrpc-http + // 可选 jsonrpc-http jsonrpc jsonrpc-tcp-length-check + 'protocol' => 'jsonrpc-http', + // 负载均衡算法,可选,默认值为 random + 'load_balancer' => 'random', + // 这个消费者要从哪个服务中心获取节点信息,如不配置则不会从服务中心获取节点信息 + 'registry' => [ + 'protocol' => env("CONSUMERS_PROTOCOL", "consul"), + 'address' => env("CONSUMERS_ADDRESS", "http://127.0.0.1:8500"), + ], + // 'nodes' => [ + // ['host' => '172.18.0.4', 'port' => 9502], + // ], + // 配置项,会影响到 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, + ], + ], +]; diff --git a/src/FileService/FileService.php b/src/FileService/FileService.php index badd99e..74c12c1 100644 --- a/src/FileService/FileService.php +++ b/src/FileService/FileService.php @@ -7,7 +7,7 @@ namespace Dhd\Micro\Interface\FileService; interface FileService extends - FileServiceInterface, - QuestionParseInterface, - QuestionQrCodeInterface, - ExcelParseInterface {} + \Dhd\Micro\Interface\JsonRpcInterface\FileService\FileServiceInterface, + \Dhd\Micro\Interface\JsonRpcInterface\FileService\QuestionParseInterface, + \Dhd\Micro\Interface\JsonRpcInterface\FileService\QuestionQrCodeInterface, + \Dhd\Micro\Interface\JsonRpcInterface\FileService\ExcelParseInterface {} diff --git a/src/FileService/ExcelParseInterface.php b/src/FileService/JsonRpcInterface/ExcelParseInterface.php similarity index 79% rename from src/FileService/ExcelParseInterface.php rename to src/FileService/JsonRpcInterface/ExcelParseInterface.php index c8168bb..09eb872 100644 --- a/src/FileService/ExcelParseInterface.php +++ b/src/FileService/JsonRpcInterface/ExcelParseInterface.php @@ -4,7 +4,7 @@ * JsonRpc服务接口 */ -namespace Dhd\Micro\Interface\FileService; +namespace Dhd\Micro\Interface\JsonRpcInterface\FileService; interface ExcelParseInterface { diff --git a/src/FileService/FileServiceInterface.php b/src/FileService/JsonRpcInterface/FileServiceInterface.php similarity index 89% rename from src/FileService/FileServiceInterface.php rename to src/FileService/JsonRpcInterface/FileServiceInterface.php index 70fc25d..e8089c8 100644 --- a/src/FileService/FileServiceInterface.php +++ b/src/FileService/JsonRpcInterface/FileServiceInterface.php @@ -4,7 +4,7 @@ * JsonRpc服务接口 */ -namespace Dhd\Micro\Interface\FileService; +namespace Dhd\Micro\Interface\JsonRpcInterface\FileService; interface FileServiceInterface { diff --git a/src/FileService/QuestionParseInterface.php b/src/FileService/JsonRpcInterface/QuestionParseInterface.php similarity index 89% rename from src/FileService/QuestionParseInterface.php rename to src/FileService/JsonRpcInterface/QuestionParseInterface.php index 689ee0a..677aec1 100644 --- a/src/FileService/QuestionParseInterface.php +++ b/src/FileService/JsonRpcInterface/QuestionParseInterface.php @@ -4,7 +4,7 @@ * JsonRpc服务接口 */ -namespace Dhd\Micro\Interface\FileService; +namespace Dhd\Micro\Interface\JsonRpcInterface\FileService; interface QuestionParseInterface { diff --git a/src/FileService/QuestionQrCodeInterface.php b/src/FileService/JsonRpcInterface/QuestionQrCodeInterface.php similarity index 85% rename from src/FileService/QuestionQrCodeInterface.php rename to src/FileService/JsonRpcInterface/QuestionQrCodeInterface.php index da3b1c0..dd7acdd 100644 --- a/src/FileService/QuestionQrCodeInterface.php +++ b/src/FileService/JsonRpcInterface/QuestionQrCodeInterface.php @@ -4,7 +4,7 @@ * JsonRpc服务接口 */ -namespace Dhd\Micro\Interface\FileService; +namespace Dhd\Micro\Interface\JsonRpcInterface\FileService; interface QuestionQrCodeInterface { diff --git a/src/UserService/AdminUserService.php b/src/UserService/AdminUserService.php new file mode 100644 index 0000000..c5ed8a6 --- /dev/null +++ b/src/UserService/AdminUserService.php @@ -0,0 +1,9 @@ +