diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java index 1f91350ab..b31929b32 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java @@ -136,10 +136,15 @@ public class RedisCache * @param dataSet 缓存的数据 * @return 缓存数据的对象 */ - public long setCacheSet(final String key, final Set dataSet) + public BoundSetOperations setCacheSet(final String key, final Set dataSet) { - Long count = redisTemplate.opsForSet().add(key, dataSet); - return count == null ? 0 : count; + BoundSetOperations setOperation = redisTemplate.boundSetOps(key); + Iterator it = dataSet.iterator(); + while (it.hasNext()) + { + setOperation.add(it.next()); + } + return setOperation; } /**