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 Exception;
use Hyperf\Di\Annotation\Inject; use Hyperf\Di\Annotation\Inject;
use Hyperf\RpcServer\Annotation\RpcService; use Hyperf\RpcServer\Annotation\RpcService;
use MicroService\Contract\DataServiceInterface; use DHD\Contract\DataServiceInterface;
#[RpcService(name: 'DataService', server: 'jsonrpc-http', protocol: 'jsonrpc-http', publishTo: 'nacos')] #[RpcService(name: 'DataService', server: 'jsonrpc-http', protocol: 'jsonrpc-http', publishTo: 'nacos')]
class DataService implements DataServiceInterface class DataService implements DataServiceInterface

View File

@@ -14,6 +14,7 @@
"require": { "require": {
"php": ">=8.1", "php": ">=8.1",
"aether/hyperf": "dev-master", "aether/hyperf": "dev-master",
"dhd/contract": "dev-master",
"hyperf/cache": "~3.1.0", "hyperf/cache": "~3.1.0",
"hyperf/command": "~3.1.0", "hyperf/command": "~3.1.0",
"hyperf/config": "~3.1.0", "hyperf/config": "~3.1.0",
@@ -52,6 +53,10 @@
{ {
"type": "git", "type": "git",
"url": "https://gitee.com/devAether666/aether-hyperf.git" "url": "https://gitee.com/devAether666/aether-hyperf.git"
},
{
"type": "git",
"url": "https://gitee.com/devAether666/dhd-contract.git"
} }
], ],
"suggest": { "suggest": {
@@ -63,8 +68,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"App\\": "app/", "App\\": "app/"
"MicroService\\": "extend/MicroService/src/"
}, },
"files": [] "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", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "8e6c542d87ccd4c4654a4adb71436e17", "content-hash": "1e1601cc18fc4c43445818d441fbcd82",
"packages": [ "packages": [
{ {
"name": "aether/hyperf", "name": "aether/hyperf",
@@ -12,7 +12,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://gitee.com/devAether666/aether-hyperf.git", "url": "https://gitee.com/devAether666/aether-hyperf.git",
"reference": "7dd9644f6b393eb3b9943b78bf8c3b4012c6b6cf" "reference": "b093eaf3e8d9f7055ae856a7c89a2fcbc22a20b0"
}, },
"require": { "require": {
"hyperf/db-connection": "~3.1.0", "hyperf/db-connection": "~3.1.0",
@@ -52,7 +52,7 @@
} }
], ],
"description": "Aether Hyperf Common Components", "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", "name": "carbonphp/carbon-doctrine-types",
@@ -123,6 +123,38 @@
], ],
"time": "2024-02-09T16:56:22+00:00" "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", "name": "doctrine/deprecations",
"version": "1.1.5", "version": "1.1.5",
@@ -10697,7 +10729,8 @@
"aliases": [], "aliases": [],
"minimum-stability": "dev", "minimum-stability": "dev",
"stability-flags": { "stability-flags": {
"aether/hyperf": 20 "aether/hyperf": 20,
"dhd/contract": 20
}, },
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "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;
}