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