success($this->service->getCacheServerInfo()); } /** * 查看key内容 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PostMapping("view")] public function view(): ResponseInterface { return $this->success(['content' => $this->service->view($this->request->input('key'))]); } /** * 删除一个缓存 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[DeleteMapping("delete"), Permission("system:cache:delete"), OperationLog] public function delete(): ResponseInterface { return $this->service->delete($this->request->input('key', null)) ? $this->success() : $this->error(); } /** * 清空所有缓存 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[DeleteMapping("clear"), Permission("system:cache:clear"), OperationLog] public function clear(): ResponseInterface { return $this->service->clear() ? $this->success() : $this->error(); } }