package com.jxy.marketall.controller;

import com.jxy.common.core.web.Result.AjaxResult;
import com.jxy.common.security.annotation.Logical;
import com.jxy.common.security.annotation.RequiresLogin;
import com.jxy.common.security.annotation.RequiresRoles;
import com.jxy.marketall.service.BTCRealTimeService;
import com.jxy.marketall.vo.QueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @Description btc 实时数据查询
 * @Date 2022/6/20 17:26
 * @Author 杜懿
 */
@RestController
@RequestMapping(value = {"/btc/rt","/BTC/rt"})
@Api(tags = "btc 实时数据")
public class BTCRealTimeController {

    @Autowired
    private BTCRealTimeService rtService;


    @PostMapping(value = {"/profitRate"})
    @ApiOperation(value = "已实现盈利交易占比实时数据 Percent UTXOs in Profit")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult profitRate(QueryVo vo){

        return  rtService.getProfitRateList(vo);
    }

    @PostMapping(value = {"/BTCFees"})
    @ApiOperation(value = "交易费实时数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult fees(QueryVo vo){

        return  rtService.getFeesList(vo);
    }

    @PostMapping(value = {"/BTCVolume"})
    @ApiOperation(value = "交易量实时数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult volume(QueryVo vo){

        return  rtService.getVolumeList(vo);
    }

    @PostMapping(value = {"/eaVolume"})
    @ApiOperation(value = "交易量(找零消除) 实时数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {    "vip","support"}, logical = Logical.OR)
    public AjaxResult eaVolume(QueryVo vo){

        return  rtService.geteaVolumeList(vo);
    }


    @PostMapping(value = {"/address"})
    @ApiOperation(value = "btc 地址统计实时数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间  可以只传开始时间，表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult address(QueryVo vo){

        return  rtService.getAddressList(vo);
    }

    @PostMapping(value = {"/sopr"})
    @ApiOperation(value = "btc 已花费输出盈利比实时数据  Spent Output Profit Ratio  包含sopr、asopr、easopr、sthsopr、lthsopr")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间  可以只传开始时间，表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult sopr(QueryVo vo){

        return  rtService.getSoprList(vo);
    }

    @PostMapping(value = {"/asol"})
    @ApiOperation(value = "btc 已花费输出平均寿命实时数据  Average Spent Output Lifespan  包含asol、eaasol")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间  可以只传开始时间，表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult asol(QueryVo vo){

        return  rtService.getAsolList(vo);
    }

    @PostMapping(value = {"/dormancy"})
    @ApiOperation(value = "btc 已花费输出休眠平均天数实时数据  Average Coin Dormancy  dormancy、eadormancy")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间  可以只传开始时间，表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult dormancy(QueryVo vo){

        return  rtService.getDormancyList(vo);
    }

    @PostMapping(value = {"/cdd"})
    @ApiOperation(value = "btc 币天销毁量实时数据  Coin Days Destroyed  包含cdd、eacdd")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间  可以只传开始时间，表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult cdd(QueryVo vo){

        return  rtService.getCDDList(vo);
    }

    @PostMapping(value = {"/soag"})
    @ApiOperation(value = "btc 币天销毁量年龄分布实时数据  Spent Output Age Bands  包含day1、day7、day30、day60、day90、day180、day365、day730")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间  可以只传开始时间，表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult soag(QueryVo vo){

        return  rtService.getSoagList(vo);
    }



    @PostMapping(value = {"/price"})
    @ApiOperation(value = "btc 币价实时数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start", value = "开始时间  可以只传开始时间，表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false)})
    //@RequiresLogin
    //@RequiresRoles(value = {"vip","support"}, logical = Logical.OR)
    public AjaxResult price(QueryVo vo){

        return  rtService.getPrice(vo);
    }

}
