This commit is contained in:
Aether
2025-10-10 17:17:55 +08:00
parent 3415f75673
commit 25284c8d0e
4 changed files with 44 additions and 50 deletions

View File

@@ -14,7 +14,7 @@ use App\Validator\TeacherValidator;
use Exception;
use Hyperf\Di\Annotation\Inject;
use Hyperf\RpcServer\Annotation\RpcService;
use MicroService\Contract\DataServiceInterface;
use DHD\Contract\DataServiceInterface;
#[RpcService(name: 'DataService', server: 'jsonrpc-http', protocol: 'jsonrpc-http', publishTo: 'nacos')]
class DataService implements DataServiceInterface

View File

@@ -14,6 +14,7 @@
"require": {
"php": ">=8.1",
"aether/hyperf": "dev-master",
"dhd/contract": "dev-master",
"hyperf/cache": "~3.1.0",
"hyperf/command": "~3.1.0",
"hyperf/config": "~3.1.0",
@@ -52,6 +53,10 @@
{
"type": "git",
"url": "https://gitee.com/devAether666/aether-hyperf.git"
},
{
"type": "git",
"url": "https://gitee.com/devAether666/dhd-contract.git"
}
],
"suggest": {
@@ -63,8 +68,7 @@
},
"autoload": {
"psr-4": {
"App\\": "app/",
"MicroService\\": "extend/MicroService/src/"
"App\\": "app/"
},
"files": []
},

41
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8e6c542d87ccd4c4654a4adb71436e17",
"content-hash": "1e1601cc18fc4c43445818d441fbcd82",
"packages": [
{
"name": "aether/hyperf",
@@ -12,7 +12,7 @@
"source": {
"type": "git",
"url": "https://gitee.com/devAether666/aether-hyperf.git",
"reference": "7dd9644f6b393eb3b9943b78bf8c3b4012c6b6cf"
"reference": "b093eaf3e8d9f7055ae856a7c89a2fcbc22a20b0"
},
"require": {
"hyperf/db-connection": "~3.1.0",
@@ -52,7 +52,7 @@
}
],
"description": "Aether Hyperf Common Components",
"time": "2025-10-09T05:51:23+00:00"
"time": "2025-10-09T09:37:27+00:00"
},
{
"name": "carbonphp/carbon-doctrine-types",
@@ -123,6 +123,38 @@
],
"time": "2024-02-09T16:56:22+00:00"
},
{
"name": "dhd/contract",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://gitee.com/devAether666/dhd-contract.git",
"reference": "5e1f5353356c8fef88684420a4d77b31b79930a4"
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
"DHD\\Contract\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Aether\\Tests\\": "tests/"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Aether",
"email": "aether.dev.666@gmail.com"
}
],
"description": "DHD Micro Service Contract Package",
"time": "2025-10-09T06:31:01+00:00"
},
{
"name": "doctrine/deprecations",
"version": "1.1.5",
@@ -10697,7 +10729,8 @@
"aliases": [],
"minimum-stability": "dev",
"stability-flags": {
"aether/hyperf": 20
"aether/hyperf": 20,
"dhd/contract": 20
},
"prefer-stable": true,
"prefer-lowest": false,

View File

@@ -1,43 +0,0 @@
<?php
declare(strict_types=1);
namespace MicroService\Contract;
interface DataServiceInterface
{
// ----------------- 校区服务 -----------------
public function getCampuses(array $data): array;
public function getCampusBy(int $id): array;
public function createCampus(array $data): int;
public function updateCampus(int $id, array $data): int;
public function deleteCampus(int $id): bool;
/**
* 获取省份列表.
*/
public function getProvinces(): array;
/**
* 根据省份获取城市列表.
* @param string $province 省份名称
*/
public function getCitiesByProvince(string $province): array;
// ----------------- 教师服务 -----------------
public function getTeachers(array $data): array;
public function getTeacherBy(int $id): array;
public function createTeacher(array $data): int;
public function updateTeacher(int $id, array $data): int;
public function deleteTeacher(int $id): bool;
}