springboot环境下springDataRedis安装和常用操作

  docker中安装Redis容器  添加依赖 service中注入模板 使用示例:  设置过期时间为十秒       stringRedisTemplate.opsForValue().set("test", "100",60*10,TimeUnit.SECONDS);//向redis里存入数据和设置缓存时间stringRedisTemplate.opsForValue().get("test
相关文章
相关标签/搜索