panlinlin
2021-05-08 e48fa711a3664bece9b3e58840a75fe7c05bc47c
src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java
@@ -4,8 +4,6 @@
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.*;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -16,6 +14,7 @@
 * @date:   2020年5月6日 下午8:27:29     
 */
@Component
@SuppressWarnings(value = {"rawtypes", "unchecked"})
public class RedisUtil {
   @Autowired
@@ -397,7 +396,7 @@
     * @param value
     * @param score
     */
    public void zAdd(String key, String value, double score) {
    public void zAdd(Object key, Object value, double score) {
        redisTemplate.opsForZSet().add(key, value, score);
    }
@@ -407,7 +406,7 @@
     * @param key
     * @param value
     */
    public void zRemove(String key, String value) {
    public void zRemove(Object key, Object value) {
        redisTemplate.opsForZSet().remove(key, value);
    }
@@ -418,7 +417,7 @@
     * @param value
     * @param score
     */
    public Double zIncrScore(String key, String value, double score) {
    public Double zIncrScore(Object key, Object value, double score) {
        return redisTemplate.opsForZSet().incrementScore(key, value, score);
    }
@@ -429,7 +428,7 @@
     * @param value
     * @return
     */
    public Double zScore(String key, String value) {
    public Double zScore(Object key, Object value) {
        return redisTemplate.opsForZSet().score(key, value);
    }
@@ -440,7 +439,7 @@
     * @param value
     * @return
     */
    public Long zRank(String key, String value) {
    public Long zRank(Object key, Object value) {
        return redisTemplate.opsForZSet().rank(key, value);
    }
@@ -450,7 +449,7 @@
     * @param key
     * @return
     */
    public Long zSize(String key) {
    public Long zSize(Object key) {
        return redisTemplate.opsForZSet().zCard(key);
    }
@@ -464,7 +463,7 @@
     * @param end
     * @return
     */
    public Set<String> ZRange(String key, int start, int end) {
    public Set<Object> ZRange(Object key, int start, int end) {
        return redisTemplate.opsForZSet().range(key, start, end);
    }
    /**
@@ -475,7 +474,7 @@
     * @param end
     * @return
     */
    public Set<ZSetOperations.TypedTuple<String>> zRangeWithScore(String key, int start, int end) {
    public Set<ZSetOperations.TypedTuple<String>> zRangeWithScore(Object key, int start, int end) {
        return redisTemplate.opsForZSet().rangeWithScores(key, start, end);
    }
    /**
@@ -488,7 +487,7 @@
     * @param end
     * @return
     */
    public Set<String> zRevRange(String key, int start, int end) {
    public Set<String> zRevRange(Object key, int start, int end) {
        return redisTemplate.opsForZSet().reverseRange(key, start, end);
    }
    /**
@@ -499,7 +498,7 @@
     * @param max
     * @return
     */
    public Set<String> zSortRange(String key, int min, int max) {
    public Set<String> zSortRange(Object key, int min, int max) {
        return redisTemplate.opsForZSet().rangeByScore(key, min, max);
    }