composer包
This commit is contained in:
@@ -5,6 +5,8 @@ declare(strict_types=1);
|
||||
namespace App\JsonRpc\Service;
|
||||
|
||||
use Aether\Exception\BusinessException;
|
||||
use App\Exception\CampusNotFound;
|
||||
use App\Exception\TeacherNotFound;
|
||||
use App\Model\Campus;
|
||||
use App\Model\Teacher;
|
||||
use App\Validator\CampusValidator;
|
||||
@@ -45,7 +47,7 @@ class DataService implements DataServiceInterface
|
||||
{
|
||||
$campus = $this->campusModel->find($id);
|
||||
if (! $campus || $campus->status != 1) {
|
||||
throw new BusinessException('校区不存在或已禁用', 10001);
|
||||
throw new CampusNotFound('校区不存在或已禁用');
|
||||
}
|
||||
return $campus->toArray();
|
||||
}
|
||||
@@ -122,7 +124,7 @@ class DataService implements DataServiceInterface
|
||||
{
|
||||
$teacher = $this->teacherModel->find($id);
|
||||
if (! $teacher || $teacher->status != 1) {
|
||||
throw new BusinessException('教师不存在或已禁用', 10001);
|
||||
throw new TeacherNotFound();
|
||||
}
|
||||
return $teacher->toArray();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user