1.redis 存储 hash 数据
List<MenuInfoForm> firstFormList = new ArrayList<>();
//存储 firstFormList 数据
redisService.hset("hkey", "key", JSON.toJSONString(firstFormList));
//获取 firstFormList 数据
String firstFormListString = redisService.hget("hkey","key");
firstFormList = JSON.parseArray(menuinfoJiajiaoTree, MenuInfoForm.class);
2.redis 获取 hkey下所有的key,并删除
Set<String> keyList= redisService.hkeys("hkey"); for(String key:keyList){ redisService.hdel(hashKey,key); }