redisTemplate应用

小常识 :key值拿 : 区分自动分配命名区间。

存值 string  opsForValue.set() 赋值

    opsForValue.get()取值 

       list opsForList.leftPushAll()赋值

      opsForList.rang(key,0.-1)取值

     加时效 expire(key,long,TimeUnit)时间

    .opsForValue().setIfAbsent 存值若以存在则返回false

talk is cheap. show me the code.
原文地址:https://www.cnblogs.com/yushizhang/p/10897919.html