| | |
| | | List<Item> itemsTotal; |
| | | List<Item> items = new ArrayList<>(); |
| | | //按字符串排序 |
| | | List<Item> itemList = itemService.cacheGetAll().stream().sorted(Comparator.comparing(Item::getSorted).reversed()).collect(Collectors.toList()); |
| | | List<Item> itemList = itemService.cacheGetAll().stream() |
| | | .sorted(Comparator.comparing( |
| | | item -> Integer.parseInt(item.getSorted()), |
| | | Comparator.reverseOrder() |
| | | )) |
| | | .collect(Collectors.toList()); |
| | | |
| | | //按数字排序 |
| | | // List<Item> itemList = itemService.cacheGetAll().stream().sorted(Comparator.comparing(Item::getSorted, (x,y)->{ |
| | | // int xInt = 0; |
| | |
| | | .build(); |
| | | list.add(dto); |
| | | } else { |
| | | log.error("获取行情接口,realtime is null;币种->{}", item.getSymbol()); |
| | | //log.error("获取行情接口,realtime is null;币种->{}", item.getSymbol()); |
| | | } |
| | | }); |
| | | Result<List<QueryRealtimeDTO>> ok = Result.ok(list); |
| | |
| | | .build(); |
| | | list.add(dto); |
| | | } else { |
| | | log.error("获取行情接口,realtime is null;币种->{}", item.getSymbol()); |
| | | //log.error("获取行情接口,realtime is null;币种->{}", item.getSymbol()); |
| | | } |
| | | }); |
| | | return list; |