//package com.jxy.marketall.utils;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.jxy.common.core.utils.DateUtils;
//import com.jxy.marketall.entity.BTCBigAmountVout;
//import com.jxy.marketall.entity.BiAn;
//import com.jxy.marketall.entity.BinanceKLine;
//import com.jxy.marketall.service.BTCBigAmountVoutService;
//import com.jxy.marketall.vo.BTCVo;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.annotation.Scheduled;
//
//import java.time.LocalDate;
//import java.util.Date;
//import java.util.List;
//
//
///**
// * @Description TODO
// * @Date 2022/6/21 18:34
// * @Author 杜懿
// */
//public class TestWebSocketClient {
//
//    public static void main(String[] args) {
//
//        String message = "{\"stream\":\"btcusdt@kline_1m\",\"data\":{\"e\":\"kline\",\"E\":1657283161791,\"s\":\"BTCUSDT\",\"k\":{\"t\":1657283160000,\"T\":1657283219999,\"s\":\"BTCUSDT\",\"i\":\"1m\",\"f\":2518597347,\"L\":2518597424,\"o\":\"21636.80\",\"c\":\"21635.90\",\"h\":\"21636.80\",\"l\":\"21635.80\",\"v\":\"3.524\",\"n\":78,\"x\":false,\"q\":\"76246.17810\",\"V\":\"1.061\",\"Q\":\"22955.75700\",\"B\":\"0\"}}}\n";
//        //message转json
//        System.out.println(message);
//        JSONObject jsonObject = JSON.parseObject(message);
//        String dataStr = JSONObject.toJSONString(jsonObject.get("data"));
//        //System.out.println(dataStr);
//        String kStr = JSONObject.toJSONString(JSON.parseObject(dataStr).get("k"));
//        //System.out.println(kStr);
//
//        BinanceKLine binanceKLine = JSON.parseObject(kStr, BinanceKLine.class);
//
//        String volumeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("v"));
//        Double volume = JSON.parseObject(volumeStr, Double.class);
//
//        String buyVolumeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("V"));
//        Double buyVolume = JSON.parseObject(buyVolumeStr, Double.class);
//
//        String qualityStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("q"));
//        Double quality = JSON.parseObject(qualityStr, Double.class);
//
//        String buyQualityStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("Q"));
//        Double buyQuality = JSON.parseObject(buyQualityStr, Double.class);
//
//        String lowPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("l"));
//        Double lowPrice = JSON.parseObject(lowPriceStr, Double.class);
//
//        String openTimeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("t"));
//        Date openTime = JSON.parseObject(openTimeStr, Date.class);
//
//        String closeTimeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("T"));
//        Long closeTimeLong = JSON.parseObject(closeTimeStr, Long.class);
//        closeTimeLong +=1;
//
//        Date closeTime = new Date(closeTimeLong);
//
//        BiAn biAn = new BiAn();
//        biAn.setOpenTime(openTime);
//        biAn.setOpenPrice(binanceKLine.getO());
//        biAn.setHighPrice(binanceKLine.getH());
//        biAn.setLowPrice(lowPrice);
//        biAn.setClosePrice(binanceKLine.getC());
//        biAn.setVolume(volume);
//        biAn.setCloseTime(closeTime);
//        biAn.setQuality(quality);
//        biAn.setNum(binanceKLine.getN());
//        biAn.setBuyVolume(buyVolume);
//        biAn.setBuyQuality(buyQuality);
//        biAn.setSymbol(binanceKLine.getS());
//        //json转为具体对象
//        System.out.println(biAn);
//    }
//}
