menuKey = AdminRedisKey::adminMenuList(); } /** * @return array * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws RedisException */ public function getMenu(): array { if ($this->redis->exists($this->menuKey,'system')) { return json_decode($this->redis->get($this->menuKey,'system'),true); } $allMenuList = $this->adminMenuModel->getAllMenu(); $data = $this->getDbMenu($allMenuList); $this->redis->set($this->menuKey,json_encode($data),'system'); return $data; } /** * @return void * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws RedisException */ public function delMenu(): void { $this->redis->delete($this->menuKey,'system'); } }