redis

1. 保存直播间:

redisWriteClient.zaddString(ZhiboRedisKey.ROOM_ALL_LIST_KEY, sid, String.valueOf(baseRoom.getId()));

2. 获取sid从大到小的15个直播间:

redis
 

 

Set<String> roomList = redisReadClient.zrevrangeByScoreString(ZhiboRedisKey.ROOM_ALL_LIST_KEY, sid, 0, 0, 15);

3. 获取sid之后的15个直播间:

redis

Set<String> roomList = redisReadClient.zrangeByScoreString(ZhiboRedisKey.ROOM_ALL_LIST_KEY, sid, Double.MAX_VALUE, 0, 15);

 

 

相关推荐