求zset中所有score的和

来源:互联网 发布:hadoop mac和linux 编辑:程序博客网 时间:2024/05/16 17:57
int count = 0;        public Integer getCountBycbsId(Integer id){    Set<TypedTuple<String>> typeTuples = stringRedisTemplate.opsForZSet().rangeWithScores(RedisKeys.CBU_T_CK_TOTAL_COUNT_ZSET +id, 0, -1);    typeTuples.forEach(x->incr(x.getScore()));    return count;    }        public void incr(Double score){    count=count+score.intValue();    }
求出版社的总访问量
0 0
原创粉丝点击