package com.jxy.binance.controller;

/**
 * @Description TODO
 * @Date 2022/6/27 10:28
 * @Author 杜懿
 */

import com.jxy.binance.dto.InsertDBDto;
import com.jxy.binance.dto.InsertTimeDataToDBDto;
import com.jxy.binance.dto.TestVo;
import com.jxy.binance.service.impl.BiAnServiceImpl;
import com.jxy.common.core.web.Result.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description btc查询
 * @Date 2022/6/20 17:26
 * @Author 杜懿
 */
@RestController
@RequestMapping("/bian")
@Api(tags = "bian查询接口")
public class TestController {

    @Autowired
    private BiAnServiceImpl biAnService;

    @PostMapping("/B/allToDB")
    @ApiOperation(value = "币安 币本位 补全数据",response = List.class)
    public AjaxResult allBToDB(@RequestBody InsertDBDto dto){

        return  biAnService.allBDataToDb(dto);
    }

    @PostMapping("/U/allToDB")
    @ApiOperation(value = "币安 U本位 补全数据",response = List.class)
    public AjaxResult allUToDB(@RequestBody InsertDBDto dto){

        return  biAnService.allUDataToDb(dto);
    }

    @PostMapping("/S/allToDB")
    @ApiOperation(value = "币安 现货 补全数据",response = List.class)
    public AjaxResult allStockToDB(@RequestBody InsertDBDto dto){

        return  biAnService.allStockDataToDb(dto);
    }



    @PostMapping("/totalClosePrice")
    @ApiOperation(value = "币安 条件查询",response = List.class)
    public AjaxResult totalClosePrice(@RequestBody TestVo vo){

        return  biAnService.getTotalClosePrice(vo.getNum());
    }

}
