success($this->service->getPageList($this->request->all())); } /** * 岗位回收站分页列表 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[GetMapping("recycle"), Permission("system:post:recycle")] public function recycle(): ResponseInterface { return $this->success($this->service->getPageListByRecycle($this->request->all())); } /** * 获取岗位列表 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[GetMapping("list")] public function list(): ResponseInterface { return $this->success($this->service->getList()); } /** * 保存数据 * @param SystemPostRequest $request * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PostMapping("save"), Permission("system:post:save"), OperationLog] public function save(SystemPostRequest $request): ResponseInterface { return $this->success(['id' => $this->service->save($request->all())]); } /** * 获取一条数据信息 * @param int $id * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[GetMapping("read/{id}"), Permission("system:post:read")] public function read(int $id): ResponseInterface { return $this->success($this->service->read($id)); } /** * 更新数据 * @param int $id * @param SystemPostRequest $request * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PutMapping("update/{id}"), Permission("system:post:update"), OperationLog] public function update(int $id, SystemPostRequest $request): ResponseInterface { return $this->service->update($id, $request->all()) ? $this->success() : $this->error(); } /** * 单个或批量删除数据到回收站 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[DeleteMapping("delete"), Permission("system:post:delete")] public function delete(): ResponseInterface { return $this->service->delete((array) $this->request->input('ids', [])) ? $this->success() : $this->error(); } /** * 单个或批量真实删除数据 (清空回收站) * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[DeleteMapping("realDelete"), Permission("system:post:realDelete"), OperationLog] public function realDelete(): ResponseInterface { return $this->service->realDelete((array) $this->request->input('ids', [])) ? $this->success() : $this->error(); } /** * 单个或批量恢复在回收站的数据 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PutMapping("recovery"), Permission("system:post:recovery")] public function recovery(): ResponseInterface { return $this->service->recovery((array) $this->request->input('ids', [])) ? $this->success() : $this->error(); } /** * 更改岗位状态 * @param SystemPostRequest $request * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PutMapping("changeStatus"), Permission("system:post:changeStatus"), OperationLog] public function changeStatus(SystemPostRequest $request): ResponseInterface { return $this->service->changeStatus((int) $request->input('id'), (string) $request->input('status')) ? $this->success() : $this->error(); } /** * 数字运算操作 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PutMapping("numberOperation"), Permission("system:post:update"), OperationLog] public function numberOperation(): ResponseInterface { return $this->service->numberOperation( (int) $this->request->input('id'), (string) $this->request->input('numberName'), (int) $this->request->input('numberValue', 1), ) ? $this->success() : $this->error(); } }