Compare commits

..

3 Commits

Author SHA1 Message Date
堂吉诃德拉曼查的英豪
44fae8b976 Merge remote-tracking branch 'origin/main' into zd-feature 2026-08-06 09:49:25 +08:00
堂吉诃德拉曼查的英豪
6fa83dd193 Revert "DataService契约按实际提供方修正,拆分Course/Exam服务契约并补消费者配置"
This reverts commit 64a5645e60.
2026-08-06 09:37:22 +08:00
zj
1bdbaec19a update 2026-08-06 09:28:32 +08:00
7 changed files with 12 additions and 101 deletions

View File

@@ -1,44 +0,0 @@
<?php
/**
* 课程服务
*/
use Dhd\Micro\Interface\CourseService\CourseServiceInterface;
use function Hyperf\Support\env;
return [
// 对应消费者类的 $serviceName
'name' => 'CourseService',
// 服务接口名
'service' => CourseServiceInterface::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,
],
],
];

View File

@@ -1,40 +0,0 @@
<?php
use Dhd\Micro\Interface\ExamService\ExamServiceInterface;
use function Hyperf\Support\env;
return [
// 对应消费者类的 $serviceName
'name' => 'ExamService',
// 服务接口名
'service' => ExamServiceInterface::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,
],
],
];

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Dhd\Micro\Interface\CourseService;
namespace Dhd\Micro\Interface\DataService\Course;
/**
* 课程服务接口

View File

@@ -6,6 +6,9 @@
namespace Dhd\Micro\Interface\DataService;
use Dhd\Micro\Interface\DataService\Course\CourseServiceInterface;
use Dhd\Micro\Interface\DataService\Exam\ExamServiceInterface;
interface DataService extends
DataServiceInterface,
AgreementInterface,
@@ -21,4 +24,6 @@ interface DataService extends
ExcelHeaderFieldsInterface,
DictionaryInterface,
MajorsInterface,
GuideNavInterface {}
GuideNavInterface,
CourseServiceInterface,
ExamServiceInterface {}

View File

@@ -38,8 +38,6 @@ interface DataServiceInterface
// 招考类型相关
public function getExamTypes(array $data): array;
public function getExamTypeBy(int $id): array;
public function createExamType(array $data): int;
public function updateExamType(int $id, array $data): bool;
public function deleteExamType(int $id): bool;
public function getExamTypesByCampusId(int $campusId): array;
public function getExamTypeByIds(array $ids): array;
@@ -47,19 +45,8 @@ interface DataServiceInterface
// 科目相关
public function getSubjects(array $data): array;
public function getSubjectBy(int $id): array;
public function createSubject(array $data): int;
public function updateSubject(int $id, array $data): bool;
public function deleteSubject(int $id): bool;
public function getSubjectsByExamTypeId(int $examTypeId): array;
// 关联关系相关
public function getRelations(array $params): array;
public function createRelation(array $data): int;
public function updateRelation(int $id, array $data): bool;
public function deleteRelation(int $id): bool;
public function getCategoryIdsByRelation(int $campusId, int $examTypeId, int $subjectId): array;
// 批量更新校区排序
public function batchUpdateCampusSort(array $sorts): bool;
}

View File

@@ -1,6 +1,6 @@
<?php
namespace Dhd\Micro\Interface\ExamService;
namespace Dhd\Micro\Interface\DataService\Exam;
interface ExamServiceInterface extends GufenPaperInterface
{
@@ -334,6 +334,7 @@ interface ExamServiceInterface extends GufenPaperInterface
// 试卷相关
// 试卷相关
/**
* 创建试卷.
* @param array $params
@@ -488,6 +489,7 @@ interface ExamServiceInterface extends GufenPaperInterface
*/
public function getErrorStats(int $userId, int $questionId): array;
/**
* 保存用户答题记录.
* @param array $params
@@ -516,6 +518,7 @@ interface ExamServiceInterface extends GufenPaperInterface
*/
public function batchUpdateScores(array $params): bool;
public function getCategoryList(array $params): array;
public function getSubQuestionCategoryList(array $data): array;

View File

@@ -1,6 +1,6 @@
<?php
namespace Dhd\Micro\Interface\ExamService;
namespace Dhd\Micro\Interface\DataService\Exam;
interface GufenPaperInterface
{