| | |
| | | @GetMapping(HOBI + "getKline.action") |
| | | public Result<List<Map<String, Object>>> getKline(@RequestParam String symbol, @RequestParam String line) { |
| | | ResultObject resultObject = new ResultObject(); |
| | | throw new YamiShopBindException("k线图获取失败"); |
| | | // 1min, 5min, 15min, 30min, 60min, 4hour, 1day, 1mon, 1week |
| | | /*try { |
| | | try { |
| | | if ("1quarter".equalsIgnoreCase(line)) { |
| | | line = Kline.PERIOD_QUARTER; |
| | | } |
| | |
| | | Item item = itemService.findBySymbol(symbol); |
| | | if (item != null) { |
| | | if (item.getType().equals(Item.cryptos) && (item.getCurrencyType() != null && item.getCurrencyType() == 1)) { |
| | | *//*QueryWrapper<Ico> iQuery = new QueryWrapper<>(); |
| | | /*QueryWrapper<Ico> iQuery = new QueryWrapper<>(); |
| | | iQuery.eq("symbol", symbol); |
| | | iQuery.eq("symbol_data", item.getSymbolData()); |
| | | Ico ico = icoService.getOne(iQuery); |
| | | if (ico != null) { |
| | | long now = ico.getMarketDate().getTime();*//* |
| | | long now = ico.getMarketDate().getTime();*/ |
| | | long now = item.getCreateTimeTs() * 1000; |
| | | data = data.stream().filter(kline -> kline != null |
| | | && kline.getTs() != null |
| | |
| | | } catch (Exception e) { |
| | | logger.error("getKline error", e); |
| | | throw new YamiShopBindException("k线图获取失败"); |
| | | }*/ |
| | | } |
| | | } |
| | | |
| | | private List<Map<String, Object>> build(List<Kline> data, String line, String symbol) { |