springboot環境下springDataRedis安裝和常用操作

  docker中安裝Redis容器  添加依賴 service中注入模板 使用示例:  設置過期時間爲十秒       stringRedisTemplate.opsForValue().set("test", "100",60*10,TimeUnit.SECONDS);//向redis裏存入數據和設置緩存時間stringRedisTemplate.opsForValue().get("test
相關文章
相關標籤/搜索