redisTemplate将list集合的元素按照添加顺序的倒序进行排列取出
方法 Collections.reverse(list);
public List<String> getStockPush() {
List<String> list = redisTemplate.opsForList().range("stock_push", 0, -1);
if (list != null) {
Collections.reverse(list);
}
return list;
}
方法 Collections.reverse(list);
public List<String> getStockPush() {
List<String> list = redisTemplate.opsForList().range("stock_push", 0, -1);
if (list != null) {
Collections.reverse(list);
}
return list;
}