This commit is contained in:
阿不叮咚
2025-09-24 16:37:22 +08:00
parent 998f8d8356
commit 1f6b60ee0f
8 changed files with 217 additions and 360 deletions

View File

@@ -4,8 +4,13 @@ declare(strict_types=1);
namespace App\JsonRpc\Service;
use Aether\AetherCrudService;
use Aether\AetherModel;
use Aether\AetherValidator;
use Aether\Exception\BusinessException;
use Aether\Campus;
use App\Model\Campus;
use App\Validator\CampusValidator;
use Hyperf\Di\Annotation\Inject;
use Hyperf\RpcServer\Annotation\RpcService;
use MicroService\Contract\CampusServiceInterface;
@@ -15,8 +20,24 @@ use MicroService\Contract\CampusServiceInterface;
protocol: 'jsonrpc-http',
publishTo: 'nacos'
)]
class CampusService implements CampusServiceInterface
class CampusService extends AetherCrudService implements CampusServiceInterface
{
#[Inject]
protected Campus $model;
#[Inject]
protected CampusValidator $validator;
protected function getModel(): AetherModel
{
return $this->model;
}
protected function getValidator(): AetherValidator
{
return $this->validator;
}
public function getCampusById(int $id): array
{
$campus = Campus::find($id);