service->list($request->all())); } /** * 创建教师. * @throws Throwable */ #[PostMapping(path: 'teacher')] public function create(): array { return AetherResponse::success($this->service->create($this->request->all()), '教师创建成功'); } /** * 获取教师详情. */ #[GetMapping(path: 'teacher/{id}')] public function get(int $id): array { return AetherResponse::success($this->service->detail($id)); } /** * 更新教师. * @throws Throwable */ #[PutMapping(path: 'teacher/{id}')] public function update(int $id): array { return AetherResponse::success($this->service->update($id, $this->request->all()), '教师更新成功'); } /** * 删除教师. * @throws Throwable */ #[DeleteMapping(path: 'teacher/{id}')] public function delete(int $id): array { return AetherResponse::success($this->service->delete($id), '教师删除成功'); } protected function getService(): AetherCrudService { return $this->service; } }