| | |
| | | package com.xcong.excoin.modules.symbols.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.huobi.client.model.Candlestick; |
| | | import com.xcong.excoin.common.contants.AppContants; |
| | | import com.xcong.excoin.common.enumerates.SymbolEnum; |
| | | import com.xcong.excoin.common.response.Result; |
| | | import com.xcong.excoin.common.system.mapper.CandlestickMapper; |
| | | import com.xcong.excoin.modules.newPrice.ExchangeInfoEnum; |
| | | import com.xcong.excoin.modules.newPrice.ExchangeLoginService; |
| | | import com.xcong.excoin.modules.newPrice.KlineVo; |
| | |
| | | import com.xcong.excoin.modules.platform.entity.PlatformCnyUsdtExchangeEntity; |
| | | import com.xcong.excoin.modules.symbols.parameter.dto.KlineDetailDto; |
| | | import com.xcong.excoin.modules.symbols.parameter.vo.HomeSymbolsVo; |
| | | import com.xcong.excoin.modules.symbols.parameter.vo.KlineDataVo; |
| | | import com.xcong.excoin.modules.symbols.service.SymbolsService; |
| | | import com.xcong.excoin.utils.CoinTypeConvert; |
| | | import com.xcong.excoin.utils.MessageSourceUtils; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import com.xcong.excoin.utils.api.ApiClient; |
| | | import com.xcong.excoin.utils.api.response.Kline; |
| | | import com.xcong.excoin.utils.api.response.KlineResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | |
| | |
| | | String key = "KINE_{}_{}"; |
| | | // 币币k线数据 |
| | | if (AppContants.HOME_SYMBOLS_COIN == klineDetailDto.getType()) { |
| | | key = StrUtil.format(key, klineDetailDto.getSymbol(), klineDetailDto.getBar()); |
| | | key = StrUtil.format(key, klineDetailDto.getInstId(), klineDetailDto.getBar()); |
| | | // 合约k线数据 |
| | | } else { |
| | | key = StrUtil.format(key, klineDetailDto.getSymbol(), klineDetailDto.getBar()); |
| | | key = StrUtil.format(key, klineDetailDto.getInstId(), klineDetailDto.getBar()); |
| | | } |
| | | |
| | | String data = redisUtils.getString(key); |