Browse Source

重复代码删除

yuhongqi 4 weeks ago
parent
commit
47c8ffa87f
1 changed files with 2 additions and 47 deletions
  1. 2 47
      fs-common/src/main/java/com/fs/common/core/redis/RedisCache.java

+ 2 - 47
fs-common/src/main/java/com/fs/common/core/redis/RedisCache.java

@@ -180,19 +180,7 @@ public class RedisCache
         return (T) redisTemplate.opsForList().range(key,0,-1);
     }
 
-    /**
-     * 获得缓存的对象id
-     *
-     * @param key 缓存的键值
-     * @return 缓存键值对应的数据
-     */
-    public <T> T popVoiceKey(final String key)
-    {
-        if (Boolean.TRUE.equals(redisTemplate.hasKey(key))) {
-            return (T) redisTemplate.opsForList().leftPop(key);
-        }
-        return null;
-    }
+
 
 
     /**
@@ -339,16 +327,7 @@ public class RedisCache
         return redisTemplate.opsForValue().increment(key, delta);
     }
 
-    /**
-     * 获得list对象的value
-     *
-     * @param key 缓存的键值
-     * @return 缓存键值对应的数据
-     */
-    public <T> T getVoiceAllList(final String key)
-    {
-        return (T) redisTemplate.opsForList().range(key,0,-1);
-    }
+
     /**
      * 获得缓存的对象id
      *
@@ -375,28 +354,4 @@ public class RedisCache
         }
     }
 
-    /**
-     * 添加List消息数据
-     *
-     * @param key 缓存的键值
-     * @param dataList 待缓存的List消息数据
-     * @return 缓存的对象
-     */
-    public <T> long setVoiceList(final String key, final List<T> dataList)
-    {
-        Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
-        return count == null ? 0 : count;
-    }
-
-    /**
-     * 添加List消息数据的key
-     *
-     * @param key 缓存的键值
-     * @param value 待缓存的值
-     * @return 缓存的对象
-     */
-    public <T> void setVoice(final String key, final T value)
-    {
-        redisTemplate.opsForList().rightPush(key, value);
-    }
 }