StringRedisTemplate的使用
redisTemplate.opsForValue();//操作字符串
redisTemplate.opsForHash();//操作hash
redisTemplate.opsForList();//操作list
redisTemplate.opsForSet();//操作set
redisTemplate.opsForZSet();//操作有序set
//redis操作Hash
String img = (String) stringRedisTemplate.opsForHash().get("Pelseinfo", String.valueOf(record.get("id")));
stringRedisTemplate.opsForHash().put("Pelseinfo", String.valueOf(record.get("id")), img);
stringRedisTemplate.expire("Pelseinfo",2, TimeUnit.HOURS);
stringRedisTemplate.opsForHash().delete("Pelseinfo", String.valueOf(id));
//redis操作String
String s = stringRedisTemplate.opsForValue().get(user);
stringRedisTemplate.opsForValue().set("thisMonthDdInfoList", JSON.toJSONString(dDInfoList));
stringRedisTemplate.expire(uuser.get(), 30, TimeUnit.MINUTES);//过期时间设为30分钟
stringRedisTemplate.delete(id);//根据key删除缓存