1.方法

Collections.reverse(list);

 

 

2.代码示例

/**
     * 从redis中将现场状态的记录全部取出
     * @param aucId
     * @return
     */
    @RequestMapping(value = "/findAllAuctionLocalStatementRecord", method = RequestMethod.POST)
    @ResponseBody
    public List<Object> findAllAuctionLocalStatementRecord(String aucId) {
        if (logger.isDebugEnabled()) {
            logger.debug("findAllAuctionLocalStatementRecord, aucId:{}", aucId);
        }
        
        List<Object> list = redisTemplateListDTO.opsForValue().get("auctionLocalStatement"+aucId);
        Collections.reverse(list);//将list集合倒序排列取出,时间最新的在最上面
        
        return list;
    }

 

相关文章:

  • 2022-01-02
  • 2022-01-09
  • 2021-12-29
  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2021-11-04
相关资源
相似解决方案