..
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\Teacher;
|
||||
use App\Model\Teacher;
|
||||
use App\Validator\TeacherValidator;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\RpcServer\Annotation\RpcService;
|
||||
use MicroService\Contract\TeacherServiceInterface;
|
||||
|
||||
@@ -15,8 +20,24 @@ use MicroService\Contract\TeacherServiceInterface;
|
||||
protocol: 'jsonrpc-http',
|
||||
publishTo: 'nacos'
|
||||
)]
|
||||
class TeacherService implements TeacherServiceInterface
|
||||
class TeacherService extends AetherCrudService implements TeacherServiceInterface
|
||||
{
|
||||
#[Inject]
|
||||
protected Teacher $model;
|
||||
|
||||
#[Inject]
|
||||
protected TeacherValidator $validator;
|
||||
|
||||
protected function getModel(): AetherModel
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
protected function getValidator(): AetherValidator
|
||||
{
|
||||
return $this->validator;
|
||||
}
|
||||
|
||||
public function getTeacherById(int $id): array
|
||||
{
|
||||
$teacher = Teacher::find($id);
|
||||
|
||||
Reference in New Issue
Block a user