..
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user