新建
This commit is contained in:
139
jxy-modules/jxy-binance/pom.xml
Normal file
139
jxy-modules/jxy-binance/pom.xml
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jxy-modules</artifactId>
|
||||
<groupId>com.jxy</groupId>
|
||||
<version>3.5.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jxy-binance</artifactId>
|
||||
|
||||
<description>
|
||||
jxy-binance 币安ws获取数据模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- WebSocket-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.java-websocket</groupId>
|
||||
<artifactId>Java-WebSocket</artifactId>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-maven-plugin</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- JXY Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- JXY Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mybatis-Plus -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- JXY Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- JXY Common swagger -->
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.5.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.6.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jxy.binance;
|
||||
|
||||
import com.jxy.common.security.annotation.EnableCustomConfig;
|
||||
import com.jxy.common.security.annotation.EnableJXYFeignClients;
|
||||
import com.jxy.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/2/5 1:31
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableJXYFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.jxy.binance.mapper")
|
||||
public class JXYBinanceApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
SpringApplication.run(JXYBinanceApplication.class);
|
||||
System.out.println("jxy-binance启动成功");
|
||||
}catch (Exception e){
|
||||
System.out.println(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jxy.binance.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
/**
|
||||
* @Description websocket 配置
|
||||
* @Date 2022/6/30 11:09
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSocketConfig {
|
||||
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter()
|
||||
{
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.jxy.binance.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BiAnWSDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
private Date openTime;
|
||||
|
||||
private Date closeTime;
|
||||
|
||||
private String symbol;
|
||||
|
||||
private BigDecimal closePrice;
|
||||
|
||||
private BigDecimal openPrice;
|
||||
|
||||
private BigDecimal highPrice;
|
||||
|
||||
private BigDecimal lowPrice;
|
||||
|
||||
private BigDecimal volume;
|
||||
|
||||
private BigDecimal quality;
|
||||
|
||||
private BigDecimal buyVolume;
|
||||
|
||||
private BigDecimal buyQuality;
|
||||
|
||||
private BigDecimal num;
|
||||
|
||||
private BigDecimal changeRate;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jxy.binance.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/2/8 12:49
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class InsertDBDto {
|
||||
|
||||
public String interval;
|
||||
|
||||
public String symbol;
|
||||
|
||||
public String table;
|
||||
|
||||
public String start;
|
||||
|
||||
public String end;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.jxy.binance.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/2/8 12:49
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class InsertTimeDataToDBDto {
|
||||
|
||||
public String interval;
|
||||
|
||||
public String symbol;
|
||||
|
||||
public String table;
|
||||
|
||||
public String start;
|
||||
|
||||
public String end;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jxy.binance.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/2/8 15:56
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class TestVo {
|
||||
|
||||
public int num;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.jxy.binance.mapper;
|
||||
|
||||
import com.jxy.binance.dto.BiAnWSDto;
|
||||
import com.jxy.common.datasource.annotation.Master;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/6/20 17:36
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Master
|
||||
public interface BiAnMapper2 {
|
||||
|
||||
public void inserthBtcusdtPERP(@Param("dto") BiAnWSDto biAnWSDto);
|
||||
|
||||
public void insertUSDPERP(@Param("dto") BiAnWSDto biAnWSDto, @Param("table") String table);
|
||||
|
||||
public void insertUSDT(@Param("dto") BiAnWSDto biAnWSDto,@Param("table") String table);
|
||||
|
||||
public void insertStock(@Param("dto") BiAnWSDto biAnWSDto,@Param("table") String table);
|
||||
|
||||
public void batchUSDPERP(@Param("list") List<BiAnWSDto> list, @Param("table") String table);
|
||||
|
||||
public void batchUSDT(@Param("list") List<BiAnWSDto> list,@Param("table") String table);
|
||||
|
||||
public void batchStock(@Param("list") List<BiAnWSDto> list,@Param("table") String table);
|
||||
|
||||
public List<BiAnWSDto> getTotalBTCClosePrice();
|
||||
|
||||
public List<BiAnWSDto> getTotalETHClosePrice();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.jxy.binance.service;
|
||||
|
||||
|
||||
import com.jxy.binance.dto.InsertDBDto;
|
||||
import com.jxy.binance.dto.InsertTimeDataToDBDto;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
|
||||
/**
|
||||
* @Description 币安服务类
|
||||
* @Date 2022/6/20 17:40
|
||||
* @Author 杜懿
|
||||
*/
|
||||
public interface BiAnService{
|
||||
|
||||
public AjaxResult allBDataToDb(InsertDBDto dto);
|
||||
|
||||
public AjaxResult allUDataToDb(InsertDBDto dto);
|
||||
|
||||
public AjaxResult allStockDataToDb(InsertDBDto dto);
|
||||
|
||||
public AjaxResult getTotalClosePrice(int num);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.jxy.binance.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||
import com.jxy.binance.dto.BiAnWSDto;
|
||||
import com.jxy.binance.dto.InsertDBDto;
|
||||
import com.jxy.binance.dto.InsertTimeDataToDBDto;
|
||||
import com.jxy.binance.mapper.BiAnMapper2;
|
||||
import com.jxy.binance.service.BiAnService;
|
||||
import com.jxy.binance.thread.BstreamHistoryThread;
|
||||
import com.jxy.binance.thread.SstreamHistoryThread;
|
||||
import com.jxy.binance.thread.UstreamHistoryThread;
|
||||
import com.jxy.common.core.text.Convert;
|
||||
import com.jxy.common.core.utils.DateUtils;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description BiAn查询业务处理
|
||||
* @Date 2022/6/2017:51
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Service("biAnService")
|
||||
public class BiAnServiceImpl implements BiAnService {
|
||||
|
||||
@Autowired
|
||||
private BiAnMapper2 biAnMapper2;
|
||||
|
||||
public void insertUSDPerp(BiAnWSDto dto, String table){
|
||||
|
||||
biAnMapper2.insertUSDPERP(dto,table);
|
||||
}
|
||||
|
||||
public void insertUSDT(BiAnWSDto dto, String table){
|
||||
|
||||
biAnMapper2.insertUSDT(dto,table);
|
||||
}
|
||||
|
||||
public void insertStock(BiAnWSDto dto, String table){
|
||||
|
||||
biAnMapper2.insertStock(dto,table);
|
||||
}
|
||||
|
||||
public void batchUSDPerp(List<BiAnWSDto> list, String table){
|
||||
|
||||
biAnMapper2.batchUSDPERP(list,table);
|
||||
}
|
||||
|
||||
public void batchUSDT( List<BiAnWSDto> list, String table){
|
||||
|
||||
biAnMapper2.batchUSDT(list,table);
|
||||
}
|
||||
|
||||
public void batchStock(List<BiAnWSDto> list, String table){
|
||||
|
||||
biAnMapper2.batchStock(list,table);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult
|
||||
allBDataToDb(InsertDBDto dto) {
|
||||
|
||||
String symbol = dto.getSymbol().toLowerCase();
|
||||
|
||||
long endTime = DateUtils.parseDate(dto.getEnd()).getTime() - 1 ;
|
||||
|
||||
long start = DateUtils.parseDate(dto.getStart()).getTime() - 1 ;
|
||||
|
||||
Thread thread= new Thread(new BstreamHistoryThread(symbol,start,endTime,dto.getTable(),dto.getInterval()),symbol+"历史数据获取线程");
|
||||
thread.start();
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult allUDataToDb(InsertDBDto dto) {
|
||||
String symbol = dto.getSymbol().toLowerCase();
|
||||
|
||||
long endTime = DateUtils.parseDate(dto.getEnd()).getTime() - 1 ;
|
||||
|
||||
long start = DateUtils.parseDate(dto.getStart()).getTime() - 1 ;
|
||||
|
||||
Thread thread= new Thread(new UstreamHistoryThread(symbol,start,endTime,dto.getTable(),dto.getInterval()),symbol+"历史数据获取线程");
|
||||
thread.start();
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult allStockDataToDb(InsertDBDto dto) {
|
||||
String symbol = dto.getSymbol().toLowerCase();
|
||||
|
||||
long endTime = DateUtils.parseDate(dto.getEnd()).getTime() - 1 ;
|
||||
|
||||
long start = DateUtils.parseDate(dto.getStart()).getTime() - 1 ;
|
||||
|
||||
Thread thread= new Thread(new SstreamHistoryThread(symbol,start,endTime,dto.getTable(),dto.getInterval()),symbol+"历史数据获取线程");
|
||||
thread.start();
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getTotalClosePrice(int num) {
|
||||
|
||||
List<BiAnWSDto> list1 = biAnMapper2.getTotalBTCClosePrice();
|
||||
|
||||
List<BiAnWSDto> list2 = biAnMapper2.getTotalETHClosePrice();
|
||||
|
||||
BigDecimal total1 = BigDecimal.ZERO;
|
||||
BigDecimal total2 = BigDecimal.ZERO;
|
||||
|
||||
for(int i=0 ;i < num;i++){
|
||||
total1 = total1.add(list1.get(i).getClosePrice());
|
||||
}
|
||||
for(int i=0 ;i < num;i++){
|
||||
total2 = total2.add(list2.get(i).getClosePrice());
|
||||
}
|
||||
|
||||
String msg = "BTC:"+total1+"\nETH:"+total2;
|
||||
|
||||
return AjaxResult.success(msg,list1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
package com.jxy.binance.task;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jxy.binance.dto.BiAnWSDto;
|
||||
import com.jxy.binance.service.impl.BiAnServiceImpl;
|
||||
import com.jxy.common.core.utils.SpringUtils;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import org.java_websocket.WebSocket;
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.java_websocket.framing.Framedata;
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URI;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Description B本位WS
|
||||
* @Date 2023/1/31 17:23
|
||||
* @Author 杜懿
|
||||
*/
|
||||
|
||||
/**
|
||||
* baseurl为: wss://dstream.binance.com
|
||||
* 订阅单一stream格式为 /ws/<streamName>
|
||||
* 组合streams的URL格式为 /stream?streams=<streamName1>/<streamName2>/<streamName3>
|
||||
* 订阅组合streams时,事件payload会以这样的格式封装 {"stream":"<streamName>","data":<rawPayload>}
|
||||
* stream名称中所有交易对,标的交易对,合约类型均为小写
|
||||
* 每个链接有效期不超过24小时,请妥善处理断线重连。
|
||||
* 服务端每5分钟会发送ping帧,客户端应当在15分钟内回复pong帧,否则服务端会主动断开链接。允许客户端发送不成对的pong帧(即客户端可以以高于15分钟每次的频率发送pong帧保持链接)。
|
||||
* Websocket服务器每秒最多接受10个订阅消息。
|
||||
* 如果用户发送的消息超过限制,连接会被断开连接。反复被断开连接的IP有可能被服务器屏蔽。
|
||||
* 单个连接最多可以订阅 200 个Streams。
|
||||
*/
|
||||
|
||||
/** 1m 3m 5m 15m 30m 1h 2h 4h 6h 8h 12h 1d 3d 1w 1M */
|
||||
|
||||
/**
|
||||
* Stream Name:
|
||||
* <symbol>@kline_<interval>
|
||||
*/
|
||||
@Component
|
||||
@Order(value = 1)
|
||||
public class BstreamTask implements ApplicationRunner {
|
||||
|
||||
private static BiAnServiceImpl biAnService;
|
||||
|
||||
/** 入库数据 */
|
||||
private static Map<String,List<BiAnWSDto>> dbMap = new HashMap<>();
|
||||
|
||||
/** 推送数据 */
|
||||
private static Map<String,BiAnWSDto> map = new HashMap<>();
|
||||
|
||||
|
||||
private static Map<String,String> tableNameMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
tableNameMap.put("\"btcusdperp1m\"","BTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp3m\"","3mBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp5m\"","5mBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp15m\"","15mBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp30m\"","30mBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp1h\"","1hBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp2h\"","2hBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp4h\"","4hBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp6h\"","6hBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp8h\"","8hBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp12h\"","12hBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp1d\"","1dBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp3d\"","3dBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp1w\"","1wBTCUSDPERP");
|
||||
tableNameMap.put("\"btcusdperp1M\"","1MBTCUSDPERP");
|
||||
|
||||
tableNameMap.put("\"ethusdperp1m\"","ETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp3m\"","3mETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp5m\"","5mETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp15m\"","15mETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp30m\"","30mETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp1h\"","1hETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp2h\"","2hETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp4h\"","4hETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp6h\"","6hETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp8h\"","8hETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp12h\"","12hETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp1d\"","1dETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp3d\"","3dETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp1w\"","1wETHUSDPERP");
|
||||
tableNameMap.put("\"ethusdperp1M\"","1METHUSDPERP");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
System.out.println("币本位连接");
|
||||
|
||||
String url = "wss://dstream.binance.com/stream?streams=btcusd_perp@kline_1m/btcusd_perp@kline_3m/btcusd_perp@kline_5m/btcusd_perp@kline_15m/btcusd_perp@kline_30m/" +
|
||||
"btcusd_perp@kline_1h/btcusd_perp@kline_2h/btcusd_perp@kline_4h/btcusd_perp@kline_6h/btcusd_perp@kline_8h/btcusd_perp@kline_12h/" +
|
||||
"btcusd_perp@kline_1d/btcusd_perp@kline_3d/btcusd_perp@kline_1w/btcusd_perp@kline_1M/" +
|
||||
"ethusd_perp@kline_1m/ethusd_perp@kline_3m/ethusd_perp@kline_5m/ethusd_perp@kline_15m/ethusd_perp@kline_30m/" +
|
||||
"ethusd_perp@kline_1h/ethusd_perp@kline_2h/ethusd_perp@kline_4h/ethusd_perp@kline_6h/ethusd_perp@kline_8h/ethusd_perp@kline_12h/" +
|
||||
"ethusd_perp@kline_1d/ethusd_perp@kline_3d/ethusd_perp@kline_1w/ethusd_perp@kline_1M";
|
||||
|
||||
ScheduledExecutorService ses1 = Executors.newSingleThreadScheduledExecutor();
|
||||
ses1.scheduleAtFixedRate(()->{
|
||||
WebSocketClient ws = getWS(url);
|
||||
|
||||
ScheduledExecutorService ses2 = Executors.newSingleThreadScheduledExecutor();
|
||||
ses2.scheduleAtFixedRate(()->{
|
||||
ws.sendPing();
|
||||
if(!ws.isConnecting()){
|
||||
//如果连接断开重连
|
||||
ws.connect();
|
||||
}},0,3, TimeUnit.MINUTES);
|
||||
|
||||
ScheduledExecutorService ses3 = Executors.newSingleThreadScheduledExecutor();
|
||||
ses3.schedule(()->{ws.close();},18, TimeUnit.HOURS);
|
||||
|
||||
},0,18,TimeUnit.HOURS);
|
||||
//WebSocketClient ws = getWS(url);
|
||||
//String url = "wss://dstream.binance.com/ws/btcusd_perp@kline_1h";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static WebSocketClient getWS(String url){
|
||||
|
||||
try{
|
||||
|
||||
WebSocketClient wbc = new WebSocketClient(new URI(url)) {
|
||||
|
||||
@Override
|
||||
public void onOpen(ServerHandshake handshakedata) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWebsocketPing(WebSocket conn, Framedata f) {
|
||||
conn.sendFrame(f);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onMessage(String message) {
|
||||
|
||||
JSONObject jsonObject = JSON.parseObject(message);
|
||||
|
||||
String stream = JSONObject.toJSONString(jsonObject.get("stream"));
|
||||
String key = stream.replace("_", "").replace("@kline", "");
|
||||
|
||||
String dataStr = JSONObject.toJSONString(jsonObject.get("data"));
|
||||
|
||||
String dateStr = JSONObject.toJSONString(JSON.parseObject(dataStr).get("E"));
|
||||
Date date = JSON.parseObject(dateStr, Date.class);
|
||||
|
||||
String kStr = JSONObject.toJSONString(JSON.parseObject(dataStr).get("k"));
|
||||
|
||||
String openTimeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("t"));
|
||||
Date openTime = JSON.parseObject(openTimeStr, Date.class);
|
||||
|
||||
Calendar openCa = Calendar.getInstance();
|
||||
openCa.setTime(openTime);
|
||||
openCa.add(Calendar.HOUR, +8);
|
||||
openTime = openCa.getTime();
|
||||
|
||||
String closeTimeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("T"));
|
||||
Date closeTime = JSON.parseObject(closeTimeStr, Date.class);
|
||||
|
||||
Calendar closeCa = Calendar.getInstance();
|
||||
closeCa.setTime(closeTime);
|
||||
closeCa.add(Calendar.HOUR, +8);
|
||||
closeTime = closeCa.getTime();
|
||||
|
||||
|
||||
String openPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("o"));
|
||||
BigDecimal openPrice = JSON.parseObject(openPriceStr, BigDecimal.class);
|
||||
|
||||
String highPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("h"));
|
||||
BigDecimal highPrice = JSON.parseObject(highPriceStr, BigDecimal.class);
|
||||
|
||||
String lowPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("l"));
|
||||
BigDecimal lowPrice = JSON.parseObject(lowPriceStr, BigDecimal.class);
|
||||
|
||||
String closePriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("c"));
|
||||
BigDecimal closePrice = JSON.parseObject(closePriceStr, BigDecimal.class);
|
||||
|
||||
String volumeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("v"));
|
||||
BigDecimal volume = JSON.parseObject(volumeStr, BigDecimal.class);
|
||||
|
||||
String qualityStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("q"));
|
||||
BigDecimal quality = JSON.parseObject(qualityStr, BigDecimal.class);
|
||||
|
||||
String buyVolumeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("V"));
|
||||
BigDecimal buyVolume = JSON.parseObject(buyVolumeStr, BigDecimal.class);
|
||||
|
||||
String buyQualityStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("Q"));
|
||||
BigDecimal buyQuality = JSON.parseObject(buyQualityStr, BigDecimal.class);
|
||||
|
||||
String numStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("n"));
|
||||
BigDecimal num = JSON.parseObject(numStr, BigDecimal.class);
|
||||
|
||||
String symbolStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("s"));
|
||||
String symbol = JSON.parseObject(symbolStr, String.class);
|
||||
|
||||
//赋值
|
||||
BiAnWSDto dto = new BiAnWSDto();
|
||||
dto.setDate(date);
|
||||
dto.setOpenTime(openTime);
|
||||
dto.setCloseTime(closeTime);
|
||||
dto.setOpenPrice(openPrice);
|
||||
dto.setHighPrice(highPrice);
|
||||
dto.setLowPrice(lowPrice);
|
||||
dto.setClosePrice(closePrice);
|
||||
dto.setVolume(volume);
|
||||
dto.setBuyVolume(buyVolume);
|
||||
dto.setQuality(quality);
|
||||
dto.setBuyQuality(buyQuality);
|
||||
dto.setNum(num);
|
||||
dto.setSymbol(symbol);
|
||||
|
||||
//取值对比
|
||||
if(StringUtils.isNotNull(map.get(key))){
|
||||
//stream不为空 说明map中已有key对应的数据
|
||||
BiAnWSDto oldData = map.get(key);
|
||||
if((oldData.getOpenTime().compareTo(dto.getOpenTime())) != 0){
|
||||
//map中的数据和新传过来的数据开盘时间不一致 则把新数据放入dbMap中
|
||||
if(StringUtils.isNull(dbMap.get(key))){
|
||||
//dbMap中没数据
|
||||
List<BiAnWSDto> list = new ArrayList<>();
|
||||
list.add(oldData);
|
||||
dbMap.put(key,list);
|
||||
}else{
|
||||
List<BiAnWSDto> list = dbMap.get(key);
|
||||
list.add(oldData);
|
||||
dbMap.put(key,list);
|
||||
}
|
||||
//存入数据库
|
||||
insertDataToDb(oldData,key);
|
||||
|
||||
}
|
||||
}
|
||||
map.put(key,dto);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(int code, String reason, boolean remote) {
|
||||
System.out.println("连接已断开");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
System.out.println("连接因为异常断开:");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
};
|
||||
wbc.connect();
|
||||
|
||||
return wbc;
|
||||
}
|
||||
catch (Exception e){
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean insertDataToDb(BiAnWSDto dto,String key){
|
||||
|
||||
String tableName = tableNameMap.get(key);
|
||||
|
||||
if(StringUtils.isNotNull(tableName)){
|
||||
|
||||
biAnService = SpringUtils.getBean("biAnService");
|
||||
biAnService.insertUSDPerp(dto,tableName);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static BiAnWSDto getRealDataBykey(String key){
|
||||
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
public static List<BiAnWSDto> getDbDataByKey(String key){
|
||||
|
||||
return dbMap.get(key);
|
||||
}
|
||||
|
||||
public static Map<String,BiAnWSDto> getAllRealData(){
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Map<String, List<BiAnWSDto>> getAllDbData(){
|
||||
|
||||
return dbMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
package com.jxy.binance.task;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jxy.binance.dto.BiAnWSDto;
|
||||
import com.jxy.binance.service.impl.BiAnServiceImpl;
|
||||
import com.jxy.common.core.utils.SpringUtils;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import org.java_websocket.WebSocket;
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.java_websocket.exceptions.InvalidDataException;
|
||||
import org.java_websocket.framing.Framedata;
|
||||
import org.java_websocket.framing.FramedataImpl1;
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URI;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Description B本位WS
|
||||
* @Date 2023/1/31 17:23
|
||||
* @Author 杜懿
|
||||
*/
|
||||
|
||||
/**
|
||||
* 本篇所列出的所有wss接口的baseurl为: wss://stream.binance.com:9443 或者 wss://stream.binance.com:443
|
||||
* Streams有单一原始 stream 或组合 stream
|
||||
* 单一原始 streams 格式为 /ws/<streamName>
|
||||
* 组合streams的URL格式为 /stream?streams=<streamName1>/<streamName2>/<streamName3>
|
||||
* 订阅组合streams时,事件payload会以这样的格式封装: {"stream":"<streamName>","data":<rawPayload>}
|
||||
* stream名称中所有交易对均为 小写
|
||||
* 每个到 stream.binance.com 的链接有效期不超过24小时,请妥善处理断线重连。
|
||||
* 每3分钟,服务端会发送ping帧,客户端应当在10分钟内回复pong帧,否则服务端会主动断开链接。允许客户端发送不成对的pong帧(即客户端可以以高于10分钟每次的频率发送pong帧保持链接)。
|
||||
* wss://data-stream.binance.com 可以用来订阅市场信息的数据流。 用户信息无法从此URL获得。
|
||||
*/
|
||||
|
||||
/** 1m 3m 5m 15m 30m 1h 2h 4h 6h 8h 12h 1d 3d 1w 1M */
|
||||
|
||||
/**
|
||||
* Stream Name:
|
||||
* <symbol>@kline_<interval>
|
||||
*/
|
||||
@Component
|
||||
@Order(value = 3)
|
||||
public class SstreamTask implements ApplicationRunner {
|
||||
|
||||
private static BiAnServiceImpl biAnService;
|
||||
|
||||
/** 入库数据 */
|
||||
private static Map<String,List<BiAnWSDto>> dbMap = new HashMap<>();
|
||||
|
||||
/** 推送数据 */
|
||||
private static Map<String,BiAnWSDto> map = new HashMap<>();
|
||||
|
||||
|
||||
private static Map<String,String> tableNameMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
tableNameMap.put("\"btcusdt1m\"","BTCUSDT");
|
||||
tableNameMap.put("\"btcusdt3m\"","3mBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt5m\"","5mBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt15m\"","15mBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt30m\"","30mBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt1h\"","1hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt2h\"","2hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt4h\"","4hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt6h\"","6hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt8h\"","8hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt12h\"","12hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt1d\"","1dBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt3d\"","3dBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt1w\"","1wBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt1M\"","1MBTCUSDT");
|
||||
|
||||
tableNameMap.put("\"ethusdt1m\"","ETHUSDT");
|
||||
tableNameMap.put("\"ethusdt3m\"","3mETHUSDT");
|
||||
tableNameMap.put("\"ethusdt5m\"","5mETHUSDT");
|
||||
tableNameMap.put("\"ethusdt15m\"","15mETHUSDT");
|
||||
tableNameMap.put("\"ethusdt30m\"","30mETHUSDT");
|
||||
tableNameMap.put("\"ethusdt1h\"","1hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt2h\"","2hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt4h\"","4hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt6h\"","6hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt8h\"","8hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt12h\"","12hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt1d\"","1dETHUSDT");
|
||||
tableNameMap.put("\"ethusdt3d\"","3dETHUSDT");
|
||||
tableNameMap.put("\"ethusdt1w\"","1wETHUSDT");
|
||||
tableNameMap.put("\"ethusdt1M\"","1METHUSDT");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
|
||||
|
||||
String url = "wss://stream.binance.com:9443/stream?streams=btcusdt@kline_1m/btcusdt@kline_3m/btcusdt@kline_5m/btcusdt@kline_15m/btcusdt@kline_30m/" +
|
||||
"btcusdt@kline_1h/btcusdt@kline_2h/btcusdt@kline_4h/btcusdt@kline_6h/btcusdt@kline_8h/btcusdt@kline_12h/" +
|
||||
"btcusdt@kline_1d/btcusdt@kline_3d/btcusdt@kline_1w/btcusdt@kline_1M/" +
|
||||
"ethusdt@kline_1m/ethusdt@kline_3m/ethusdt@kline_5m/ethusdt@kline_15m/ethusdt@kline_30m/" +
|
||||
"ethusdt@kline_1h/ethusdt@kline_2h/ethusdt@kline_4h/ethusdt@kline_6h/ethusdt@kline_8h/ethusdt@kline_12h/" +
|
||||
"ethusdt@kline_1d/ethusdt@kline_3d/ethusdt@kline_1w/ethusdt@kline_1M";
|
||||
|
||||
ScheduledExecutorService ses1 = Executors.newSingleThreadScheduledExecutor();
|
||||
ses1.scheduleAtFixedRate(()->{
|
||||
WebSocketClient ws = getWS(url);
|
||||
|
||||
ScheduledExecutorService ses2 = Executors.newSingleThreadScheduledExecutor();
|
||||
ses2.scheduleAtFixedRate(()->{
|
||||
ws.sendPing();
|
||||
if(!ws.isConnecting()){
|
||||
//如果连接断开重连
|
||||
ws.connect();
|
||||
}},0,3, TimeUnit.MINUTES);
|
||||
|
||||
ScheduledExecutorService ses3 = Executors.newSingleThreadScheduledExecutor();
|
||||
ses3.schedule(()->{ws.close();},18, TimeUnit.HOURS);
|
||||
|
||||
},0,18,TimeUnit.HOURS);
|
||||
//WebSocketClient ws = getWS(url);
|
||||
//String url = "wss://dstream.binance.com/ws/btcusd_perp@kline_1h";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static WebSocketClient getWS(String url){
|
||||
|
||||
try{
|
||||
|
||||
WebSocketClient wbc = new WebSocketClient(new URI(url)) {
|
||||
|
||||
@Override
|
||||
public void onOpen(ServerHandshake handshakedata) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWebsocketPing(WebSocket conn, Framedata f) {
|
||||
conn.sendFrame(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String message) {
|
||||
|
||||
JSONObject jsonObject = JSON.parseObject(message);
|
||||
|
||||
String stream = JSONObject.toJSONString(jsonObject.get("stream"));
|
||||
String key = stream.replace("_", "").replace("@kline", "");
|
||||
|
||||
String dataStr = JSONObject.toJSONString(jsonObject.get("data"));
|
||||
|
||||
String dateStr = JSONObject.toJSONString(JSON.parseObject(dataStr).get("E"));
|
||||
Date date = JSON.parseObject(dateStr, Date.class);
|
||||
|
||||
String kStr = JSONObject.toJSONString(JSON.parseObject(dataStr).get("k"));
|
||||
|
||||
String openTimeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("t"));
|
||||
Date openTime = JSON.parseObject(openTimeStr, Date.class);
|
||||
|
||||
Calendar openCa = Calendar.getInstance();
|
||||
openCa.setTime(openTime);
|
||||
openCa.add(Calendar.HOUR, +8);
|
||||
openTime = openCa.getTime();
|
||||
|
||||
String closeTimeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("T"));
|
||||
Date closeTime = JSON.parseObject(closeTimeStr, Date.class);
|
||||
|
||||
Calendar closeCa = Calendar.getInstance();
|
||||
closeCa.setTime(closeTime);
|
||||
closeCa.add(Calendar.HOUR, +8);
|
||||
closeTime = closeCa.getTime();
|
||||
|
||||
|
||||
String openPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("o"));
|
||||
BigDecimal openPrice = JSON.parseObject(openPriceStr, BigDecimal.class);
|
||||
|
||||
String highPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("h"));
|
||||
BigDecimal highPrice = JSON.parseObject(highPriceStr, BigDecimal.class);
|
||||
|
||||
String lowPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("l"));
|
||||
BigDecimal lowPrice = JSON.parseObject(lowPriceStr, BigDecimal.class);
|
||||
|
||||
String closePriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("c"));
|
||||
BigDecimal closePrice = JSON.parseObject(closePriceStr, BigDecimal.class);
|
||||
|
||||
String volumeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("v"));
|
||||
BigDecimal volume = JSON.parseObject(volumeStr, BigDecimal.class);
|
||||
|
||||
String qualityStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("q"));
|
||||
BigDecimal quality = JSON.parseObject(qualityStr, BigDecimal.class);
|
||||
|
||||
String buyVolumeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("V"));
|
||||
BigDecimal buyVolume = JSON.parseObject(buyVolumeStr, BigDecimal.class);
|
||||
|
||||
String buyQualityStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("Q"));
|
||||
BigDecimal buyQuality = JSON.parseObject(buyQualityStr, BigDecimal.class);
|
||||
|
||||
String numStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("n"));
|
||||
BigDecimal num = JSON.parseObject(numStr, BigDecimal.class);
|
||||
|
||||
String symbolStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("s"));
|
||||
String symbol = JSON.parseObject(symbolStr, String.class);
|
||||
|
||||
//赋值
|
||||
BiAnWSDto dto = new BiAnWSDto();
|
||||
dto.setDate(date);
|
||||
dto.setOpenTime(openTime);
|
||||
dto.setCloseTime(closeTime);
|
||||
dto.setOpenPrice(openPrice);
|
||||
dto.setHighPrice(highPrice);
|
||||
dto.setLowPrice(lowPrice);
|
||||
dto.setClosePrice(closePrice);
|
||||
dto.setVolume(volume);
|
||||
dto.setBuyVolume(buyVolume);
|
||||
dto.setQuality(quality);
|
||||
dto.setBuyQuality(buyQuality);
|
||||
dto.setNum(num);
|
||||
dto.setSymbol(symbol);
|
||||
|
||||
//取值对比
|
||||
if(StringUtils.isNotNull(map.get(key))){
|
||||
//stream不为空 说明map中已有key对应的数据
|
||||
BiAnWSDto oldData = map.get(key);
|
||||
if((oldData.getOpenTime().compareTo(dto.getOpenTime())) != 0){
|
||||
//map中的数据和新传过来的数据开盘时间不一致 则把新数据放入dbMap中
|
||||
if(StringUtils.isNull(dbMap.get(key))){
|
||||
//dbMap中没数据
|
||||
List<BiAnWSDto> list = new ArrayList<>();
|
||||
list.add(oldData);
|
||||
dbMap.put(key,list);
|
||||
}else{
|
||||
List<BiAnWSDto> list = dbMap.get(key);
|
||||
list.add(oldData);
|
||||
dbMap.put(key,list);
|
||||
}
|
||||
//存入数据库
|
||||
insertDataToDb(oldData,key);
|
||||
}
|
||||
}
|
||||
map.put(key,dto);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(int code, String reason, boolean remote) {
|
||||
System.out.println("连接已断开");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
System.out.println("连接因为异常断开:");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
};
|
||||
wbc.connect();
|
||||
|
||||
return wbc;
|
||||
}
|
||||
catch (Exception e){
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean insertDataToDb(BiAnWSDto dto,String key){
|
||||
|
||||
String tableName = tableNameMap.get(key);
|
||||
|
||||
if(StringUtils.isNotNull(tableName)){
|
||||
|
||||
biAnService = SpringUtils.getBean("biAnService");
|
||||
biAnService.insertStock(dto,tableName);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static BiAnWSDto getRealDataBykey(String key){
|
||||
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
public static List<BiAnWSDto> getDbDataByKey(String key){
|
||||
|
||||
return dbMap.get(key);
|
||||
}
|
||||
|
||||
public static Map<String,BiAnWSDto> getAllRealData(){
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Map<String, List<BiAnWSDto>> getAllDbData(){
|
||||
|
||||
return dbMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
package com.jxy.binance.task;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jxy.binance.dto.BiAnWSDto;
|
||||
import com.jxy.binance.service.impl.BiAnServiceImpl;
|
||||
import com.jxy.common.core.utils.SpringUtils;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import org.java_websocket.WebSocket;
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.java_websocket.framing.Framedata;
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URI;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Description U本位WS
|
||||
* @Date 2023/1/31 17:23
|
||||
* @Author 杜懿
|
||||
*/
|
||||
|
||||
/**
|
||||
* 连接方式:
|
||||
* Base Url:wss://fstream.binance.com
|
||||
* 订阅单一stream格式为 /ws/<streamName>
|
||||
* 组合streams的URL格式为 /stream?streams=<streamName1>/<streamName2>/<streamName3>
|
||||
* 连接样例:
|
||||
* wss://fstream.binance.com/ws/bnbusdt@aggTrade
|
||||
* wss://fstream.binance.com/stream?streams=bnbusdt@aggTrade/btcusdt@markPrice
|
||||
|
||||
* 每个链接有效期不超过24小时,请妥善处理断线重连。
|
||||
*
|
||||
* 服务端每5分钟会发送ping帧,客户端应当在15分钟内回复pong帧,否则服务端会主动断开链接。允许客户端发送不成对的pong帧(即客户端可以以高于15分钟每次的频率发送pong帧保持链接)。
|
||||
*
|
||||
* Websocket服务器每秒最多接受10个订阅消息。
|
||||
*
|
||||
* 如果用户发送的消息超过限制,连接会被断开连接。反复被断开连接的IP有可能被服务器屏蔽。
|
||||
*
|
||||
* 单个连接最多可以订阅 200 个Streams。
|
||||
*/
|
||||
@Component
|
||||
@Order(value = 2)
|
||||
public class UstreamTask implements ApplicationRunner {
|
||||
|
||||
private static BiAnServiceImpl biAnService;
|
||||
|
||||
/** 入库数据 */
|
||||
private static Map<String,List<BiAnWSDto>> dbMap = new HashMap<>();
|
||||
|
||||
/** 推送数据 */
|
||||
private static Map<String,BiAnWSDto> map = new HashMap<>();
|
||||
|
||||
|
||||
private static Map<String,String> tableNameMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
tableNameMap.put("\"btcusdt1m\"","BTCUSDT");
|
||||
tableNameMap.put("\"btcusdt3m\"","3mBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt5m\"","5mBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt15m\"","15mBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt30m\"","30mBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt1h\"","1hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt2h\"","2hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt4h\"","4hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt6h\"","6hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt8h\"","8hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt12h\"","12hBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt1d\"","1dBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt3d\"","3dBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt1w\"","1wBTCUSDT");
|
||||
tableNameMap.put("\"btcusdt1M\"","1MBTCUSDT");
|
||||
|
||||
tableNameMap.put("\"ethusdt1m\"","ETHUSDT");
|
||||
tableNameMap.put("\"ethusdt3m\"","3mETHUSDT");
|
||||
tableNameMap.put("\"ethusdt5m\"","5mETHUSDT");
|
||||
tableNameMap.put("\"ethusdt15m\"","15mETHUSDT");
|
||||
tableNameMap.put("\"ethusdt30m\"","30mETHUSDT");
|
||||
tableNameMap.put("\"ethusdt1h\"","1hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt2h\"","2hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt4h\"","4hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt6h\"","6hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt8h\"","8hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt12h\"","12hETHUSDT");
|
||||
tableNameMap.put("\"ethusdt1d\"","1dETHUSDT");
|
||||
tableNameMap.put("\"ethusdt3d\"","3dETHUSDT");
|
||||
tableNameMap.put("\"ethusdt1w\"","1wETHUSDT");
|
||||
tableNameMap.put("\"ethusdt1M\"","1METHUSDT");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
|
||||
String url = "wss://fstream.binance.com/stream?streams=btcusdt@kline_1m/btcusdt@kline_3m/btcusdt@kline_5m/btcusdt@kline_15m/btcusdt@kline_30m/" +
|
||||
"btcusdt@kline_1h/btcusdt@kline_2h/btcusdt@kline_4h/btcusdt@kline_6h/btcusdt@kline_8h/btcusdt@kline_12h/" +
|
||||
"btcusdt@kline_1d/btcusdt@kline_3d/btcusdt@kline_1w/btcusdt@kline_1M/" +
|
||||
"ethusdt@kline_1m/ethusdt@kline_3m/ethusdt@kline_5m/ethusdt@kline_15m/ethusdt@kline_30m/" +
|
||||
"ethusdt@kline_1h/ethusdt@kline_2h/ethusdt@kline_4h/ethusdt@kline_6h/ethusdt@kline_8h/ethusdt@kline_12h/" +
|
||||
"ethusdt@kline_1d/ethusdt@kline_3d/ethusdt@kline_1w/ethusdt@kline_1M";
|
||||
|
||||
ScheduledExecutorService ses1 = Executors.newSingleThreadScheduledExecutor();
|
||||
ses1.scheduleAtFixedRate(()->{
|
||||
WebSocketClient ws = getWS(url);
|
||||
|
||||
ScheduledExecutorService ses2 = Executors.newSingleThreadScheduledExecutor();
|
||||
ses2.scheduleAtFixedRate(()->{
|
||||
ws.sendPing();
|
||||
if(!ws.isConnecting()){
|
||||
//如果连接断开重连
|
||||
ws.connect();
|
||||
}},0,3, TimeUnit.MINUTES);
|
||||
|
||||
ScheduledExecutorService ses3 = Executors.newSingleThreadScheduledExecutor();
|
||||
ses3.schedule(()->{ws.close();},18, TimeUnit.HOURS);
|
||||
|
||||
},0,18,TimeUnit.HOURS);
|
||||
//WebSocketClient ws = getWS(url);
|
||||
//String url = "wss://dstream.binance.com/ws/btcusd_perp@kline_1h";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static WebSocketClient getWS(String url){
|
||||
|
||||
try{
|
||||
|
||||
WebSocketClient wbc = new WebSocketClient(new URI(url)) {
|
||||
|
||||
@Override
|
||||
public void onOpen(ServerHandshake handshakedata) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWebsocketPing(WebSocket conn, Framedata f) {
|
||||
conn.sendFrame(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String message) {
|
||||
|
||||
JSONObject jsonObject = JSON.parseObject(message);
|
||||
|
||||
String stream = JSONObject.toJSONString(jsonObject.get("stream"));
|
||||
//stream:"ethusdt@kline_1m"
|
||||
String key = stream.replace("_", "").replace("@kline", "");
|
||||
|
||||
String dataStr = JSONObject.toJSONString(jsonObject.get("data"));
|
||||
|
||||
String dateStr = JSONObject.toJSONString(JSON.parseObject(dataStr).get("E"));
|
||||
Date date = JSON.parseObject(dateStr, Date.class);
|
||||
|
||||
String kStr = JSONObject.toJSONString(JSON.parseObject(dataStr).get("k"));
|
||||
|
||||
String openTimeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("t"));
|
||||
Date openTime = JSON.parseObject(openTimeStr, Date.class);
|
||||
|
||||
Calendar openCa = Calendar.getInstance();
|
||||
openCa.setTime(openTime);
|
||||
openCa.add(Calendar.HOUR, +8);
|
||||
openTime = openCa.getTime();
|
||||
|
||||
String closeTimeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("T"));
|
||||
Date closeTime = JSON.parseObject(closeTimeStr, Date.class);
|
||||
|
||||
Calendar closeCa = Calendar.getInstance();
|
||||
closeCa.setTime(closeTime);
|
||||
closeCa.add(Calendar.HOUR, +8);
|
||||
closeTime = closeCa.getTime();
|
||||
|
||||
|
||||
String openPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("o"));
|
||||
BigDecimal openPrice = JSON.parseObject(openPriceStr, BigDecimal.class);
|
||||
|
||||
String highPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("h"));
|
||||
BigDecimal highPrice = JSON.parseObject(highPriceStr, BigDecimal.class);
|
||||
|
||||
String lowPriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("l"));
|
||||
BigDecimal lowPrice = JSON.parseObject(lowPriceStr, BigDecimal.class);
|
||||
|
||||
String closePriceStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("c"));
|
||||
BigDecimal closePrice = JSON.parseObject(closePriceStr, BigDecimal.class);
|
||||
|
||||
String volumeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("v"));
|
||||
BigDecimal volume = JSON.parseObject(volumeStr, BigDecimal.class);
|
||||
|
||||
String qualityStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("q"));
|
||||
BigDecimal quality = JSON.parseObject(qualityStr, BigDecimal.class);
|
||||
|
||||
String buyVolumeStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("V"));
|
||||
BigDecimal buyVolume = JSON.parseObject(buyVolumeStr, BigDecimal.class);
|
||||
|
||||
String buyQualityStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("Q"));
|
||||
BigDecimal buyQuality = JSON.parseObject(buyQualityStr, BigDecimal.class);
|
||||
|
||||
String numStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("n"));
|
||||
BigDecimal num = JSON.parseObject(numStr, BigDecimal.class);
|
||||
|
||||
String symbolStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("s"));
|
||||
String symbol = JSON.parseObject(symbolStr, String.class);
|
||||
|
||||
String flagStr = JSONObject.toJSONString(JSON.parseObject(kStr).get("x"));
|
||||
boolean flag = JSON.parseObject(flagStr, Boolean.class);
|
||||
|
||||
//赋值
|
||||
BiAnWSDto dto = new BiAnWSDto();
|
||||
dto.setDate(date);
|
||||
dto.setOpenTime(openTime);
|
||||
dto.setCloseTime(closeTime);
|
||||
dto.setOpenPrice(openPrice);
|
||||
dto.setHighPrice(highPrice);
|
||||
dto.setLowPrice(lowPrice);
|
||||
dto.setClosePrice(closePrice);
|
||||
dto.setVolume(volume);
|
||||
dto.setBuyVolume(buyVolume);
|
||||
dto.setQuality(quality);
|
||||
dto.setBuyQuality(buyQuality);
|
||||
dto.setNum(num);
|
||||
dto.setSymbol(symbol);
|
||||
|
||||
//取值对比
|
||||
if(flag){
|
||||
//是K线最后一条数据 即不再变化的数据
|
||||
//存入数据库
|
||||
insertDataToDb(dto,key);
|
||||
}
|
||||
if(StringUtils.isNotNull(map.get(key))){
|
||||
//stream不为空 说明map中已有key对应的数据
|
||||
BiAnWSDto oldData = map.get(key);
|
||||
if((oldData.getOpenTime().compareTo(dto.getOpenTime())) != 0){
|
||||
//map中的数据和新传过来的数据开盘时间不一致 则把新数据放入dbMap中
|
||||
if(StringUtils.isNull(dbMap.get(key))){
|
||||
//dbMap中没数据
|
||||
List<BiAnWSDto> list = new ArrayList<>();
|
||||
list.add(oldData);
|
||||
dbMap.put(key,list);
|
||||
}else{
|
||||
List<BiAnWSDto> list = dbMap.get(key);
|
||||
list.add(oldData);
|
||||
dbMap.put(key,list);
|
||||
}
|
||||
//存入数据库
|
||||
insertDataToDb(oldData,key);
|
||||
}
|
||||
}
|
||||
map.put(key,dto);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(int code, String reason, boolean remote) {
|
||||
System.out.println("连接已断开");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
System.out.println("连接因为异常断开:");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
};
|
||||
wbc.connect();
|
||||
|
||||
return wbc;
|
||||
}
|
||||
catch (Exception e){
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean insertDataToDb(BiAnWSDto dto,String key){
|
||||
|
||||
String tableName = tableNameMap.get(key);
|
||||
|
||||
if(StringUtils.isNotNull(tableName)){
|
||||
|
||||
biAnService = SpringUtils.getBean("biAnService");
|
||||
biAnService.insertUSDT(dto,tableName);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static BiAnWSDto getRealDataBykey(String key){
|
||||
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
public static List<BiAnWSDto> getDbDataByKey(String key){
|
||||
|
||||
return dbMap.get(key);
|
||||
}
|
||||
|
||||
public static Map<String,BiAnWSDto> getAllRealData(){
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Map<String, List<BiAnWSDto>> getAllDbData(){
|
||||
|
||||
return dbMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.jxy.binance.thread;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.jxy.binance.dto.BiAnWSDto;
|
||||
import com.jxy.binance.service.impl.BiAnServiceImpl;
|
||||
import com.jxy.common.core.text.Convert;
|
||||
import com.jxy.common.core.utils.SpringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/2/7 17:15
|
||||
* @Author 杜懿
|
||||
*/
|
||||
public class BstreamHistoryThread implements Runnable {
|
||||
|
||||
private static BiAnServiceImpl biAnService;
|
||||
|
||||
private static long start;
|
||||
|
||||
private static long endtime;
|
||||
|
||||
private static String table ;
|
||||
|
||||
private static String symbol ;
|
||||
|
||||
private static String interval;
|
||||
|
||||
|
||||
public BstreamHistoryThread(String symbol,Long start,Long endtime,String table,String interval) {
|
||||
this.table = table;
|
||||
this.endtime = endtime;
|
||||
this.symbol = symbol;
|
||||
this.start = start;
|
||||
this.interval = interval;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
biAnService = SpringUtils.getBean("biAnService");
|
||||
|
||||
System.out.println("线程开始执行");
|
||||
|
||||
try {
|
||||
while (!Thread.currentThread().isInterrupted()){
|
||||
|
||||
List<BiAnWSDto> list = getData(symbol,interval,endtime);
|
||||
if(list.size() > 0){
|
||||
//入库
|
||||
biAnService.batchUSDPerp(list,table);
|
||||
endtime = list.get(0).getOpenTime().getTime() - 28800000 - 1;
|
||||
if(start > endtime){
|
||||
Date startDate = new Date(start);
|
||||
System.out.println("开始时间:"+startDate);
|
||||
Date endDate = new Date(endtime);
|
||||
System.out.println("结束时间"+endDate);
|
||||
System.out.println("数据获取完成 停止线程");
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
System.out.println("数据获取完成 停止线程");
|
||||
Thread.currentThread();
|
||||
break;
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
}catch (InterruptedException e){
|
||||
e.printStackTrace();
|
||||
Thread curr = Thread.currentThread();
|
||||
//再次调用interrupt方法中断自己,将中断状态设置为“中断”
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException interruptedException) {
|
||||
interruptedException.printStackTrace();
|
||||
}
|
||||
curr.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
public List<BiAnWSDto> getData(String symbol,String interval,Long endTime){
|
||||
String url = "https://dapi.binance.com/dapi/v1/klines?symbol="+symbol+"&interval="+interval+"&endTime="+endTime+"&limit="+500;
|
||||
String result = HttpUtil.get(url);
|
||||
List<String> list = JSONArray.parseArray(result,String.class);
|
||||
List<BiAnWSDto> returnList = new ArrayList<>();
|
||||
for(int i = 0 ; i < list.size();i++){
|
||||
Object[] objects = JSONArray.parseArray(list.get(i)).stream().toArray();
|
||||
BiAnWSDto biAnWSDto = new BiAnWSDto();
|
||||
biAnWSDto.setOpenTime(new Date(Convert.toLong(objects[0])+28800000));
|
||||
biAnWSDto.setOpenPrice(Convert.toBigDecimal(objects[1]));
|
||||
biAnWSDto.setHighPrice(Convert.toBigDecimal(objects[2]));
|
||||
biAnWSDto.setLowPrice(Convert.toBigDecimal(objects[3]));
|
||||
biAnWSDto.setClosePrice(Convert.toBigDecimal(objects[4]));
|
||||
biAnWSDto.setVolume(Convert.toBigDecimal(objects[5]));
|
||||
biAnWSDto.setCloseTime(new Date(Convert.toLong(objects[6])+28800000+1));
|
||||
biAnWSDto.setQuality(Convert.toBigDecimal(objects[7]));
|
||||
biAnWSDto.setNum(Convert.toBigDecimal(objects[8]));
|
||||
biAnWSDto.setBuyVolume(Convert.toBigDecimal(objects[9]));
|
||||
biAnWSDto.setBuyQuality(Convert.toBigDecimal(objects[10]));
|
||||
biAnWSDto.setSymbol(symbol.toUpperCase());
|
||||
returnList.add(biAnWSDto);
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.jxy.binance.thread;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.jxy.binance.dto.BiAnWSDto;
|
||||
import com.jxy.binance.service.impl.BiAnServiceImpl;
|
||||
import com.jxy.common.core.text.Convert;
|
||||
import com.jxy.common.core.utils.SpringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/2/7 17:15
|
||||
* @Author 杜懿
|
||||
*/
|
||||
public class SstreamHistoryThread implements Runnable {
|
||||
|
||||
private static BiAnServiceImpl biAnService;
|
||||
|
||||
private static long start;
|
||||
|
||||
private static long endtime;
|
||||
|
||||
private static String table ;
|
||||
|
||||
private static String symbol;
|
||||
|
||||
private static String interval;
|
||||
|
||||
|
||||
|
||||
public SstreamHistoryThread(String symbol,Long start,Long endtime,String table,String interval) {
|
||||
this.table = table;
|
||||
this.endtime = endtime;
|
||||
this.symbol = symbol;
|
||||
this.interval = interval;
|
||||
this.start = start;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
biAnService = SpringUtils.getBean("biAnService");
|
||||
|
||||
System.out.println("线程开始执行");
|
||||
|
||||
try {
|
||||
while (!Thread.currentThread().isInterrupted()){
|
||||
List<BiAnWSDto> list = getData(symbol,interval,endtime);
|
||||
if(list.size() > 0){
|
||||
//入库
|
||||
biAnService.batchStock(list,table);
|
||||
endtime = list.get(0).getOpenTime().getTime() - 1;
|
||||
if(start > endtime){
|
||||
Date startDate = new Date(start);
|
||||
System.out.println("开始时间:"+startDate);
|
||||
Date endDate = new Date(endtime);
|
||||
System.out.println("结束时间"+endDate);
|
||||
System.out.println("数据获取完成 停止线程");
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
System.out.println("数据获取完成 停止线程");
|
||||
Thread.currentThread();
|
||||
break;
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
}catch (InterruptedException e){
|
||||
e.printStackTrace();
|
||||
Thread curr = Thread.currentThread();
|
||||
//再次调用interrupt方法中断自己,将中断状态设置为“中断”
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException interruptedException) {
|
||||
interruptedException.printStackTrace();
|
||||
}
|
||||
curr.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
public List<BiAnWSDto> getData(String symbol,String interval,Long endTime){
|
||||
String url = "https://data.binance.com/api/v3/klines?symbol="+symbol+"&interval="+interval+"&endTime="+endTime+"&limit="+500;
|
||||
String result = HttpUtil.get(url);
|
||||
List<String> list = JSONArray.parseArray(result,String.class);
|
||||
List<BiAnWSDto> returnList = new ArrayList<>();
|
||||
for(int i = 0 ; i < list.size();i++){
|
||||
Object[] objects = JSONArray.parseArray(list.get(i)).stream().toArray();
|
||||
BiAnWSDto biAnWSDto = new BiAnWSDto();
|
||||
biAnWSDto.setOpenTime(new Date(Convert.toLong(objects[0])+28800000));
|
||||
biAnWSDto.setOpenPrice(Convert.toBigDecimal(objects[1]));
|
||||
biAnWSDto.setHighPrice(Convert.toBigDecimal(objects[2]));
|
||||
biAnWSDto.setLowPrice(Convert.toBigDecimal(objects[3]));
|
||||
biAnWSDto.setClosePrice(Convert.toBigDecimal(objects[4]));
|
||||
biAnWSDto.setVolume(Convert.toBigDecimal(objects[5]));
|
||||
biAnWSDto.setCloseTime(new Date(Convert.toLong(objects[6])+28800000+1));
|
||||
biAnWSDto.setQuality(Convert.toBigDecimal(objects[7]));
|
||||
biAnWSDto.setNum(Convert.toBigDecimal(objects[8]));
|
||||
biAnWSDto.setBuyVolume(Convert.toBigDecimal(objects[9]));
|
||||
biAnWSDto.setBuyQuality(Convert.toBigDecimal(objects[10]));
|
||||
biAnWSDto.setSymbol(symbol.toUpperCase());
|
||||
returnList.add(biAnWSDto);
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.jxy.binance.thread;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.jxy.binance.dto.BiAnWSDto;
|
||||
import com.jxy.binance.service.impl.BiAnServiceImpl;
|
||||
import com.jxy.common.core.text.Convert;
|
||||
import com.jxy.common.core.utils.SpringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/2/7 17:15
|
||||
* @Author 杜懿
|
||||
*/
|
||||
public class UstreamHistoryThread implements Runnable {
|
||||
|
||||
private static BiAnServiceImpl biAnService;
|
||||
|
||||
private static long start;
|
||||
|
||||
private static long endtime;
|
||||
|
||||
private static String table ;
|
||||
|
||||
private static String symbol;
|
||||
|
||||
private static String interval;
|
||||
|
||||
|
||||
|
||||
public UstreamHistoryThread(String symbol,Long start,Long endtime,String table,String interval) {
|
||||
this.table = table;
|
||||
this.endtime = endtime;
|
||||
this.symbol = symbol;
|
||||
this.start = start;
|
||||
this.interval = interval;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
biAnService = SpringUtils.getBean("biAnService");
|
||||
|
||||
System.out.println("线程开始执行");
|
||||
System.out.println("往数据表"+table+"中插入"+start+"到"+endtime+"的数据,间隔"+interval);
|
||||
|
||||
try {
|
||||
while (!Thread.currentThread().isInterrupted()){
|
||||
List<BiAnWSDto> list = getData(symbol,interval,endtime);
|
||||
if(list.size() > 0){
|
||||
//入库
|
||||
biAnService.batchUSDT(list,table);
|
||||
//开始时间-时区修正值
|
||||
endtime = list.get(0).getOpenTime().getTime() - 28800000 - 1;
|
||||
if(start > endtime){
|
||||
Date startDate = new Date(start);
|
||||
System.out.println("开始时间:"+startDate);
|
||||
Date endDate = new Date(endtime);
|
||||
System.out.println("结束时间"+endDate);
|
||||
System.out.println("数据获取完成 停止线程");
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
System.out.println("数据获取完成 停止线程");
|
||||
Thread.currentThread();
|
||||
break;
|
||||
}
|
||||
Thread.sleep(250);
|
||||
}
|
||||
|
||||
}catch (InterruptedException e){
|
||||
e.printStackTrace();
|
||||
Thread curr = Thread.currentThread();
|
||||
//再次调用interrupt方法中断自己,将中断状态设置为“中断”
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException interruptedException) {
|
||||
interruptedException.printStackTrace();
|
||||
}
|
||||
curr.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
public List<BiAnWSDto> getData(String symbol,String interval,Long endTime){
|
||||
String url = "https://fapi.binance.com/fapi/v1/klines?symbol="+symbol+"&interval="+interval+"&endTime="+endTime+"&limit="+500;
|
||||
String result = HttpUtil.get(url);
|
||||
List<String> list = JSONArray.parseArray(result,String.class);
|
||||
List<BiAnWSDto> returnList = new ArrayList<>();
|
||||
for(int i = 0 ; i < list.size();i++){
|
||||
Object[] objects = JSONArray.parseArray(list.get(i)).stream().toArray();
|
||||
BiAnWSDto biAnWSDto = new BiAnWSDto();
|
||||
biAnWSDto.setOpenTime(new Date(Convert.toLong(objects[0])+28800000));
|
||||
biAnWSDto.setOpenPrice(Convert.toBigDecimal(objects[1]));
|
||||
biAnWSDto.setHighPrice(Convert.toBigDecimal(objects[2]));
|
||||
biAnWSDto.setLowPrice(Convert.toBigDecimal(objects[3]));
|
||||
biAnWSDto.setClosePrice(Convert.toBigDecimal(objects[4]));
|
||||
biAnWSDto.setVolume(Convert.toBigDecimal(objects[5]));
|
||||
biAnWSDto.setCloseTime(new Date(Convert.toLong(objects[6])+28800000+1));
|
||||
biAnWSDto.setQuality(Convert.toBigDecimal(objects[7]));
|
||||
biAnWSDto.setNum(Convert.toBigDecimal(objects[8]));
|
||||
biAnWSDto.setBuyVolume(Convert.toBigDecimal(objects[9]));
|
||||
biAnWSDto.setBuyQuality(Convert.toBigDecimal(objects[10]));
|
||||
biAnWSDto.setSymbol(symbol.toUpperCase());
|
||||
returnList.add(biAnWSDto);
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
}
|
||||
25
jxy-modules/jxy-binance/src/main/resources/bootstrap.yml
Normal file
25
jxy-modules/jxy-binance/src/main/resources/bootstrap.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9205
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: jxy-binance
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
74
jxy-modules/jxy-binance/src/main/resources/logback.xml
Normal file
74
jxy-modules/jxy-binance/src/main/resources/logback.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/jxy-binance" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.jxy" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jxy.binance.mapper.BiAnMapper2">
|
||||
|
||||
<insert id="inserthBtcusdtPERP" parameterType="com.jxy.binance.dto.BiAnWSDto">
|
||||
insert into binance_usd.1hBTCUSDPERP(open_time,close_time,open_price,high_price,
|
||||
low_price,close_price,volume,quality,buy_volume,buy_quality,symbol,num )
|
||||
values (#{dto.openTime}, #{dto.closeTime}, #{dto.openPrice},
|
||||
#{dto.highPrice}, #{dto.lowPrice}, #{dto.closePrice},
|
||||
#{dto.volume}, #{dto.quality}, #{dto.buyVolume}, #{dto.buyQuality}, #{dto.symbol}, #{dto.num})
|
||||
</insert>
|
||||
|
||||
<insert id="insertUSDPERP" parameterType="com.jxy.binance.dto.BiAnWSDto">
|
||||
insert into binance_usd.${table}(open_time,close_time,open_price,high_price,
|
||||
low_price,close_price,volume,quality,buy_volume,buy_quality,symbol,num )
|
||||
values (#{dto.openTime}, #{dto.closeTime}, #{dto.openPrice},
|
||||
#{dto.highPrice}, #{dto.lowPrice}, #{dto.closePrice},
|
||||
#{dto.volume}, #{dto.quality}, #{dto.buyVolume}, #{dto.buyQuality}, #{dto.symbol}, #{dto.num})
|
||||
ON duplicate key update open_time=open_time
|
||||
</insert>
|
||||
|
||||
<insert id="insertStock">
|
||||
insert into binance_stocks.${table}(open_time,close_time,open_price,high_price,
|
||||
low_price,close_price,volume,quality,buy_volume,buy_quality,symbol,num )
|
||||
values (#{dto.openTime}, #{dto.closeTime}, #{dto.openPrice},
|
||||
#{dto.highPrice}, #{dto.lowPrice}, #{dto.closePrice},
|
||||
#{dto.volume}, #{dto.quality}, #{dto.buyVolume}, #{dto.buyQuality}, #{dto.symbol}, #{dto.num})
|
||||
ON duplicate key update open_time=open_time
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="insertUSDT">
|
||||
insert into binance_usdt.${table}(open_time,close_time,open_price,high_price,
|
||||
low_price,close_price,volume,quality,buy_volume,buy_quality,symbol,num,now_date)
|
||||
values (#{dto.openTime}, #{dto.closeTime}, #{dto.openPrice},
|
||||
#{dto.highPrice}, #{dto.lowPrice}, #{dto.closePrice},
|
||||
#{dto.volume}, #{dto.quality}, #{dto.buyVolume}, #{dto.buyQuality}, #{dto.symbol}, #{dto.num},sysdate())
|
||||
ON duplicate key update open_time=open_time,open_price = #{dto.openPrice},high_price = #{dto.highPrice},
|
||||
low_price = #{dto.lowPrice},close_price = #{dto.closePrice},volume = #{dto.volume},quality = #{dto.quality},buy_volume = #{dto.buyVolume}, buy_quality = #{dto.buyQuality},symbol = #{dto.symbol},num =#{dto.num}
|
||||
</insert>
|
||||
|
||||
<insert id="batchUSDPERP">
|
||||
insert into binance_usd.${table}(open_time,close_time,open_price,high_price,
|
||||
low_price,close_price,volume,quality,buy_volume,buy_quality,symbol,num ) values
|
||||
<foreach collection="list" separator="," item="dto" index="index">
|
||||
(#{dto.openTime}, #{dto.closeTime}, #{dto.openPrice},
|
||||
#{dto.highPrice}, #{dto.lowPrice}, #{dto.closePrice},
|
||||
#{dto.volume}, #{dto.quality}, #{dto.buyVolume}, #{dto.buyQuality}, #{dto.symbol}, #{dto.num})
|
||||
</foreach>
|
||||
ON duplicate key update open_time=open_time
|
||||
</insert>
|
||||
|
||||
<insert id="batchUSDT" parameterType="java.util.List">
|
||||
insert into binance_usdt.${table}(open_time,close_time,open_price,high_price,
|
||||
low_price,close_price,volume,quality,buy_volume,buy_quality,symbol,num ) values
|
||||
<foreach collection="list" separator="," item="dto" index="index">
|
||||
(#{dto.openTime}, #{dto.closeTime}, #{dto.openPrice},
|
||||
#{dto.highPrice}, #{dto.lowPrice}, #{dto.closePrice},
|
||||
#{dto.volume}, #{dto.quality}, #{dto.buyVolume}, #{dto.buyQuality}, #{dto.symbol}, #{dto.num})
|
||||
</foreach>
|
||||
ON duplicate key update open_time=open_time
|
||||
</insert>
|
||||
|
||||
<insert id="batchStock">
|
||||
insert into binance_stocks.${table}(open_time,close_time,open_price,high_price,
|
||||
low_price,close_price,volume,quality,buy_volume,buy_quality,symbol,num ) values
|
||||
<foreach collection="list" separator="," item="dto" index="index">
|
||||
(#{dto.openTime}, #{dto.closeTime}, #{dto.openPrice},
|
||||
#{dto.highPrice}, #{dto.lowPrice}, #{dto.closePrice},
|
||||
#{dto.volume}, #{dto.quality}, #{dto.buyVolume}, #{dto.buyQuality}, #{dto.symbol}, #{dto.num})
|
||||
</foreach>
|
||||
ON duplicate key update open_time=open_time
|
||||
</insert>
|
||||
|
||||
<select id="getTotalBTCClosePrice" resultType="com.jxy.binance.dto.BiAnWSDto">
|
||||
select * from binance_usd.1hBTCUSDPERP order by open_time desc;
|
||||
</select>
|
||||
|
||||
<select id="getTotalETHClosePrice" resultType="com.jxy.binance.dto.BiAnWSDto">
|
||||
select * from binance_usd.1hETHUSDPERP order by open_time desc;
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
83
jxy-modules/jxy-file/pom.xml
Normal file
83
jxy-modules/jxy-file/pom.xml
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>jxy-modules</artifactId>
|
||||
<version>3.5.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jxy-file</artifactId>
|
||||
|
||||
<description>
|
||||
jxy-file文件服务
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- FastDFS -->
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
<artifactId>fastdfs-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- JXY Api System -->
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>api-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- JXY Common swagger -->
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.jxy.file;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import com.jxy.common.swagger.annotation.EnableCustomSwagger2;
|
||||
|
||||
/**
|
||||
* 文件服务
|
||||
*
|
||||
* @author jxy
|
||||
*/
|
||||
@EnableCustomSwagger2
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
|
||||
public class JXYFileApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(JXYFileApplication.class, args);
|
||||
System.out.println("jxy文件服务模块启动成功 ლ(´ڡ`ლ)゙ \n");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.jxy.file.config;
|
||||
|
||||
import java.io.File;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* 通用映射配置
|
||||
*
|
||||
* @author jxy
|
||||
*/
|
||||
@Configuration
|
||||
public class ResourcesConfig implements WebMvcConfigurer
|
||||
{
|
||||
/**
|
||||
* 上传文件存储在本地的根路径
|
||||
*/
|
||||
@Value("${file.path}")
|
||||
private String localFilePath;
|
||||
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
@Value("${file.prefix}")
|
||||
public String localFilePrefix;
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry)
|
||||
{
|
||||
/** 本地文件上传路径 */
|
||||
registry.addResourceHandler(localFilePrefix + "/**")
|
||||
.addResourceLocations("file:" + localFilePath + File.separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启跨域
|
||||
*/
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
// 设置允许跨域的路由
|
||||
registry.addMapping(localFilePrefix + "/**")
|
||||
// 设置允许跨域请求的域名
|
||||
.allowedOrigins("*")
|
||||
// 设置允许的方法
|
||||
.allowedMethods("GET");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.jxy.file.controller;
|
||||
|
||||
import com.jxy.common.core.Result.R;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.jxy.common.core.utils.file.FileUtils;
|
||||
import com.jxy.file.service.ISysFileService;
|
||||
import com.jxy.system.api.entity.SysFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 文件请求处理
|
||||
*
|
||||
* @author dy
|
||||
*/
|
||||
@RestController
|
||||
public class SysFileController
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
|
||||
|
||||
@Autowired
|
||||
private ISysFileService sysFileService;
|
||||
|
||||
/**
|
||||
* 上传文件存储在本地的根路径
|
||||
*/
|
||||
@Value("${file.path}")
|
||||
private String localFilePath;
|
||||
|
||||
/**
|
||||
* 文件上传请求
|
||||
*/
|
||||
@PostMapping("upload")
|
||||
public R<SysFile> upload(MultipartFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 上传并返回访问地址
|
||||
String url = sysFileService.uploadFile(file);
|
||||
SysFile sysFile = new SysFile();
|
||||
sysFile.setName(FileUtils.getName(url));
|
||||
sysFile.setUrl(url);
|
||||
return R.success(sysFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("上传文件失败", e);
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("windMinerUploadFile")
|
||||
public R<SysFile> windMinerUploadFile(MultipartFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 上传并返回访问地址
|
||||
String url = sysFileService.windMinerUploadFile(file);
|
||||
SysFile sysFile = new SysFile();
|
||||
sysFile.setName(FileUtils.getName(url));
|
||||
sysFile.setUrl(url);
|
||||
return R.success(sysFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("上传文件失败", e);
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载请求
|
||||
*
|
||||
* @param url 访问路径
|
||||
*/
|
||||
@PostMapping("/download")
|
||||
public void fileDownload(@RequestBody() String url, HttpServletResponse response, @RequestHeader("User-Agent") String userAgent, HttpServletRequest request)
|
||||
{
|
||||
|
||||
String fileName = FileUtils.getName(url);
|
||||
try
|
||||
{
|
||||
if (!FileUtils.checkAllowDownload(fileName))
|
||||
{
|
||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||
}
|
||||
// 数据库资源地址
|
||||
String downloadPath = localFilePath + StringUtils.substringAfter(url, "statics");
|
||||
// 下载名称
|
||||
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
||||
|
||||
|
||||
|
||||
response.reset();
|
||||
response.setCharacterEncoding("GBK");
|
||||
// 针对IE或者以IE为内核的浏览器:
|
||||
if (userAgent.contains("MSIE") || userAgent.contains("Trident")) {
|
||||
downloadName = java.net.URLEncoder.encode(downloadName, "UTF-8");
|
||||
} else {
|
||||
// 非IE浏览器的处理:
|
||||
downloadName = new String(downloadName.getBytes("UTF-8"), "ISO-8859-1");
|
||||
}
|
||||
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
response.setHeader(
|
||||
"Content-disposition",
|
||||
"attachment;download-filename="
|
||||
+ downloadName);
|
||||
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jxy.file.service;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @author jxy
|
||||
*/
|
||||
public interface ISysFileService
|
||||
{
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
public String uploadFile(MultipartFile file) throws Exception;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
public String windMinerUploadFile(MultipartFile file) throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.jxy.file.service;
|
||||
|
||||
import com.jxy.common.core.utils.file.MimeTypeUtils;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.jxy.file.utils.FileUploadUtils;
|
||||
|
||||
/**
|
||||
* 本地文件存储
|
||||
*
|
||||
* @author jxy
|
||||
*/
|
||||
@Primary
|
||||
@Service
|
||||
public class LocalSysFileServiceImpl implements ISysFileService
|
||||
{
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
@Value("${file.prefix}")
|
||||
public String localFilePrefix;
|
||||
|
||||
/**
|
||||
* 域名或本机访问地址
|
||||
*/
|
||||
@Value("${file.domain}")
|
||||
public String domain;
|
||||
|
||||
/**
|
||||
* 上传文件存储在本地的根路径
|
||||
*/
|
||||
@Value("${file.path}")
|
||||
private String localFilePath;
|
||||
|
||||
/**
|
||||
* 本地文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String uploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
String name = FileUploadUtils.upload(localFilePath, file ,MimeTypeUtils.DEFAULT_USER_HELP_EXTENSION);
|
||||
String url = domain + localFilePrefix + name;
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* windMiner本地文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String windMinerUploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
String name = FileUploadUtils.upload(localFilePath, file ,MimeTypeUtils.WIND_MINER_EXTENSION);
|
||||
String url = domain + localFilePrefix + name;
|
||||
return url;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package com.jxy.file.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.jxy.common.core.exception.file.FileNameLengthLimitExceededException;
|
||||
import com.jxy.common.core.exception.file.FileSizeLimitExceededException;
|
||||
import com.jxy.common.core.exception.file.InvalidExtensionException;
|
||||
import com.jxy.common.core.utils.DateUtils;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.utils.file.MimeTypeUtils;
|
||||
import com.jxy.common.core.utils.uuid.Seq;
|
||||
|
||||
import javax.sound.midi.Soundbank;
|
||||
|
||||
/**
|
||||
* 文件上传工具类
|
||||
*
|
||||
* @author jxy
|
||||
*/
|
||||
public class FileUploadUtils
|
||||
{
|
||||
/**
|
||||
* 默认大小 2M
|
||||
*/
|
||||
public static final long DEFAULT_MAX_SIZE = 2 * 1024 * 1024;
|
||||
|
||||
/**
|
||||
* 默认的文件名最大长度 100
|
||||
*/
|
||||
public static final int DEFAULT_FILE_NAME_LENGTH = 100;
|
||||
|
||||
/**
|
||||
* 根据文件路径上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @return 文件名称
|
||||
* @throws IOException
|
||||
*/
|
||||
public static final String upload(String baseDir, MultipartFile file) throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new IOException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param allowedExtension 上传文件类型
|
||||
* @return 返回上传成功的文件名
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws FileNameLengthLimitExceededException 文件名太长
|
||||
* @throws IOException 比如读写文件出错时
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||
InvalidExtensionException
|
||||
{
|
||||
int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
||||
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
||||
{
|
||||
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
||||
}
|
||||
|
||||
assertAllowed(file, allowedExtension);
|
||||
|
||||
String fileName = extractFilename(file);
|
||||
|
||||
String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
|
||||
file.transferTo(Paths.get(absPath));
|
||||
return getPathFileName(fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码文件名
|
||||
*/
|
||||
public static final String extractFilename(MultipartFile file)
|
||||
{
|
||||
return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
|
||||
FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file));
|
||||
}
|
||||
|
||||
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
File desc = new File(uploadDir + File.separator + fileName);
|
||||
|
||||
if (!desc.exists())
|
||||
{
|
||||
if (!desc.getParentFile().exists())
|
||||
{
|
||||
desc.getParentFile().mkdirs();
|
||||
}
|
||||
}
|
||||
return desc.isAbsolute() ? desc : desc.getAbsoluteFile();
|
||||
}
|
||||
|
||||
private static final String getPathFileName(String fileName) throws IOException
|
||||
{
|
||||
String pathFileName = "/" + fileName;
|
||||
return pathFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件大小校验
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, InvalidExtensionException
|
||||
{
|
||||
long size = file.getSize();
|
||||
if (size > DEFAULT_MAX_SIZE)
|
||||
{
|
||||
throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
|
||||
}
|
||||
|
||||
String fileName = file.getOriginalFilename();
|
||||
String extension = getExtension(file);
|
||||
if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
|
||||
{
|
||||
if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidExtensionException(allowedExtension, extension, fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断MIME类型是否是允许的MIME类型
|
||||
*
|
||||
* @param extension 上传文件类型
|
||||
* @param allowedExtension 允许上传文件类型
|
||||
* @return true/false
|
||||
*/
|
||||
public static final boolean isAllowedExtension(String extension, String[] allowedExtension)
|
||||
{
|
||||
for (String str : allowedExtension)
|
||||
{
|
||||
if (str.equalsIgnoreCase(extension))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件名的后缀
|
||||
*
|
||||
* @param file 表单文件
|
||||
* @return 后缀名
|
||||
*/
|
||||
public static final String getExtension(MultipartFile file)
|
||||
{
|
||||
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
|
||||
if (StringUtils.isEmpty(extension))
|
||||
{
|
||||
extension = MimeTypeUtils.getExtension(Objects.requireNonNull(file.getContentType()));
|
||||
}
|
||||
return extension;
|
||||
}
|
||||
}
|
||||
25
jxy-modules/jxy-file/src/main/resources/bootstrap.yml
Normal file
25
jxy-modules/jxy-file/src/main/resources/bootstrap.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9300
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: jxy-file
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
74
jxy-modules/jxy-file/src/main/resources/logback.xml
Normal file
74
jxy-modules/jxy-file/src/main/resources/logback.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/jxy-file" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.jxy" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
||||
162
jxy-modules/jxy-marketall/pom.xml
Normal file
162
jxy-modules/jxy-marketall/pom.xml
Normal file
@@ -0,0 +1,162 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jxy-modules</artifactId>
|
||||
<groupId>com.jxy</groupId>
|
||||
<version>3.5.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jxy-marketall</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-maven-plugin</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Mybatis-Plus -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>jsqlparser</artifactId>
|
||||
<groupId>com.github.jsqlparser</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- JXY Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- JXY Common security -->
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>common-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jxy</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- WebSocket-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.java-websocket</groupId>
|
||||
<artifactId>Java-WebSocket</artifactId>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mongodb-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.5.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!--rocketMQ-->
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||
<version>2.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-client</artifactId>
|
||||
<version>4.9.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.jxy.marketall;
|
||||
|
||||
import com.jxy.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import com.jxy.common.security.annotation.EnableCustomConfig;
|
||||
import com.jxy.common.security.annotation.EnableJXYFeignClients;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* @Description marketall服务入口类
|
||||
* @Date 2022/5/19 18:42
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableJXYFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.jxy.marketall.mapper")
|
||||
public class JXYMarketallApplication {
|
||||
|
||||
@Bean
|
||||
public RestTemplate restTemplate(){
|
||||
return new RestTemplate();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(JXYMarketallApplication.class,args);
|
||||
System.out.println("marketall微服务启动成功");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.jxy.marketall.Therad;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.marketall.dto.BiAnAppWSDto;
|
||||
import com.jxy.marketall.dto.BiAnWSDto;
|
||||
import com.jxy.marketall.utils.AppWebSocketClient;
|
||||
import com.jxy.marketall.websocket.AppWebSocketService;
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/6/30 18:49
|
||||
* @Author 杜懿
|
||||
*/
|
||||
public class AppSocketThread implements Runnable {
|
||||
|
||||
private Logger log = LoggerFactory.getLogger(AppSocketThread.class);
|
||||
|
||||
private AppWebSocketService appWebSocketService;
|
||||
private AppWebSocketClient appWebSocketClient = new AppWebSocketClient();
|
||||
|
||||
public AppSocketThread(AppWebSocketService appWebSocketService) {
|
||||
this.appWebSocketService = appWebSocketService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
String url = "wss://fstream.binance.com/ws/btcusdt@kline_1d";
|
||||
WebSocketClient client = appWebSocketClient.getWS(url);
|
||||
try {
|
||||
BiAnAppWSDto biAn = null;
|
||||
while (!Thread.currentThread().isInterrupted()){
|
||||
//获取实时数据
|
||||
//biAn = UstreamTask.getRealData("btcusdt1d");
|
||||
biAn = appWebSocketClient.getData();
|
||||
if(StringUtils.isNotNull(biAn)){
|
||||
try {
|
||||
appWebSocketService.sendMessage(appWebSocketService.getUserName(),JSONObject.toJSONString(AjaxResult.success(biAn)));
|
||||
}catch (Exception e){
|
||||
//client.close();
|
||||
}
|
||||
}else {
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
//client.close();
|
||||
|
||||
}catch (InterruptedException e){
|
||||
e.printStackTrace();
|
||||
//client.close();
|
||||
Thread curr = Thread.currentThread();
|
||||
//再次调用interrupt方法中断自己,将中断状态设置为“中断”
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException interruptedException) {
|
||||
interruptedException.printStackTrace();
|
||||
}
|
||||
curr.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.jxy.marketall.Therad;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jxy.common.core.utils.DateUtils;
|
||||
import com.jxy.common.core.utils.SpringUtils;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.marketall.entity.BiAn;
|
||||
import com.jxy.marketall.enums.SymbolType;
|
||||
import com.jxy.marketall.service.impl.BiAnServiceImpl;
|
||||
import com.jxy.marketall.utils.EnumUtils;
|
||||
import com.jxy.marketall.utils.MyWebSocketClient;
|
||||
import com.jxy.marketall.vo.BiAnVo;
|
||||
import com.jxy.marketall.websocket.WebSocketService;
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/6/30 18:49
|
||||
* @Author 杜懿
|
||||
*/
|
||||
public class SocketThread implements Runnable {
|
||||
|
||||
private Logger log = LoggerFactory.getLogger(SocketThread.class);
|
||||
|
||||
private BiAnServiceImpl biAnService;
|
||||
|
||||
private WebSocketService webSocketService;
|
||||
private MyWebSocketClient myWebSocketClient = new MyWebSocketClient();
|
||||
private String message;
|
||||
private BiAnVo biAnVo;
|
||||
|
||||
public SocketThread(WebSocketService webSocketService, String message) {
|
||||
this.webSocketService = webSocketService;
|
||||
this.message = message;
|
||||
//构造条件
|
||||
BiAnVo biAnVo = new BiAnVo();
|
||||
String[] params = message.split(",");
|
||||
|
||||
String interval = params[0];
|
||||
String symbol = params[1];
|
||||
|
||||
biAnVo.setSymbol(symbol);
|
||||
biAnVo.setTimeInterval(params[0]);
|
||||
|
||||
//根据时间间隔设置查询的开始时间
|
||||
Date date = this.webSocketService.getDate();
|
||||
Calendar ca = new GregorianCalendar();
|
||||
ca.setTime(date);
|
||||
//Date end = ca.getTime();
|
||||
//biAnVo.setEnd(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,end));
|
||||
ca.add(ca.MINUTE,-1);
|
||||
biAnVo.setStart(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,ca.getTime()));
|
||||
|
||||
this.biAnVo = biAnVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
biAnService = SpringUtils.getBean("biAnService");
|
||||
String intetval = biAnVo.getTimeInterval().replace("min","m");
|
||||
String symbol = biAnVo.getSymbol();
|
||||
if(!EnumUtils.isInclude(SymbolType.class,symbol)){
|
||||
if("1INCHUSDT".equals(symbol) || "1000SHIBUSDT".equals(symbol) || "1000XECUSDT".equals(symbol)){
|
||||
symbol = symbol.toLowerCase();
|
||||
}else {
|
||||
throw new RuntimeException("交易对不存在");
|
||||
}
|
||||
}else{
|
||||
SymbolType symbolType = (SymbolType) EnumUtils.get(SymbolType.class, symbol);
|
||||
symbol = symbolType.getInfo();
|
||||
}
|
||||
String url = "wss://fstream.binance.com/stream?streams="+symbol.toLowerCase()+"@kline_"+intetval;
|
||||
WebSocketClient client = myWebSocketClient.getWS(url);
|
||||
try {
|
||||
List<BiAn> biAnList = null;
|
||||
while (!Thread.currentThread().isInterrupted()){
|
||||
BiAnVo vo = new BiAnVo();
|
||||
BeanUtils.copyProperties(this.biAnVo,vo);
|
||||
//获取实时数据
|
||||
biAnList = getData(vo);
|
||||
if(biAnList.size() > 0){
|
||||
//System.out.println(message+"将要推送的信息:"+biAnList);
|
||||
webSocketService.sendMessage(webSocketService.getUserName(),JSONObject.toJSONString(AjaxResult.success(biAnList)));
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
}catch (InterruptedException e){
|
||||
//断开币安提供的websocket
|
||||
myWebSocketClient.setBiAn(null);
|
||||
client.close();
|
||||
Thread curr = Thread.currentThread();
|
||||
//再次调用interrupt方法中断自己,将中断状态设置为“中断”
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException interruptedException) {
|
||||
interruptedException.printStackTrace();
|
||||
}
|
||||
curr.interrupt();
|
||||
}
|
||||
}
|
||||
public List<BiAn> getData(BiAnVo biAnVo){
|
||||
//System.out.println("查询条件:"+biAnVo+"时间"+biAnVo.getStart());
|
||||
|
||||
List<BiAn> realTimeData = biAnService.getRealTimeData(biAnVo);
|
||||
BiAn biAn = myWebSocketClient.getData();
|
||||
|
||||
if(StringUtils.isNotNull(biAn.getSymbol())){
|
||||
realTimeData.add(biAn);
|
||||
}
|
||||
return realTimeData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
//package com.jxy.marketall.Therad;
|
||||
//
|
||||
//import com.alibaba.fastjson.JSONObject;
|
||||
//import com.jxy.common.core.utils.DateUtils;
|
||||
//import com.jxy.common.core.utils.SpringUtils;
|
||||
//import com.jxy.common.core.web.Result.AjaxResult;
|
||||
//import com.jxy.marketall.entity.BiAn;
|
||||
//import com.jxy.marketall.enums.SymbolType;
|
||||
//import com.jxy.marketall.service.impl.BiAnServiceImpl;
|
||||
//import com.jxy.marketall.utils.EnumUtils;
|
||||
//import com.jxy.marketall.utils.MyWebSocketClient;
|
||||
//import com.jxy.marketall.utils.Test;
|
||||
//import com.jxy.marketall.utils.TestTask;
|
||||
//import com.jxy.marketall.vo.BiAnVo;
|
||||
//import com.jxy.marketall.websocket.WebSocketService;
|
||||
//import org.java_websocket.client.WebSocketClient;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.BeanUtils;
|
||||
//
|
||||
//import java.util.Calendar;
|
||||
//import java.util.Date;
|
||||
//import java.util.GregorianCalendar;
|
||||
//import java.util.List;
|
||||
//import java.util.concurrent.atomic.AtomicBoolean;
|
||||
//
|
||||
///**
|
||||
// * @Description TODO
|
||||
// * @Date 2022/6/30 18:49
|
||||
// * @Author 杜懿
|
||||
// */
|
||||
//public class TestThread implements Runnable {
|
||||
//
|
||||
// private Logger log = LoggerFactory.getLogger(TestThread.class);
|
||||
//
|
||||
// private TestTask testTask;
|
||||
// private String message;
|
||||
//
|
||||
// public TestThread(TestTask testTask, String msg) {
|
||||
// this.testTask = testTask;
|
||||
// this.message = msg;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void run() {
|
||||
// try {
|
||||
// while (!Thread.currentThread().isInterrupted()){
|
||||
// System.out.println(Thread.currentThread().getName() + "正常执行中,msg:"+message);
|
||||
// Thread.sleep(1000);
|
||||
// }
|
||||
//
|
||||
// }catch (InterruptedException e){
|
||||
// System.out.println(Thread.currentThread().getName() + "成功捕获中断异常");
|
||||
// //断开币安提供的websocket
|
||||
// Thread curr = Thread.currentThread();
|
||||
// //再次调用interrupt方法中断自己,将中断状态设置为“中断”
|
||||
// try {
|
||||
// Thread.sleep(1000);
|
||||
// } catch (InterruptedException interruptedException) {
|
||||
// interruptedException.printStackTrace();
|
||||
// }
|
||||
// curr.interrupt();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jxy.marketall.config;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/8/31 11:15
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor(){
|
||||
return new PaginationInterceptor();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.jxy.marketall.config;
|
||||
|
||||
import com.jxy.marketall.factory.IgnoreSSLRequestFactory;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.config.Registry;
|
||||
import org.apache.http.config.RegistryBuilder;
|
||||
import org.apache.http.conn.socket.ConnectionSocketFactory;
|
||||
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
|
||||
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.http.ssl.SSLContextBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/8/16 14:59
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Configuration
|
||||
public class RestTemplateConfig {
|
||||
|
||||
/**
|
||||
* 使用ssl对证书进行验证,需要将证书导出到jdk管理仓库,
|
||||
* 命令:keytool -import -v -trustcacerts -alias mytest -file "D:/tmp/mytest.cer" -keystore "C:/Program Files/Java/jdk1.8.0_131/jre/lib/security/cacerts"
|
||||
*/
|
||||
//@Bean("restTemplate")
|
||||
//@Primary
|
||||
//public RestTemplate restTemplate() throws NoSuchAlgorithmException, KeyManagementException {
|
||||
// HttpComponentsClientHttpRequestFactory httpRequestFactory = new
|
||||
// HttpComponentsClientHttpRequestFactory();
|
||||
// httpRequestFactory.setConnectionRequestTimeout(6 * 1000); //获取连接池连接的超时时间(毫秒)
|
||||
// httpRequestFactory.setConnectTimeout(6 * 1000); //连接上服务器(握手成功)的时间(毫秒)
|
||||
// httpRequestFactory.setReadTimeout(60 * 1000); //返回数据时间(毫秒)
|
||||
// httpRequestFactory.setHttpClient(httpClient());
|
||||
// RestTemplate restTemplate = new RestTemplate(httpRequestFactory);
|
||||
// return restTemplate;
|
||||
//}
|
||||
|
||||
/**
|
||||
* 绕过ssl对证书进行验证,无需将证书导出到jdk管理仓库
|
||||
*/
|
||||
@Bean("restTemplateIgnoreSSL")
|
||||
public RestTemplate restTemplateIgnoreSSL() throws NoSuchAlgorithmException, KeyManagementException {
|
||||
IgnoreSSLRequestFactory requestFactory = new IgnoreSSLRequestFactory(httpClient());
|
||||
requestFactory.setConnectTimeout(60000); //连接上服务器(握手成功)的时间
|
||||
requestFactory.setReadTimeout(60000); //返回数据时间
|
||||
RestTemplate restTemplate = new RestTemplate(requestFactory);
|
||||
return restTemplate;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HttpClient httpClient() throws KeyManagementException, NoSuchAlgorithmException {
|
||||
SSLContextBuilder contextBuilder = new SSLContextBuilder();
|
||||
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(contextBuilder.build(), NoopHostnameVerifier.INSTANCE);
|
||||
Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
|
||||
.register("http", new PlainConnectionSocketFactory())
|
||||
.register("https", socketFactory).build();
|
||||
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(registry);
|
||||
connectionManager.setMaxTotal(200);
|
||||
connectionManager.setDefaultMaxPerRoute(100);
|
||||
CloseableHttpClient httpClient = HttpClientBuilder.create().setConnectionManager(connectionManager).build();
|
||||
return httpClient;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.jxy.marketall.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
/**
|
||||
* @Description websocket 配置
|
||||
* @Date 2022/6/30 11:09
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSocketConfig {
|
||||
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter()
|
||||
{
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jxy.marketall.config.mongodb;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.MongoDatabaseFactory;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/4/17 18:46
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public abstract class AbstractMongoDbConfig {
|
||||
private String host;
|
||||
private String port;
|
||||
private String username;
|
||||
private String password;
|
||||
private String database;
|
||||
public MongoDatabaseFactory mongoDatabaseFactory() {
|
||||
String connectionString = "mongodb://" + username + ":" + password+ "@"+ host+":"+port +"/" + database;
|
||||
return new SimpleMongoClientDatabaseFactory(connectionString);
|
||||
}
|
||||
|
||||
public MongoDatabaseFactory mongoDatabaseNoUserFactory() {
|
||||
String connectionString = "mongodb://"+ host+":"+port +"/" + database;
|
||||
return new SimpleMongoClientDatabaseFactory(connectionString);
|
||||
}
|
||||
public abstract MongoTemplate getMongoTemplate();
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jxy.marketall.config.mongodb;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/4/17 18:48
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties("spring.data.mongodb.btcutxos")
|
||||
public class BTCutxosMongoDbConfig extends AbstractMongoDbConfig{
|
||||
|
||||
@Primary
|
||||
@Bean(name = "btcutxosMongoTemplate")
|
||||
@Override
|
||||
public MongoTemplate getMongoTemplate() {
|
||||
return new MongoTemplate(mongoDatabaseNoUserFactory());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.jxy.marketall.config.mongodb;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2023/4/17 18:48
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties("spring.data.mongodb.border")
|
||||
public class BorderMongoDbConfig extends AbstractMongoDbConfig{
|
||||
|
||||
@Bean(name = "borderMongoTemplate")
|
||||
@Override
|
||||
public MongoTemplate getMongoTemplate() {
|
||||
return new MongoTemplate(mongoDatabaseNoUserFactory());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,722 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.alibaba.csp.sentinel.annotation.SentinelResource;
|
||||
import com.jxy.common.core.annotation.RateLimiter;
|
||||
import com.jxy.common.core.enums.LimitType;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.log.annotation.Log;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
|
||||
import com.jxy.marketall.dto.HolderBalanceDto;
|
||||
import com.jxy.marketall.service.*;
|
||||
import com.jxy.marketall.vo.*;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description btc查询
|
||||
* @Date 2022/6/20 17:26
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = {"/btc","/BTC"})
|
||||
@Api(tags = "btc查询接口")
|
||||
@SentinelResource
|
||||
public class BTCController {
|
||||
|
||||
@Autowired
|
||||
private Arh99Service arh99Service;
|
||||
|
||||
@Autowired
|
||||
private BTCService btcService;
|
||||
|
||||
@Autowired
|
||||
private BTCV2Service btcv2Service;
|
||||
|
||||
|
||||
@Autowired
|
||||
private Arh99DayService arh99DayService;
|
||||
|
||||
@Autowired
|
||||
private Jzr60Service Jzr60Service;
|
||||
|
||||
@Autowired
|
||||
private Jzr60DayService Jzr60DayService;
|
||||
|
||||
@Autowired
|
||||
private BTCBigAmountVoutService btcBigAmountVoutService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private HolderService holderService;
|
||||
|
||||
@Autowired
|
||||
private UtxosService utxosService;
|
||||
|
||||
@Autowired
|
||||
private BTCMongoService btcMongoService;
|
||||
|
||||
|
||||
@GetMapping("/arh99")
|
||||
@ApiOperation(value = "btc arh999囤币及逃顶指标",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult arh99(QueryVo queryVo){
|
||||
return arh99Service.findArh99ByTime(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/arh99day"})
|
||||
@ApiOperation(value = "btc arh999囤币及逃顶指标",response = List.class)
|
||||
public AjaxResult arh99day(){
|
||||
|
||||
return arh99DayService.findArh99Day();
|
||||
}
|
||||
|
||||
@GetMapping("/jzr60")
|
||||
@ApiOperation(value = "btc 江卓尔60日累计涨幅",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult jzr60(QueryVo queryVo){
|
||||
return Jzr60Service.findJzr60ByTime(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping("/jzr60day")
|
||||
@ApiOperation(value = "btc 江卓尔60日累计涨幅",response = List.class)
|
||||
public AjaxResult jzr60day(){
|
||||
|
||||
return Jzr60DayService.findJzr60Day();
|
||||
}
|
||||
|
||||
@GetMapping("/ma730")
|
||||
@ApiOperation(value = "btc 2年移动平均价格乘数",response = List.class)
|
||||
@Log(title = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult ma730(QueryVo queryVo){
|
||||
return btcService.findMa730ByTime(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping("/ma730day")
|
||||
@ApiOperation(value = "btc 2年移动平均价格乘数",response = List.class)
|
||||
public AjaxResult ma730day(){
|
||||
|
||||
return btcService.findMa730Day();
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/btcVolume","/BTCVolume"})
|
||||
@ApiOperation(value = "btc日交易统计")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult btcVolume(QueryVo vo){
|
||||
|
||||
//return btcService.getBTCVolumeList(vo);
|
||||
return btcService.getVolumeList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/btcFees","/BTCFees"})
|
||||
@ApiOperation(value = "btc日交易统计")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
@RateLimiter(time = 10000, count = 4,limitType = LimitType.IP)
|
||||
public AjaxResult btcFees(QueryVo vo){
|
||||
|
||||
//return btcService.getBTCFeesList(vo);
|
||||
return btcService.getFeesList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/eaVolume"})
|
||||
@ApiOperation(value = "交易量(找零消除) Transaction Volume (Entity-adjusted)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult eaVolume(QueryVo vo){
|
||||
|
||||
return btcService.geteaVolumeList(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/bigamountvout")
|
||||
@ApiOperation(value = "btc 条件查询大额交易",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "amount", value = "最大交易额", dataType = "double", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "vout", value = "", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是amount、vout、txId", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "txId", value = "交易id", dataType = "string", paramType = "query", required = false)
|
||||
})
|
||||
public AjaxResult bigamountvout(BTCVo btcVo){
|
||||
return btcBigAmountVoutService.findBTCBigAmountVoutByBTCVo(btcVo);
|
||||
}
|
||||
|
||||
@GetMapping(value={"/btcbigtxcount","/BTCbigtxcount","/BTCBigTxCount","/btcBigTxCount","/BtcBigTxCount"})
|
||||
@ApiOperation(value = "btc 大额交易数量查询",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult btcbigtxcount(BTCBigTxCountVo vo){
|
||||
|
||||
AjaxResult btcBigAmountVoutByTime = btcBigAmountVoutService.findBTCBigAmountVoutByTime(vo);
|
||||
|
||||
return btcBigAmountVoutByTime ;
|
||||
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/address"})
|
||||
@ApiOperation(value = "btc 地址统计")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult address(QueryVo queryVo){
|
||||
|
||||
return btcService.getAddressList(queryVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//@GetMapping(value = {"/dailyBuySell"})
|
||||
//@ApiOperation(value = "btc 日交易详情")
|
||||
//@ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
// @ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
////@RequiresLogin
|
||||
//public AjaxResult dailyBuySell(PageQueryVo queryVo){
|
||||
//
|
||||
// return dailyBuySellService.getDailyBuySellList(queryVo);
|
||||
//}
|
||||
|
||||
//@GetMapping(value = {"/bigSell"})
|
||||
//@ApiOperation(value = "btc 大额出售详情")
|
||||
//@ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "amount", value = "出售价格", dataType = "double", paramType = "query", required = false),
|
||||
// @ApiImplicitParam(name = "profit", value = "收益", dataType = "double", paramType = "query", required = false),
|
||||
// @ApiImplicitParam(name = "address", value = "交易地址", dataType = "string", paramType = "query", required = false),
|
||||
// @ApiImplicitParam(name = "txId", value = "交易id", dataType = "string", paramType = "query", required = false),
|
||||
// @ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
// @ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
////@RequiresLogin
|
||||
//public AjaxResult bigSell(BigSellVo bigSellVo){
|
||||
//
|
||||
// return bigSellService.getBigSellListByCond(bigSellVo);
|
||||
//}
|
||||
|
||||
@GetMapping(value = {"/holder"})
|
||||
@ApiOperation(value = "btc 持有者地址数分布( 按持有时间分段)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult holder(QueryVo vo){
|
||||
return holderService.getNewHolder(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/holderBalance"})
|
||||
@ApiOperation(value = "btc 持有者币数量分布( 按持有时间分段)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult holderBalance(QueryVo vo){
|
||||
return holderService.getNewHolderBalance(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/utxos"})
|
||||
@ApiOperation(value = "btc 持有者地址数分布(按余额分段)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult utxos(QueryVo vo){
|
||||
return utxosService.getUtxosByTime(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/utxos2nd"})
|
||||
@ApiOperation(value = "btc 持有者币数量分布(按余额分段)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult utxos2nd(QueryVo vo){
|
||||
return utxosService.getUtxos2ndByTime(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getBuyData"})
|
||||
@ApiOperation(value = "btc 持有者地址数分布( 按买入价格分段)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult getBuyData(QueryVo vo){
|
||||
return btcMongoService.getBuyData(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getBuyAmountData"})
|
||||
@ApiOperation(value = "btc 持有者币数量分布( 按买入价格分段)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult getBuyAmountData(QueryVo vo){
|
||||
return btcMongoService.getBuyAmountData(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getDiffData"})
|
||||
@ApiOperation(value = "btc 持有者地址数分布(盈亏)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult getDiffData(QueryVo vo){
|
||||
return btcMongoService.getDiffData(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getDiffAmountData"})
|
||||
@ApiOperation(value = "btc 改为 持有者币数量分布(盈亏)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult getDiffAmountData(QueryVo vo){
|
||||
return btcMongoService.getDiffAmountData(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getProfitData"})
|
||||
@ApiOperation(value = "btc 持有者地址数分布(利润率)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult getProfitData(QueryVo vo){
|
||||
return btcMongoService.getProfitData(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getProfitAmountData"})
|
||||
@ApiOperation(value = "btc 持有者币数量分布(利润率)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult getProfitAmountData(QueryVo vo){
|
||||
return btcMongoService.getProfitAmountData(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getTopList"})
|
||||
@ApiOperation(value = "btc 巨鲸地址列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "页数 从1开始 默认为第一页", dataType = "int", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "address", value = "按地址查询", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "value", value = "查询范围 大于该值", dataType = "int", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult getTopList(TopVo topVo){
|
||||
//btcMongoService.getDayBalanceData()
|
||||
return btcMongoService.getTopList(topVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getDayBalanceData/{value}"})
|
||||
@ApiOperation(value = "btc 指定范围内持有者币龄地址数分布数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "value", value = "查询范围 大于该值", dataType = "String", paramType = "path", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult getDayBalanceData(QueryVo queryVo,@PathVariable("value") String value){
|
||||
return btcMongoService.getDayBalanceData(queryVo,value,"balance_");
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getDayBalanceAmountData/{value}"})
|
||||
@ApiOperation(value = "btc 指定范围内持有者币数量 币龄分布数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "value", value = "查询范围 大于该值", dataType = "String", paramType = "path", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult getDayBalanceAmountData(QueryVo queryVo,@PathVariable("value") String value){
|
||||
return btcMongoService.getDayBalanceData(queryVo,value,"balance_amount_");
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/getTopListWatch"})
|
||||
@ApiOperation(value = "btc 巨鲸交易监控")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "address", value = "按地址查询", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "value", value = "查询范围 大于该值", dataType = "int", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult getTopListWatch(TopListWatchVo vo){
|
||||
return btcMongoService.getTopListWatch(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/capReal"})
|
||||
@ApiOperation(value = "capReal 放在每日币价K线中")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult capReal(CoinVo vo){
|
||||
|
||||
return utxosService.getCapReal(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/CDD"})
|
||||
@ApiOperation(value = "Coin Days Destroyed 币天销毁量" )
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult cDD(QueryVo vo){
|
||||
|
||||
return btcService.getCDDList(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/profitRate"})
|
||||
@ApiOperation(value = "已实现盈利交易占比 Percent UTXOs in Profit")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult profitRate(QueryVo vo){
|
||||
|
||||
return btcService.getProfitRateList(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/sopr"})
|
||||
@ApiOperation(value = "已花费输出盈利比 Spent Output Profit Ratio")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult sopr(QueryVo vo){
|
||||
|
||||
return btcService.getSoprList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/asol"})
|
||||
@ApiOperation(value = "已花费输出平均寿命 Average Spent Output Lifespan")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult asol(QueryVo vo){
|
||||
|
||||
return btcService.getAsolList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/dormancy"})
|
||||
@ApiOperation(value = "已花费输出休眠平均天数 Average Coin Dormancy")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult dormancy(QueryVo vo){
|
||||
|
||||
return btcService.getDormancyList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/soag"})
|
||||
@ApiOperation(value = "币天销毁量年龄分布 Spent Output Age Bands")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult soag(QueryVo vo){
|
||||
|
||||
return btcService.getSoagList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/csupply"})
|
||||
@ApiOperation(value = "流通供应量 Circulating Supply")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult csupply(QueryVo vo){
|
||||
|
||||
return btcService.getCSupplyList(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/sumcsupply"})
|
||||
@ApiOperation(value = "累计币天销毁量(流通供应量) Cumulative Circulating Supply")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult sumcsupply(QueryVo vo){
|
||||
|
||||
return btcService.getSumCSupplyList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/sumcdd"})
|
||||
@ApiOperation(value = "累计币天销毁量 Cumulative Coin Days Destroyed")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult sumcdd(QueryVo vo){
|
||||
|
||||
return btcService.getSumCddList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/sumeacdd"})
|
||||
@ApiOperation(value = "累计币天销毁量(找零消除) Entity-adjusted Cumulative Coin Days Destroyed")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult sumeacdd(QueryVo vo){
|
||||
|
||||
return btcService.getSumCddList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/liveliness"})
|
||||
@ApiOperation(value = "活跃度 Liveliness")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult liveliness(QueryVo vo){
|
||||
|
||||
return btcService.getLiveLinessList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/rprofit"})
|
||||
@ApiOperation(value = "已实现盈利量 Realized Profit")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult rprofit(QueryVo vo){
|
||||
|
||||
return btcService.getRealizedProfitList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/rloss"})
|
||||
@ApiOperation(value = "已实现亏损量 Realized Loss")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult rloss(QueryVo vo){
|
||||
|
||||
return btcService.getRealizedLossList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/rplRate"})
|
||||
@ApiOperation(value = "已实现净收益损失比 Realized Profit/Loss")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult rplRate(QueryVo vo){
|
||||
|
||||
return btcService.getRplRateList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/marketcap"})
|
||||
@ApiOperation(value = "流通市值 market capitalization")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult marketcap(QueryVo vo){
|
||||
|
||||
return btcService.getMarketCapList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/rcap"})
|
||||
@ApiOperation(value = "已实现流通市值 Realized capitalization")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult rcap(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return btcService.getRealizedCapList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/earcap"})
|
||||
@ApiOperation(value = "已实现流通市值(找零消除) Entity-adjusted Realized capitalization")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult earcap(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return btcService.getEntityAdjustedRealizedCapList(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/mvrv"})
|
||||
@ApiOperation(value = "流通市值-已实现流通市值比 market-value-to-realized-value")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult mvrv(QueryVo vo){
|
||||
|
||||
return btcService.getMVRVList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/mvrvz"})
|
||||
@ApiOperation(value = "MVRV Z-Score")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult mvrvz(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
|
||||
return btcService.getMVRVZList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/lthmvrv"})
|
||||
@ApiOperation(value = "长持者流通市值-已实现流通市值比 Long Term Holder MVRV")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult lthmvrv(QueryVo vo){
|
||||
|
||||
return btcService.getLthMVRVList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/sthmvrv"})
|
||||
@ApiOperation(value = "短持者流通市值-已实现流通市值比 Short Term Holder MVRV")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult sthmvrv(QueryVo vo){
|
||||
|
||||
return btcService.getSthMVRVList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/nupl"})
|
||||
@ApiOperation(value = "未实现的净收益损失比 Net Unrealized Profit/Loss")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult nupl(QueryVo vo){
|
||||
|
||||
return btcService.getNuplList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/uprofit"})
|
||||
@ApiOperation(value = "未实现的净收益量 Unrealized Profit")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult uprofit(QueryVo vo){
|
||||
|
||||
return btcService.getUnrealizedProfitList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/uloss"})
|
||||
@ApiOperation(value = "未实现的净损失量 Unrealized Loss")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult uloss(QueryVo vo){
|
||||
|
||||
return btcService.getUnrealizedLossList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/lthnupl"})
|
||||
@ApiOperation(value = "长持者未实现的净收益损失比 Long Term Holder NUPL")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult lthnupl(QueryVo vo){
|
||||
|
||||
return btcService.getLthNuplList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/sthnupl"})
|
||||
@ApiOperation(value = "短持者未实现的净收益损失比 Short Term Holder NUPL")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult sthnupl(QueryVo vo){
|
||||
|
||||
return btcService.getSthNuplList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/mintusd"})
|
||||
@ApiOperation(value = "发行价值Daily Coin Issuance (in USD)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult mintusd(QueryVo vo){
|
||||
|
||||
return btcService.getMintusd(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/minerAddress"})
|
||||
@ApiOperation(value = "矿工地址数 Number of Miner Address")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult minerAddress(QueryVo vo){
|
||||
|
||||
return btcService.getMinerAddress(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/minerBalance"})
|
||||
@ApiOperation(value = " 矿工地址余额 Balance of Miner Address")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult minerBalance(QueryVo vo){
|
||||
|
||||
return btcService.getMinerBalance(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/nvtSign"})
|
||||
@ApiOperation(value = "NVT信号 Network Value to Transactions Signal")
|
||||
//@RequiresLogin
|
||||
public AjaxResult NVTSignal(@RequestBody(required = false) SmaVo vo){
|
||||
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getNVTSignalList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/vdd"})
|
||||
@ApiOperation(value = "vdd指标")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult vdd(@RequestBody(required = false) QueryVo vo){
|
||||
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
|
||||
return btcService.getVDDList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/sma/{day}"})
|
||||
@ApiOperation(value = "币价SMA")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult sma(QueryVo vo,@PathVariable("day") int day){
|
||||
|
||||
vo.setSma(day);
|
||||
return btcService.getPrice(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/test"})
|
||||
@ApiOperation(value = "NVT信号 Network Value to Transactions Signal")
|
||||
//@RequiresLogin
|
||||
public AjaxResult test(){
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/test2"})
|
||||
@ApiOperation(value = "NVT信号 Network Value to Transactions Signal")
|
||||
//@RequiresLogin
|
||||
public AjaxResult test2(){
|
||||
|
||||
HolderBalanceDto dto = new HolderBalanceDto();
|
||||
return AjaxResult.success(dto);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/test3"})
|
||||
@ApiOperation(value = "NVT信号 Network Value to Transactions Signal")
|
||||
//@RequiresLogin
|
||||
public AjaxResult test3(){
|
||||
|
||||
HolderBalanceDto dto = new HolderBalanceDto();
|
||||
dto = null;
|
||||
return AjaxResult.success(dto);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.marketall.service.*;
|
||||
import com.jxy.marketall.vo.*;
|
||||
import io.swagger.annotations.Api;
|
||||
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/v2","/BTC/v2"})
|
||||
@Api(tags = "btc v2查询接口")
|
||||
public class BTCV2Controller {
|
||||
|
||||
@Autowired
|
||||
private BTCV2Service btcv2Service;
|
||||
|
||||
|
||||
@PostMapping(value = {"/profitAddress"})
|
||||
@ApiOperation(value = "盈利地址数 Number of Addresses in Profit")
|
||||
//@RequiresLogin
|
||||
public AjaxResult profitAddresses(@RequestBody(required = false) SmaVo vo){
|
||||
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return btcv2Service.getProfitAddressesList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/lossAddress"})
|
||||
@ApiOperation(value = "亏损地址数 Number of Addresses in Loss")
|
||||
//@RequiresLogin
|
||||
public AjaxResult lossAddress(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return btcv2Service.getLossAddressList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/profitRatio"})
|
||||
@ApiOperation(value = "地址盈亏比 Percent of Addresses in Profit")
|
||||
//@RequiresLogin
|
||||
public AjaxResult profitRatio(@RequestBody(required = false) SmaVo vo){
|
||||
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return btcv2Service.getProfitRatioList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/lthSupply"})
|
||||
@ApiOperation(value = "长期持有者供应量 Total Supply Held by Long-Term Holders")
|
||||
//@RequiresLogin
|
||||
public AjaxResult lthSupply(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getLthSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/sthSupply"})
|
||||
@ApiOperation(value = "短期持有者供应量 Total Supply Held by Short-Term Holders")
|
||||
//@RequiresLogin
|
||||
public AjaxResult sthSupply(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return btcv2Service.getSthSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/realizedPrice"})
|
||||
@ApiOperation(value = "已实现价格 Realized Price")
|
||||
//@RequiresLogin
|
||||
public AjaxResult realizedPrice(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getRealizedPriceList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/relativeLthSth"})
|
||||
@ApiOperation(value = "长/短期持有者供应量盈亏比 Long- and Short-Term Holder Supply in Profit/Loss")
|
||||
//@RequiresLogin
|
||||
public AjaxResult relativeLthSth(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getRelativeSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/distributionLthSth"})
|
||||
@ApiOperation(value = "长/短期持有者供应量分布 Long- and Short-Term Holder Supply Distribution")
|
||||
//@RequiresLogin
|
||||
public AjaxResult distributionLthSth(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getLthSthSupplyDistributionList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/lthProfitSupply"})
|
||||
@ApiOperation(value = "长期持有者盈利总供应量 Total Supply in Profit Held by Long-Term Holders")
|
||||
//@RequiresLogin
|
||||
public AjaxResult lthProfitSupply(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getLthProfitSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/sthProfitSupply"})
|
||||
@ApiOperation(value = "短期持有者盈利总供应量 Total Supply in Profit Held by Short-Term Holders")
|
||||
//@RequiresLogin
|
||||
public AjaxResult sthProfitSupply(@RequestBody(required = false) SmaVo vo){
|
||||
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getSthProfitSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/lthLossSupply"})
|
||||
@ApiOperation(value = "长期持有者亏损总供应量 Total Supply in Loss Held by Long-Term Holders")
|
||||
//@RequiresLogin
|
||||
public AjaxResult lthLossSupply(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getLthLossSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/sthLossSupply"})
|
||||
@ApiOperation(value = "短期持有者亏损总供应量 Total Supply in Loss Held by Short-Term Holders")
|
||||
//@RequiresLogin
|
||||
public AjaxResult sthLossSupply(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getSthLossSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/lthProfitRatio"})
|
||||
@ApiOperation(value = "长期持有者盈亏比 Long-Term Holder (STH) Profit/Loss Ratio")
|
||||
//@RequiresLogin
|
||||
public AjaxResult lthProfitRatio(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getLthProfitRatioList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/sthProfitRatio"})
|
||||
@ApiOperation(value = "短期持有者盈亏比 Short-Term Holder (STH) Profit/Loss Ratio")
|
||||
//@RequiresLogin
|
||||
public AjaxResult sthProfitRatio(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getSthProfitRatioList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/SLRVRatio"})
|
||||
@ApiOperation(value = "短期到长期实现价值比率 Short to Long-Term Realized Value (SLRV) Ratio")
|
||||
//@RequiresLogin
|
||||
public AjaxResult SLRVRatio(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getSLRVRatioList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/lthVolume"})
|
||||
@ApiOperation(value = "长期持有者每日交易量 Long-Term Holder Daily Volume")
|
||||
//@RequiresLogin
|
||||
public AjaxResult lthVolume(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getLthVolumeList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/frm"})
|
||||
@ApiOperation(value = "交易汇率乘数 Fee Ratio Multiple (FRM)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult frm(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getFeeRatioMultipleList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/cvdd"})
|
||||
@ApiOperation(value = "累积价值-销毁天数比 Cumulative Value-Days Destroyed (CVDD)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult cvdd(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getCumulativeValueDaysDestroyedList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/balancedPrice"})
|
||||
@ApiOperation(value = "已平衡价格 Balanced Price")
|
||||
//@RequiresLogin
|
||||
public AjaxResult balancedPrice(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getBalancedPriceList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/nvtRatio"})
|
||||
@ApiOperation(value = "市值/交易价值比 Network Value to Transactions Ratio")
|
||||
//@RequiresLogin
|
||||
public AjaxResult nvtRatio(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getNVTRatioList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/nvtSign"})
|
||||
@ApiOperation(value = "NVT信号 Network Value to Transactions Signal")
|
||||
//@RequiresLogin
|
||||
public AjaxResult NVTSignal(@RequestBody(required = false) SmaVo vo){
|
||||
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getNVTSignalList(vo.getSma());
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = {"/velocity"})
|
||||
@ApiOperation(value = "流通速度 Velocity")
|
||||
//@RequiresLogin
|
||||
public AjaxResult velocity(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getVelocityList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/PiCycleTopIndicator"})
|
||||
@ApiOperation(value = "PI周期顶指标 Pi Cycle Top Indicator")
|
||||
public AjaxResult piCTI(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
|
||||
return btcv2Service.getPiCycleTIList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/ssr"})
|
||||
@ApiOperation(value = "稳定币供应比 Stablecoin Supply Ratio (SSR) ")
|
||||
//@RequiresLogin
|
||||
public AjaxResult ssr(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getSSRList();
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/ssro"})
|
||||
@ApiOperation(value = "稳定币供应比振荡器 Stablecoin Supply Ratio (SSR) Oscillator")
|
||||
//@RequiresLogin
|
||||
public AjaxResult ssro(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getSSROList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/stfRatio"})
|
||||
@ApiOperation(value = "库存/新发行比 Stock-to-Flow Ratio ")
|
||||
public AjaxResult stfRatio(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
|
||||
return btcv2Service.getSTFRatioList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/stfDeflection"})
|
||||
@ApiOperation(value = "库存/新发行偏差 Stock-to-Flow Deflection ")
|
||||
//@RequiresLogin
|
||||
public AjaxResult stfDeflection(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getSTFDeflectionList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/goldenRatioMult"})
|
||||
@ApiOperation(value = "库存/黄金比例乘数 Golden Ratio Multiplier ")
|
||||
//@RequiresLogin
|
||||
public AjaxResult goldenRatioMult(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
|
||||
return btcv2Service.getGoldenRatioMultList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/mempool"})
|
||||
@ApiOperation(value = "待交易量")
|
||||
//@RequiresLogin
|
||||
public AjaxResult mempool(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
|
||||
return btcv2Service.getMempoolTransaction(vo);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = {"/exchanges"})
|
||||
@ApiOperation(value = "获取所有交易所名")
|
||||
//@RequiresLogin
|
||||
public AjaxResult exchanges(){
|
||||
|
||||
return btcv2Service.getExchanges();
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/ebalance"})
|
||||
@ApiOperation(value = "")
|
||||
//@RequiresLogin
|
||||
public AjaxResult ebalance(@RequestBody EBalanceVo vo){
|
||||
|
||||
return btcv2Service.getExchangeBalance(vo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/6/27 10:28
|
||||
* @Author 杜懿
|
||||
*/
|
||||
|
||||
import cn.hutool.db.meta.Table;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.marketall.dto.BiAnWSDto;
|
||||
import com.jxy.marketall.entity.BiAn;
|
||||
import com.jxy.marketall.service.impl.BiAnServiceImpl;
|
||||
import com.jxy.marketall.utils.MyWebSocketClient;
|
||||
import com.jxy.marketall.vo.BiAnVo;
|
||||
import com.jxy.marketall.vo.BianceVolumeVo;
|
||||
import com.jxy.marketall.vo.BourseVo;
|
||||
import com.jxy.marketall.vo.TZVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description btc查询
|
||||
* @Date 2022/6/20 17:26
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bian")
|
||||
@Api(tags = "bian查询接口")
|
||||
public class BiAnController {
|
||||
|
||||
@Autowired
|
||||
private BiAnServiceImpl biAnService;
|
||||
|
||||
//@GetMapping("/list")
|
||||
//@ApiOperation(value = "币安 条件查询",response = List.class)
|
||||
//@ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "timeInterval", value = "时间间隔 单位分钟min、小时h、天d、月M,严格区分大小写", dataType = "string", paramType = "query"),
|
||||
// @ApiImplicitParam(name = "symbol", value = "交易对", dataType = "string", paramType = "query", required = true),
|
||||
// @ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
// @ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
////@RequiresLogin
|
||||
//public AjaxResult list(BiAnVo biAnVo){
|
||||
//
|
||||
// AjaxResult dataByCondition = biAnService.findDataByCondition(biAnVo);
|
||||
// return dataByCondition;
|
||||
//}
|
||||
|
||||
@PostMapping("/kline")
|
||||
@ApiOperation(value = "币安 条件查询",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "timeInterval", value = "时间间隔 单位分钟min、小时h、天d、月M,严格区分大小写", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "symbol", value = "交易对", dataType = "string", paramType = "query", required = true),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult kline(@RequestBody() BourseVo vo){
|
||||
|
||||
return biAnService.getKLine(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/realTimeData")
|
||||
@ApiOperation(value = "币安 实时数据",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "timeInterval", value = "时间间隔 单位分钟min、小时h、天d、月M,严格区分大小写", dataType = "string", paramType = "query",required = true),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间格式yyyy-MM-DD HH:MM:SS 只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query",required = true),
|
||||
@ApiImplicitParam(name = "symbol", value = "交易对", dataType = "string", paramType = "query", required = true)})
|
||||
//@RequiresLogin
|
||||
public AjaxResult realTimeData(BiAnVo biAnVo){
|
||||
return AjaxResult.success(biAnService.getRealTimeData(biAnVo));
|
||||
}
|
||||
|
||||
@GetMapping("/priceValue")
|
||||
@ApiOperation(value = "价格区间交易量之和",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "interval", value = "时间间隔 范围[1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h,1d]", dataType = "string", paramType = "query", required = true),
|
||||
@ApiImplicitParam(name = "count", value = "显示数量 默认50", dataType = "string", paramType = "query", required = true),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult priceValue(BianceVolumeVo vo){
|
||||
|
||||
return AjaxResult.success(biAnService.getTotalValueList(vo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.marketall.mapper.MsgSubMapper;
|
||||
import com.jxy.marketall.service.DataPushService;
|
||||
import org.apache.rocketmq.client.exception.MQBrokerException;
|
||||
import org.apache.rocketmq.client.exception.MQClientException;
|
||||
import org.apache.rocketmq.remoting.exception.RemotingException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Description 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/push")
|
||||
public class DataPushController {
|
||||
|
||||
@Autowired
|
||||
private DataPushService dataPushService;
|
||||
|
||||
@PostMapping("/realtime/btc/dailyv2e1")
|
||||
public AjaxResult BTCdailyindsv2e1(@RequestBody() String data){
|
||||
System.out.println("data:"+data);
|
||||
try {
|
||||
dataPushService.BTCRealTimeV2e1DataPush(data);
|
||||
return AjaxResult.success();
|
||||
} catch (MQClientException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("error1");
|
||||
} catch (RemotingException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("error2");
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("error3");
|
||||
} catch (MQBrokerException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("error4");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,487 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.marketall.service.ETHService;
|
||||
import com.jxy.marketall.service.EthBigTxService;
|
||||
import com.jxy.marketall.vo.*;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description eth查询
|
||||
* @Date 2022/6/21 11:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = {"/eth","/ETH"})
|
||||
@Api(tags = "ETH查询接口")
|
||||
public class ETHController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private EthBigTxService ethBigTxService;
|
||||
|
||||
@Autowired
|
||||
private ETHService ethService;
|
||||
|
||||
@GetMapping(value = {"/ethVolume","/ETHVolume"})
|
||||
@ApiOperation(value = "eth每日交易量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult ethVolume(QueryVo vo){
|
||||
|
||||
return ethBigTxService.getETHVolumeList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/ethFees","/ETHFees"})
|
||||
@ApiOperation(value = "eth每日交易费")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult ethFees(QueryVo vo){
|
||||
|
||||
return ethBigTxService.getETHFeesList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/ethbigtx","/ETHbigtx","/ETHBigTx"})
|
||||
@ApiOperation(value = "eth大额交易条件查询查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "amount", value = "最大交易额", dataType = "double", paramType = "query"),
|
||||
@ApiImplicitParam(name = "address", value = "交易发起地址", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是amount、address、txId", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "txId", value = "交易id", dataType = "string", paramType = "query")})
|
||||
public AjaxResult ethbigtx(ETHVo ethVo){
|
||||
return ethBigTxService.findEthBigTxByETHVo(ethVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/ethbigtxcount","/ETHbigtxcount","/ethBigTxCount","/ETHBigTxCount"})
|
||||
@ApiOperation(value = "eth大额交易数量查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "type", value = "返回类型 根据时间查询时,返回值的类型 具体值为day、week、month、year", dataType = "string", paramType = "query",defaultValue = "day"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query") })
|
||||
public AjaxResult ethbigtxcount(ETHBigTxCountVo vo){
|
||||
return ethBigTxService.findEthBigTxByTime(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/usdtbigtx","/USDTbigtx","/USDTBigTx"})
|
||||
@ApiOperation(value = "usdt大额交易条件查询查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "amount", value = "最大交易额", dataType = "double", paramType = "query"),
|
||||
@ApiImplicitParam(name = "address", value = "交易发起地址", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是amount、address、txId", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "txId", value = "交易id", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult usdtbigtx(ETHVo ethVo){
|
||||
return ethBigTxService.findUSDTBigTxByUSDTVo(ethVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/usdtbigtxcount","/USDTbigtxcount","/usdtBigTxCount","/USDTBigTxCount"})
|
||||
@ApiOperation(value = "usdt大额交易数量查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query") })
|
||||
//@RequiresLogin
|
||||
public AjaxResult usdtbigtxcount(ETHBigTxCountVo vo){
|
||||
return ethBigTxService.findUSDTBigTxByTime(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/usdcbigtx","/USDCbigtx","/USDCBigTx"})
|
||||
@ApiOperation(value = "usdc大额交易条件查询查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "amount", value = "最大交易额", dataType = "double", paramType = "query"),
|
||||
@ApiImplicitParam(name = "address", value = "交易发起地址", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是amount、address、txId", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "txId", value = "交易id", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult usdcbigtx(ETHVo ethVo){
|
||||
return ethBigTxService.findUSDCBigTxByUSDCVo(ethVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/usdcbigtxcount","/USDCbigtxcount","/usdcBigTxCount","/USDCBigTxCount"})
|
||||
@ApiOperation(value = "usdc大额交易数量查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query") })
|
||||
//@RequiresLogin
|
||||
public AjaxResult usdcbigtxcount(ETHBigTxCountVo vo){
|
||||
return ethBigTxService.findUSDCBigTxByTime(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/busdbigtx","/BUSDbigtx","/BUSDBigTx"})
|
||||
@ApiOperation(value = "busd大额交易条件查询查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "amount", value = "最大交易额", dataType = "double", paramType = "query"),
|
||||
@ApiImplicitParam(name = "address", value = "交易发起地址", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是amount、address、txId", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "txId", value = "交易id", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult busdbigtx(ETHVo ethVo){
|
||||
return ethBigTxService.findBUSDBigTxByUSDTVo(ethVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/busdbigtxcount","/BUSDbigtxcount","/busdBigTxCount","/BUSDBigTxCount"})
|
||||
@ApiOperation(value = "busd大额交易数量查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query") })
|
||||
//@RequiresLogin
|
||||
public AjaxResult busdbigtxcount(ETHBigTxCountVo vo){
|
||||
return ethBigTxService.findBUSDBigTxByTime(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/usdtVolume","/USDTVolume"})
|
||||
@ApiOperation(value = "eth USDT 每日总交易量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult usdtVolume(QueryVo queryVo){
|
||||
|
||||
return ethBigTxService.getUSDTVolumeList(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/usdcVolume","/USDCVolume"})
|
||||
@ApiOperation(value = "eth USDC 每日总交易量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult usdcVolume(QueryVo queryVo){
|
||||
|
||||
return ethBigTxService.getUSDCVolumeList(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/busdVolume","/BUSDVolume"})
|
||||
@ApiOperation(value = "BUSD 每日总交易量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult busdVolume(QueryVo queryVo){
|
||||
|
||||
return ethBigTxService.getBUSDVolumeList(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/tronUsdcVolume","/tronUSDCVolume"})
|
||||
@ApiOperation(value = "eth USDC 每日总交易量监控")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult tronUsdcVolume(QueryVo queryVo){
|
||||
|
||||
return ethBigTxService.getTronUSDCVolumeList(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/tronUsdtVolume","/tronUSDTVolume"})
|
||||
@ApiOperation(value = "eth USDT 每日总交易量监控")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult tronUsdtVolume(QueryVo queryVo){
|
||||
|
||||
return ethBigTxService.getTronUSDTVolumeList(queryVo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/tronUSDTBigTx"})
|
||||
@ApiOperation(value = "usdt大额交易监控条件查询查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "amount", value = "最大交易额", dataType = "double", paramType = "query"),
|
||||
@ApiImplicitParam(name = "address", value = "交易发起地址", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "tag", value = "地址标记", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是amount、address、txId", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "txId", value = "交易id", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult tronusdtbigtx(ETHVo ethVo){
|
||||
return ethBigTxService.findTronUSDTBigTxByVo(ethVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/tronUSDTBigTxCount"})
|
||||
@ApiOperation(value = "usdt大额交易监控数量查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query") })
|
||||
//@RequiresLogin
|
||||
public AjaxResult tronusdtbigtxcount(QueryVo vo){
|
||||
return ethBigTxService.findTronUSDTBigTxByTime(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/tronUSDCBigTx"})
|
||||
@ApiOperation(value = "usdc大额交易监控条件查询查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "amount", value = "最大交易额", dataType = "double", paramType = "query"),
|
||||
@ApiImplicitParam(name = "address", value = "交易发起地址", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "tag", value = "地址标记", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是amount、address、txId", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "txId", value = "交易id", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult tronusdcbigtx(ETHVo ethVo){
|
||||
return ethBigTxService.findTronUSDCBigTxByVo(ethVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/tronUSDCBigTxCount"})
|
||||
@ApiOperation(value = "usdc大额交易监控数量查询接口",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query") })
|
||||
//@RequiresLogin
|
||||
public AjaxResult tronusdcbigtxcount(QueryVo vo){
|
||||
return ethBigTxService.findTronUSDCBigTxByTime(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/ethTopAddrList"})
|
||||
@ApiOperation(value = "eth 巨鲸列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "页数 从1开始 默认为第一页", dataType = "int", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "address", value = "按地址查询", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "balance", value = "余额 查询大于该值的数据", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是balance、address", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "limit", value = "每页数据条数 默认50", dataType = "int", paramType = "query", required = false) })
|
||||
public AjaxResult ethTopAddrList(ETHTopAddrVo vo){
|
||||
return ethService.getETHTopAddrByPage(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/ethTopAddrMonitorList"})
|
||||
@ApiOperation(value = "eth 巨鲸地址跟踪 Top address Monitor")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "页数 从1开始 默认为第一页", dataType = "int", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "address", value = "按地址查询", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "balance", value = "余额 查询大于该值的数据", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是balance、address", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "limit", value = "每页数据条数 默认50", dataType = "int", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult ethTopAddrMonitorList(ETHVo vo){
|
||||
return ethBigTxService.findEthTopAddrChangeByETHVo(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/newContract"})
|
||||
@ApiOperation(value = "eth 新合约地址 New Contract")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "页数 从1开始 默认为第一页", dataType = "int", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "address", value = "按地址查询", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是balance、address", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "limit", value = "每页数据条数 默认50", dataType = "int", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult newContract(ETHVo vo){
|
||||
return ethBigTxService.getETHNewContractByPage(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/ethTags"})
|
||||
@ApiOperation(value = "eth 地址对应标记持有者名称关系列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "页数 从1开始 默认为第一页", dataType = "int", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "limit", value = "每页数据条数 默认50", dataType = "int", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult ethTags(PageVo vo){
|
||||
return ethService.getETHTagsByPage(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/ETHTokenVolume/query"})
|
||||
@ApiOperation(value = "eth erc20 token每日交易量 条件查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "address", value = "合约地址", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "abbr", value = "缩写名", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult ETHTokenVolumeQuery(ETHTokenVolumeVo vo){
|
||||
|
||||
return ethBigTxService.getETHTokenVolumeList(vo);
|
||||
}
|
||||
|
||||
//@GetMapping(value = {"/ETHTokenVolume"})
|
||||
//@ApiOperation(value = "eth erc20 token每日交易量abbr列表")
|
||||
////@RequiresLogin
|
||||
//public AjaxResult ETHTokenVolume(ETHTokenVolumeVo vo){
|
||||
//
|
||||
// return ethBigTxService.getETHTokenVolumeAbbrList(vo);
|
||||
//}
|
||||
|
||||
@PostMapping(value = {"/ETHTokenVolume"})
|
||||
@ApiOperation(value = "eth erc20 token每日交易量abbr列表")
|
||||
//@RequiresLogin
|
||||
public AjaxResult ETHTokenVolume2(@RequestBody(required = false) ETHTokenVolumeVo vo){
|
||||
|
||||
return ethBigTxService.getETHTokenVolumeAbbrList(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/ETHTokenBigtx"})
|
||||
@ApiOperation(value = "eth erc20 token大额交易",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "amount", value = "最大交易额", dataType = "double", paramType = "query"),
|
||||
@ApiImplicitParam(name = "address", value = "交易发起地址", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "total", value = "模糊查询 值可以是amount、address、txId", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "txId", value = "交易id", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 ", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 ", dataType = "string", paramType = "query", required = false)})
|
||||
//@RequiresLogin
|
||||
public AjaxResult ETHTokenBigtx(ETHTokenVo vo){
|
||||
System.out.println("收到前端请求");
|
||||
long t1 = System.currentTimeMillis();
|
||||
AjaxResult result = ethBigTxService.getETHTokenBigtxList(vo);
|
||||
long t2 = System.currentTimeMillis();
|
||||
System.out.println("大额交易业务耗时"+(t2-t1));
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/ETHTokenAbbrs"})
|
||||
@ApiOperation(value = "eth erc20 token abbr列表",response = List.class)
|
||||
//@RequiresLogin
|
||||
public AjaxResult ETHTokenAbbrs(){
|
||||
return ethBigTxService.getETHTokenAbbrList();
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/ETHTokenBigtxcount"})
|
||||
@ApiOperation(value = "eth erc20 token大额交易每日数量查询",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query") })
|
||||
//@RequiresLogin
|
||||
public AjaxResult ETHTokenBigtxcount(QueryVo vo){
|
||||
return ethBigTxService.findETHTokenBigtxByTime(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/jzr60")
|
||||
@ApiOperation(value = "江卓尔近60天数据",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult jzr60(QueryVo queryVo){
|
||||
return ethService.getJzr60ByTime(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping("/jzr60day")
|
||||
@ApiOperation(value = "江卓尔最近24小时每分钟数据",response = List.class)
|
||||
//@RequiresLogin
|
||||
public AjaxResult jzr60day(){
|
||||
|
||||
return ethService.getJzr60Day();
|
||||
}
|
||||
|
||||
@GetMapping("/ma730")
|
||||
@ApiOperation(value = "ma730",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult ma730(QueryVo queryVo){
|
||||
return ethService.getMa730ByTime(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping("/ma730day")
|
||||
@ApiOperation(value = "ma730近24小时每分钟数据",response = List.class)
|
||||
//@RequiresLogin
|
||||
public AjaxResult ma730day(){
|
||||
|
||||
return ethService.geMa730Day();
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/csupply"})
|
||||
@ApiOperation(value = "流通供应量 Circulating Supply")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult csupply(QueryVo vo){
|
||||
|
||||
return ethBigTxService.getCSupplyList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/reward"})
|
||||
@ApiOperation(value = "抵押奖励 ETH2 Staking rewards")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult reward(QueryVo vo){
|
||||
|
||||
return ethBigTxService.getRewardList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/address"})
|
||||
@ApiOperation(value = "ETH 地址数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult address(QueryVo vo){
|
||||
|
||||
return ethBigTxService.getAddressList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/volume"})
|
||||
@ApiOperation(value = "交易量 Transaction Volume")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult volume(QueryVo vo){
|
||||
|
||||
return ethBigTxService.getVolumeList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/cnew"})
|
||||
@ApiOperation(value = "新合约数 Number of New Contract")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
//@RequiresLogin
|
||||
public AjaxResult cnew(QueryVo vo){
|
||||
|
||||
return ethBigTxService.getCnewList(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/csusdt",})
|
||||
@ApiOperation(value = "Circulating Supply (USDT) USDT 流通量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult csusdt(QueryVo queryVo){
|
||||
|
||||
return ethService.getCSUSDTList(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/csusdc"})
|
||||
@ApiOperation(value = "Circulating Supply (USDC) USDC 流通量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult csusdc(QueryVo queryVo){
|
||||
|
||||
return ethService.getCSUSDCList(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"csbusd"})
|
||||
@ApiOperation(value = "Circulating Supplyn (BUSD) BUSD 流通量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult csbusd(QueryVo queryVo){
|
||||
|
||||
return ethService.getCSBUSDList(queryVo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"totalCSupply"})
|
||||
@ApiOperation(value = "Circulating Supplyn (Total) 总流通量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult totalCSupply(QueryVo queryVo){
|
||||
|
||||
return ethService.getTotalCSupplyList(queryVo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,382 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.redis.service.RedisService;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.common.security.utils.SecurityUtils;
|
||||
import com.jxy.marketall.service.ETHV2Service;
|
||||
import com.jxy.marketall.service.USDService;
|
||||
import com.jxy.marketall.vo.EBalanceVo;
|
||||
import com.jxy.marketall.vo.ETHMintedVo;
|
||||
import com.jxy.marketall.vo.QueryVo;
|
||||
import com.jxy.marketall.vo.SmaVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Description 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = {"/eth/v2","/ETH/v2"})
|
||||
@Api(tags = "eth v2接口")
|
||||
public class ETHV2Controller {
|
||||
|
||||
@Autowired
|
||||
private ETHV2Service ethv2Service;
|
||||
|
||||
@Autowired
|
||||
private USDService usdService;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@PostMapping(value = {"/PiCycleTopIndicator"})
|
||||
@ApiOperation(value = "PI周期顶指标 Pi Cycle Top Indicator")
|
||||
public AjaxResult piCTI(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
|
||||
return ethv2Service.getPiCycleTIList(vo);
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/test"})
|
||||
public AjaxResult test(){
|
||||
return AjaxResult.success(SecurityUtils.getLoginUser());
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = {"/goldenRatioMult"})
|
||||
@ApiOperation(value = "库存/黄金比例乘数 Golden Ratio Multiplier ")
|
||||
//@RequiresLogin
|
||||
public AjaxResult goldenRatioMult(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getGoldenRatioMultList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/cdd"})
|
||||
@ApiOperation(value = "币天销毁量 Coin Days Destroyed")
|
||||
//@RequiresLogin
|
||||
public AjaxResult cdd(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getCDDList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/dormancy"})
|
||||
@ApiOperation(value = "已花费输出休眠平均天数 Average Coin Dormancy")
|
||||
//@RequiresLogin
|
||||
public AjaxResult dormancy(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getAverageCoinDormancyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/asol"})
|
||||
@ApiOperation(value = "")
|
||||
//@RequiresLogin
|
||||
public AjaxResult asol(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return ethv2Service.getASOLList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/cddwave"})
|
||||
@ApiOperation(value = "币天销毁量分布 Distribution of Coin Days Destroyed")
|
||||
//@RequiresLogin
|
||||
public AjaxResult cddwave(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getCDDWaveList(vo.getSma());
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = {"/address/distribution"})
|
||||
@ApiOperation(value = "按余额分段的地址数分布 Distribution of Address nozero")
|
||||
//@RequiresLogin
|
||||
public AjaxResult addressDistribution(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getAddressBalanceList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/address/supplyDistribution"})
|
||||
@ApiOperation(value = "有者地址的供应分布 Distribution of Address Supply")
|
||||
//@RequiresLogin
|
||||
public AjaxResult addressSupplyDistribution(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getAddressSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/address/profitPercent"})
|
||||
@ApiOperation(value = "盈利地址百分比 Percent of Addresses in Profit")
|
||||
//@RequiresLogin
|
||||
public AjaxResult addressProfitPercent(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getAddressProfitPercentList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/address/profit"})
|
||||
@ApiOperation(value = "盈利地址数 Number of Addresses in Profit")
|
||||
//@RequiresLogin
|
||||
public AjaxResult addressProfit(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getAddressProfitList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/address/loss"})
|
||||
@ApiOperation(value = "亏损地址数 Number of Addresses in Loss")
|
||||
//@RequiresLogin
|
||||
public AjaxResult addressLoss(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getAddressLossList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/inflactionRate"})
|
||||
@ApiOperation(value = "通货膨胀率 Inflation Rate")
|
||||
//@RequiresLogin
|
||||
public AjaxResult inflactionRate(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getInflationRateList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/issuance"})
|
||||
@ApiOperation(value = "新币发行量 issuance")
|
||||
//@RequiresLogin
|
||||
public AjaxResult issuance(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getIssuanceList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/sopr"})
|
||||
@ApiOperation(value = "已花费输出盈利比 Spent Output Profit Ratio")
|
||||
//@RequiresLogin
|
||||
public AjaxResult sopr(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return ethv2Service.getSOPRList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/velocity"})
|
||||
@ApiOperation(value = "流通速度 Velocity")
|
||||
//@RequiresLogin
|
||||
public AjaxResult velocity(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getVelocityList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/nvtRatio"})
|
||||
@ApiOperation(value = "市值/交易价值比 Network Value to Transactions Ratio")
|
||||
//@RequiresLogin
|
||||
public AjaxResult nvtRatio(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getNVTRatioList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/nvtSign"})
|
||||
@ApiOperation(value = "市值/交易价值比 Network Value to Transactions Ratio")
|
||||
//@RequiresLogin
|
||||
public AjaxResult nvtSign(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getNVTSignList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/liveliness"})
|
||||
@ApiOperation(value = "活跃度 liveliness")
|
||||
//@RequiresLogin
|
||||
public AjaxResult liveliness(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getLiveLinessList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/frm"})
|
||||
@ApiOperation(value = "交易费率乘数 Fee Ratio Multiple (FRM)")
|
||||
//@RequiresLogin
|
||||
public AjaxResult frm(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getFRMList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/supply/profitPercent"})
|
||||
@ApiOperation(value = "盈利百分比 Percent Supply in Profit")
|
||||
//@RequiresLogin
|
||||
public AjaxResult supplyProfitPercent(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getSupplyProfitPercentList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/supply/profit"})
|
||||
@ApiOperation(value = "盈利供应量 Total Supply in Profit ")
|
||||
//@RequiresLogin
|
||||
public AjaxResult supplyProfit(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getTotalSupplyProfitList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/supply/loss"})
|
||||
@ApiOperation(value = "盈利亏损量 Total Supply in Loss ")
|
||||
//@RequiresLogin
|
||||
public AjaxResult supplyLoss(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getTotalSupplyLossList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/nupl"})
|
||||
@ApiOperation(value = "未实现的净收益损失比 Net Unrealized Profit/Loss")
|
||||
//@RequiresLogin
|
||||
public AjaxResult nupl(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getNUPLList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/relativeUProfit"})
|
||||
@ApiOperation(value = "未实现的净收益量 Relative Unrealized Profit")
|
||||
//@RequiresLogin
|
||||
public AjaxResult relativeUProfit(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getRelativeUProfitList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/relativeULoss"})
|
||||
@ApiOperation(value = "未实现的净亏损量 Relative Unrealized Loss")
|
||||
//@RequiresLogin
|
||||
public AjaxResult relativeULoss(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getRelativeULossList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/lthNUPL"})
|
||||
@ApiOperation(value = "长持者未实现的净收益量 Long Term Holder NUPL")
|
||||
//@RequiresLogin
|
||||
public AjaxResult lthNUPL(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getLTHNUPLList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/sthNUPL"})
|
||||
@ApiOperation(value = "短持者未实现的净亏损量 Short Term Holder NUPL")
|
||||
//@RequiresLogin
|
||||
public AjaxResult sthNUPL(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getSTHNUPLList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/marketcap"})
|
||||
@ApiOperation(value = "流通市值 Market Cap")
|
||||
//@RequiresLogin
|
||||
public AjaxResult marketcap(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return ethv2Service.getMarketCapList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/rcap"})
|
||||
@ApiOperation(value = "已实现流通市值 Realized Cap")
|
||||
//@RequiresLogin
|
||||
public AjaxResult rcap(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getRealizedCapList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/rprice"})
|
||||
@ApiOperation(value = "已实现价格 Realized Price")
|
||||
//@RequiresLogin
|
||||
public AjaxResult rprice(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getRealizedPriceList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/mvrvRatio"})
|
||||
@ApiOperation(value = "流通市值-已实现流通市值比 Market Value to Realized Value Ratio")
|
||||
//@RequiresLogin
|
||||
public AjaxResult mvrvRatio(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getMVRVRatioList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/burnedSupply"})
|
||||
@ApiOperation(value = "燃烧量 Burned Supply")
|
||||
//@RequiresLogin
|
||||
public AjaxResult burnedSupply(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getBurnedSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/mintedSupply"})
|
||||
@ApiOperation(value = "发行量 Minted Supply")
|
||||
//@RequiresLogin
|
||||
public AjaxResult mintedSupply(@RequestBody(required = false) SmaVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new SmaVo();}
|
||||
return ethv2Service.getMintedSupplyList(vo.getSma());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/usdt/minted"})
|
||||
@ApiOperation(value = "USDT每日铸造量曲线数据")
|
||||
//@RequiresLogin
|
||||
public AjaxResult usdtMinted(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return usdService.getUSDTMinted(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/usdt/minted/list"})
|
||||
@ApiOperation(value = "USDT每日铸造详情表格")
|
||||
//@RequiresLogin
|
||||
public AjaxResult usdtMinted(@RequestBody(required = false) ETHMintedVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new ETHMintedVo();}
|
||||
return usdService.getUSDTMintedList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/usdc/minted"})
|
||||
@ApiOperation(value = "USDC每日铸造量曲线数据")
|
||||
//@RequiresLogin
|
||||
public AjaxResult usdcMinted(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return usdService.getUSDCMinted(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/usdc/minted/list"})
|
||||
@ApiOperation(value = "USDC每日铸造详情表格")
|
||||
//@RequiresLogin
|
||||
public AjaxResult usdcMinted(@RequestBody(required = false) ETHMintedVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new ETHMintedVo();}
|
||||
return usdService.getUSDCMintedList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/busd/minted"})
|
||||
@ApiOperation(value = "BUSD每日铸造量曲线数据")
|
||||
//@RequiresLogin
|
||||
public AjaxResult busdMinted(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return usdService.getBUSDMinted(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/busd/minted/list"})
|
||||
@ApiOperation(value = "BUSD每日铸造详情表格")
|
||||
//@RequiresLogin
|
||||
public AjaxResult busdMinted(@RequestBody(required = false) ETHMintedVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new ETHMintedVo();}
|
||||
return usdService.getBUSDMintedList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/exchanges"})
|
||||
@ApiOperation(value = "获取所有交易所名")
|
||||
//@RequiresLogin
|
||||
public AjaxResult exchanges(){
|
||||
|
||||
return ethv2Service.getExchanges();
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/ebalance"})
|
||||
@ApiOperation(value = "待交易量")
|
||||
//@RequiresLogin
|
||||
public AjaxResult ebalance(@RequestBody EBalanceVo vo){
|
||||
|
||||
return ethv2Service.getExchangeBalance(vo);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = {"/price"})
|
||||
@ApiOperation(value = "ethindsv1表价格")
|
||||
//@RequiresLogin
|
||||
public AjaxResult price(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){ vo = new QueryVo();}
|
||||
return ethv2Service.getPrice(vo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.marketall.service.BorderMongoService;
|
||||
import com.jxy.marketall.service.ExchangeService;
|
||||
import com.jxy.marketall.vo.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* @Description 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/exchange")
|
||||
@Api(tags = "交易所接口")
|
||||
public class ExchangeController {
|
||||
|
||||
@Autowired
|
||||
private ExchangeService exchangeService;
|
||||
|
||||
@Autowired
|
||||
private BorderMongoService borderMongoService;
|
||||
|
||||
|
||||
@PostMapping(value = {"/fundingRate"})
|
||||
@ApiOperation(value = "资金费率")
|
||||
public AjaxResult fundingRate(@RequestBody() BourseVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new BourseVo();}
|
||||
|
||||
return exchangeService.getFundingRateByTime(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/openInterest"})
|
||||
@ApiOperation(value = "未平仓合约数")
|
||||
public AjaxResult openInterest(@RequestBody() BourseVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new BourseVo();}
|
||||
|
||||
return exchangeService.getOpenInterestByTime(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/takerlongshortRatio"})
|
||||
@ApiOperation(value = "合约主动买入量")
|
||||
public AjaxResult takerlongshortRatio(@RequestBody() BourseVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new BourseVo();}
|
||||
|
||||
return exchangeService.getTakerlongshortRatioByTime(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/volumeProfile"})
|
||||
@ApiOperation(value = "成交量分布")
|
||||
public AjaxResult volumeProfile(@RequestBody() VolumeProfileVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new VolumeProfileVo();}
|
||||
|
||||
return exchangeService.getVolumeProfile(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/v2/tzbp"})
|
||||
@ApiOperation(value = "时区购买力")
|
||||
public AjaxResult tzbp(@RequestBody() TimeZoneVo vo){
|
||||
return exchangeService.getTimeZoneBuyPowerList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/v2/bobp"})
|
||||
@ApiOperation(value = "买入大单挂单")
|
||||
public AjaxResult bobp(@RequestBody BorderVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new BorderVo();}
|
||||
return borderMongoService.getBuyPowerList(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/v2/bosp"})
|
||||
@ApiOperation(value = "卖出大单挂单")
|
||||
public AjaxResult bosp(@RequestBody BorderVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new BorderVo();}
|
||||
return borderMongoService.getSellPowerList(vo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping(value = {"/v2/btcBalance"})
|
||||
@ApiOperation(value = "btc余额")
|
||||
public AjaxResult btcBalance(@RequestBody() QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return exchangeService.getBTCBalanceList(vo);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = {"/v2/ethBalance"})
|
||||
@ApiOperation(value = "eth余额")
|
||||
public AjaxResult ethBalance(@RequestBody() QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return exchangeService.getETHBalanceList(vo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.marketall.mapper.BiAnMapper2;
|
||||
import com.jxy.marketall.service.MacroEconomyService;
|
||||
import com.jxy.marketall.service.NDAQService;
|
||||
import com.jxy.marketall.vo.*;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/market")
|
||||
@Api(tags = "宏观经济接口")
|
||||
public class MarketController {
|
||||
|
||||
@Autowired
|
||||
private NDAQService ndaqService;
|
||||
|
||||
@Autowired
|
||||
private BiAnMapper2 biAnMapper2;
|
||||
|
||||
@Autowired
|
||||
private MacroEconomyService macroEconomyService;
|
||||
|
||||
|
||||
@GetMapping("/NDAQohlc")
|
||||
@ApiOperation(value = "纳斯达克 IXIC:ohlc数据",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false)})
|
||||
public AjaxResult NDAQohlc(QueryVo vo){
|
||||
|
||||
return ndaqService.findOHLCByTime(vo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/NDAQma")
|
||||
@ApiOperation(value = "纳斯达克 IXIC:ma数据",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false)})
|
||||
public AjaxResult NDAQma(QueryVo vo){
|
||||
|
||||
return ndaqService.findMaByTime(vo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/NDAQBTCPrice")
|
||||
@ApiOperation(value = "NDAQ、BTC对比K线 以NDAQ时间线为主",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false)})
|
||||
//@RequiresLogin
|
||||
public AjaxResult NBPriceByNDAQTime(QueryVo vo){
|
||||
|
||||
return ndaqService.getNBPriceByNDAQTime(vo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/BTCNDAQPrice")
|
||||
@ApiOperation(value = "NDAQ、BTC对比K线 以BTC币价时间线为主",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false)})
|
||||
//@RequiresLogin
|
||||
public AjaxResult NBPriceByBTCTime(QueryVo vo){
|
||||
|
||||
return ndaqService.getNBPriceByBTCTime(vo);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/USTreasuriesYields")
|
||||
@ApiOperation(value = "国债收益率(美国) 条件查询",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "timeInterval", value = "时间间隔 单位分钟min、小时h、天d、月M,严格区分大小写", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult USTreasuriesYields(@RequestBody() TreasuriesYieldsVo vo){
|
||||
|
||||
return macroEconomyService.getTreasuriesYields(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/MoneyStockMeasures")
|
||||
@ApiOperation(value = "货币供应量 条件查询",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ifAdjusted", value = "是否季节性调整", dataType = "integer", paramType = "query"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult MoneyStockMeasures(@RequestBody() MoneyStockMeasuresVo vo){
|
||||
|
||||
return macroEconomyService.getMoneyStockMeasures(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/loan/psi")
|
||||
@ApiOperation(value = "私营部门贷款",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult LoanPSI(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){
|
||||
vo = new QueryVo();
|
||||
}
|
||||
return macroEconomyService.getPSI(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/loan/gdp")
|
||||
@ApiOperation(value = "私人债务占GDP比重 条件查询",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult LoanFDHBPIGDP(@RequestBody(required = false) QueryVo vo){
|
||||
|
||||
if(StringUtils.isNull(vo)){
|
||||
vo = new QueryVo();
|
||||
}
|
||||
return macroEconomyService.getGDPPrivateInvestor(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/wei")
|
||||
@ApiOperation(value = "每周经济指数",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间, 表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult WEI(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){
|
||||
vo = new QueryVo();
|
||||
}
|
||||
return macroEconomyService.getWEI(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/exchangeRate")
|
||||
@ApiOperation(value = "最新外汇信息",response = List.class)
|
||||
//@RequiresLogin
|
||||
public AjaxResult exchangeRate(){
|
||||
return macroEconomyService.getNewExchangeRate();
|
||||
}
|
||||
|
||||
@PostMapping("/exchangeRate/list")
|
||||
@ApiOperation(value = "外汇信息历史数据",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "symbol", value = "具体数据", dataType = "integer", paramType = "query"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult exchangeRateList(@RequestBody() BiAnVo vo){
|
||||
|
||||
return macroEconomyService.getExchangeRateList(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/GDP")
|
||||
@ApiOperation(value = "最新国内生产总值",response = List.class)
|
||||
//@RequiresLogin
|
||||
public AjaxResult gdp(){
|
||||
return macroEconomyService.getNewGDP();
|
||||
}
|
||||
|
||||
@PostMapping("/GDP/list")
|
||||
@ApiOperation(value = "国内生产总值历史数据",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "symbol", value = "具体数据", dataType = "integer", paramType = "query"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间 可以只传开始时间,表示查询大于这个时间的值", dataType = "string", paramType = "query")})
|
||||
//@RequiresLogin
|
||||
public AjaxResult gdpList(@RequestBody() BiAnVo vo){
|
||||
return macroEconomyService.getGDPList(vo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.marketall.service.CoinPriceService;
|
||||
import com.jxy.marketall.service.MarketallService;
|
||||
import com.jxy.marketall.service.NDAQService;
|
||||
import com.jxy.marketall.vo.CoinVo;
|
||||
import com.jxy.marketall.vo.RequestVo;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/list")
|
||||
@Api(tags = "marketall接口")
|
||||
public class MarketallController {
|
||||
|
||||
@Autowired
|
||||
private MarketallService marketallService;
|
||||
|
||||
|
||||
@GetMapping("/interface")
|
||||
@ApiOperation(value = "interface",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "req", value = "具体接口名", dataType = "string", paramType = "query", required = true),
|
||||
@ApiImplicitParam(name = "radius", value = "查询范围", dataType = "string", paramType = "query", required = true),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false) })
|
||||
public AjaxResult list(RequestVo requestVo){
|
||||
|
||||
return marketallService.findResultByRequestVo(requestVo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/coinmarket")
|
||||
@ApiOperation(value = "24小时币价查询",response = List.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "coin", value = " ", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", dataType = "string", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", dataType = "string", paramType = "query", required = false)})
|
||||
//@RequiresLogin
|
||||
public AjaxResult coinmarket(CoinVo coinVo){
|
||||
|
||||
return marketallService.findCoinMarketPrice(coinVo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/coinmarket/all")
|
||||
@ApiOperation(value = "币价当前市值排名 前一百",response = List.class)
|
||||
//@RequiresLogin
|
||||
public AjaxResult coinmarketAll(){
|
||||
|
||||
return marketallService.findCoinMarketAll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.annotation.RateLimiter;
|
||||
import com.jxy.common.core.enums.LimitType;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.marketall.service.MessageService;
|
||||
import com.jxy.marketall.vo.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* @Description 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = {"/msgBorad","/msgBroad"})
|
||||
@Api(tags = "留言接口")
|
||||
public class MessageController {
|
||||
|
||||
@Autowired
|
||||
private MessageService messageService;
|
||||
|
||||
|
||||
@PostMapping("/submitMsg")
|
||||
@RequiresLogin
|
||||
public AjaxResult submitMsg(@RequestBody SubmitMsgVo vo){
|
||||
|
||||
try {
|
||||
messageService.submitMsg(vo);
|
||||
return AjaxResult.success("留言成功");
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("留言失败"+e);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/getPageMsg")
|
||||
@RequiresLogin
|
||||
public AjaxResult getPageMsg(@RequestBody PageMsgVo vo){
|
||||
|
||||
return messageService.getPageMsg(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/getAllMsg")
|
||||
@RequiresLogin
|
||||
public AjaxResult getAllMsg(@RequestBody(required = false) AllMsgVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new AllMsgVo();}
|
||||
|
||||
return messageService.getAllMsg(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/getDailyMsgCount")
|
||||
@RequiresLogin
|
||||
public AjaxResult getDailyMsgCount(@RequestBody(required = false)QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
|
||||
return messageService.getDailyMsgCount(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/responMsg")
|
||||
@RequiresLogin
|
||||
public AjaxResult responMsg(@RequestBody ResponMsgVo vo){
|
||||
|
||||
return messageService.responMsg(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/getPrivateMsg")
|
||||
@RequiresLogin
|
||||
public AjaxResult getPrivateMsg(@RequestBody PrivateMsgVo vo){
|
||||
|
||||
return messageService.getPrivateMsg(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/getPageDetail")
|
||||
@RequiresLogin
|
||||
public AjaxResult getPageDetail(@RequestBody PageMsgVo vo){
|
||||
|
||||
return messageService.getPageDetail(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/comment")
|
||||
@RequiresLogin
|
||||
public AjaxResult comment(@RequestBody PageCommentVo vo){
|
||||
|
||||
return messageService.changePageChooseByUser(vo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.core.web.controller.BaseController;
|
||||
import com.jxy.common.core.web.page.TableDataInfo;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.marketall.dto.SubscriptionContentDto;
|
||||
import com.jxy.marketall.service.MsgSubService;
|
||||
import com.jxy.marketall.vo.IdVo;
|
||||
import com.jxy.marketall.vo.PageVo;
|
||||
import com.jxy.marketall.vo.SubscriptionContentVo;
|
||||
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 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/msgSub")
|
||||
public class MsgSubscriptionController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private MsgSubService msgSubService;
|
||||
|
||||
@PostMapping("/subscript")
|
||||
@ApiOperation(value = "指标订阅")
|
||||
@RequiresLogin
|
||||
public AjaxResult subscript(@RequestBody SubscriptionContentVo vo){
|
||||
|
||||
return msgSubService.subscriptionMsg(vo);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
@ApiOperation(value = "查看用户订阅指标列表 分页")
|
||||
@RequiresLogin
|
||||
public TableDataInfo list(@RequestBody(required = false) PageVo vo){
|
||||
|
||||
if(StringUtils.isNull(vo)){
|
||||
vo = new PageVo();
|
||||
}
|
||||
PageHelper.startPage(vo.getPage(),vo.getLimit());
|
||||
List<SubscriptionContentDto> list = msgSubService.getUserSubscriptList(vo);
|
||||
return getDataTable(list);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/cancel")
|
||||
@ApiOperation(value = "取消指标订阅")
|
||||
@RequiresLogin
|
||||
public AjaxResult cancel(@RequestBody IdVo vo){
|
||||
|
||||
return msgSubService.cancelSubscription(vo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.marketall.service.MarketallService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
/**
|
||||
* @Description 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/newData")
|
||||
@ApiIgnore
|
||||
public class NewDataController {
|
||||
|
||||
@Autowired
|
||||
private MarketallService marketallService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(){
|
||||
|
||||
return marketallService.getNewDataList();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.marketall.service.MarketallService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
/**
|
||||
* @Description 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
public class TestController {
|
||||
|
||||
@Autowired
|
||||
private MarketallService marketallService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(){
|
||||
|
||||
return marketallService.getNewDataList();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
package com.jxy.marketall.controller;
|
||||
|
||||
import com.jxy.common.core.utils.StringUtils;
|
||||
import com.jxy.common.core.web.Result.AjaxResult;
|
||||
import com.jxy.common.security.annotation.RequiresLogin;
|
||||
import com.jxy.marketall.dto.IdsDto;
|
||||
import com.jxy.marketall.service.UserHelpService;
|
||||
import com.jxy.marketall.vo.*;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* @Description 统一请求接口
|
||||
* @Date 2022/5/27 9:54
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ticket")
|
||||
public class UserHelpController {
|
||||
|
||||
@Autowired
|
||||
private UserHelpService userHelpService;
|
||||
|
||||
@PostMapping("/getQuestionType")
|
||||
@ApiOperation(value = "获取问题分类")
|
||||
@RequiresLogin
|
||||
public AjaxResult getQuestionType(){
|
||||
|
||||
return userHelpService.getTypeList();
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/uploadFile")
|
||||
@ApiOperation(value = "文件上传")
|
||||
@RequiresLogin
|
||||
public AjaxResult uploadFile(@RequestParam("file") MultipartFile[] file){
|
||||
|
||||
try {
|
||||
return userHelpService.uploadFiles(file);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("服务器异常,请联系管理员");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/downloadFile")
|
||||
@ApiOperation(value = "文件批量下载")
|
||||
//@RequiresLogin
|
||||
public void download(IdsDto dto, HttpServletRequest request, HttpServletResponse response){
|
||||
|
||||
userHelpService.downloadByIds(dto.getIds(),request,response);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/submitTicket")
|
||||
@ApiOperation(value = "提交工单")
|
||||
@RequiresLogin
|
||||
public AjaxResult submitTicket(@RequestBody(required = false) TicketVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new TicketVo();}
|
||||
return userHelpService.submitTicket(vo);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/resubmitTicket")
|
||||
@ApiOperation(value = "工单继续提交 已提交内容补充")
|
||||
@RequiresLogin
|
||||
public AjaxResult resubmitTicket(@RequestBody ResubmitTicketVo vo){
|
||||
return userHelpService.resubmitTicket(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/retractTicket")
|
||||
@ApiOperation(value = "已提交工单撤回")
|
||||
@RequiresLogin
|
||||
public AjaxResult retractTicket(@RequestBody IdVo vo){
|
||||
return userHelpService.retractTicket(vo.getId());
|
||||
}
|
||||
|
||||
@PostMapping("/readTicket")
|
||||
@ApiOperation(value = "工单状态设为已读")
|
||||
@RequiresLogin
|
||||
public AjaxResult readTicket(@RequestBody IdVo vo){
|
||||
return userHelpService.readTicket(vo.getId());
|
||||
}
|
||||
|
||||
@PostMapping("/endTicket")
|
||||
@ApiOperation(value = "工单状态设为一解决")
|
||||
@RequiresLogin
|
||||
public AjaxResult endTicket(@RequestBody IdVo vo){
|
||||
return userHelpService.endTicket(vo.getId());
|
||||
}
|
||||
|
||||
@PostMapping("/submitAuditTicket")
|
||||
@ApiOperation(value = "提交工单审核")
|
||||
@RequiresLogin
|
||||
public AjaxResult submitAuditTicket(@RequestBody IdVo vo){
|
||||
return userHelpService.submitAuditTicket(vo.getId());
|
||||
}
|
||||
|
||||
@PostMapping("/getPrivateTicket")
|
||||
@ApiOperation(value = "个人工单列表")
|
||||
@RequiresLogin
|
||||
public AjaxResult getPrivateTicket(@RequestBody(required = false) StatusVo vo){
|
||||
if(StringUtils.isNull(vo)){
|
||||
vo = new StatusVo();
|
||||
vo.setStatus(0);
|
||||
}
|
||||
return userHelpService.getPrivateTicketByStatus(vo.getStatus());
|
||||
}
|
||||
|
||||
@PostMapping("/getTicketDetails")
|
||||
@ApiOperation(value = "工单详情")
|
||||
@RequiresLogin
|
||||
public AjaxResult getTicketDetails(@RequestBody IdVo vo){
|
||||
return userHelpService.getTicketDetails(vo.getId());
|
||||
}
|
||||
|
||||
@PostMapping("/getUnreadCount")
|
||||
@ApiOperation(value = "个人未读工单数")
|
||||
@RequiresLogin
|
||||
public AjaxResult getUnreadCount(){
|
||||
return userHelpService.getUnreadCount();
|
||||
}
|
||||
|
||||
@PostMapping("/getTicketList")
|
||||
@ApiOperation(value = "后台工单列表")
|
||||
@RequiresLogin
|
||||
public AjaxResult getTicket(@RequestBody StatusVo vo){
|
||||
return userHelpService.getTicketList(vo.getStatus());
|
||||
}
|
||||
|
||||
@PostMapping("/getDailyCount")
|
||||
@ApiOperation(value = "每日工单数")
|
||||
@RequiresLogin
|
||||
public AjaxResult getDailyCount(@RequestBody(required = false) QueryVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new QueryVo();}
|
||||
return userHelpService.getDailyCount(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/responTicket")
|
||||
@ApiOperation(value = "回复工单")
|
||||
@RequiresLogin
|
||||
public AjaxResult responTicket(@RequestBody ResponTicketVo vo){
|
||||
return userHelpService.responTicket(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/auditTicket")
|
||||
@ApiOperation(value = "审核工单")
|
||||
@RequiresLogin
|
||||
public AjaxResult auditTicket(@RequestBody(required = false) AuditTicketVo vo){
|
||||
if(StringUtils.isNull(vo)){vo = new AuditTicketVo();}
|
||||
return userHelpService.auditTicket(vo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class ASOLDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
private BigDecimal asol;
|
||||
|
||||
private BigDecimal eaasol;
|
||||
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class AddressDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 新增地址数 */
|
||||
private BigDecimal newAddress;
|
||||
|
||||
/** 新增增地址交易量 */
|
||||
private BigDecimal newAddressVolume;
|
||||
|
||||
private BigDecimal totalAddress;
|
||||
|
||||
/** 活跃地址数 */
|
||||
private BigDecimal activeAddress;
|
||||
|
||||
/** 发送地址数 */
|
||||
private BigDecimal sendAddress;
|
||||
|
||||
/** 接收地址数 */
|
||||
private BigDecimal receiveAddress;
|
||||
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class AdjustedMoneyStockMeasuresDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal m1;
|
||||
|
||||
private BigDecimal m2;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class AllTypeCSDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal usdc;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal usdt;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal busd;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/6/20 17:44
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BTCBigAmountVoutDto implements Serializable {
|
||||
|
||||
private int id;
|
||||
|
||||
@TableField("unixdt")
|
||||
private Date date;
|
||||
|
||||
private String vout;
|
||||
|
||||
private Double amount;
|
||||
|
||||
private int height;
|
||||
|
||||
@TableField("txid")
|
||||
private String txId;
|
||||
|
||||
private String tag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author duyi
|
||||
* @create 2022-07-27 11:20
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BTCFeesDto implements Serializable {
|
||||
|
||||
private Date date;
|
||||
|
||||
private Double fees;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author duyi
|
||||
* @create 2022-07-27 11:20
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BTCVolumeDto implements Serializable {
|
||||
|
||||
private Date date;
|
||||
|
||||
private Double volume;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BackendMsgDto implements Serializable {
|
||||
|
||||
private long id;
|
||||
|
||||
/** 留言时间 */
|
||||
private Date userDate;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String userMsg;
|
||||
|
||||
private String msgPage;
|
||||
|
||||
private String coinType;
|
||||
|
||||
private int status;
|
||||
|
||||
/** 回复 */
|
||||
private String respon;
|
||||
|
||||
private Date responDate;
|
||||
|
||||
/** 数据值 */
|
||||
private String responser;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BiAnAppWSDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
private BigDecimal closePrice;
|
||||
|
||||
private BigDecimal changeRate;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BiAnAvgAndMaxDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private String symbol;
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
private double avg;
|
||||
|
||||
private double max;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BiAnClosePriceAndValueDto implements Serializable {
|
||||
|
||||
private double closePrice;
|
||||
|
||||
private double volume;
|
||||
|
||||
private Date date;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BiAnDto implements Serializable {
|
||||
|
||||
private int id;
|
||||
|
||||
private Date openTime;
|
||||
|
||||
private Double openPrice;
|
||||
|
||||
private Double highPrice;
|
||||
|
||||
private Double lowPrice;
|
||||
|
||||
private Double closePrice;
|
||||
|
||||
private Double volume;
|
||||
|
||||
private Date closeTime;
|
||||
|
||||
private Double quality;
|
||||
|
||||
private Double num;
|
||||
|
||||
private Double buyVolume;
|
||||
|
||||
private Double buyQuality;
|
||||
|
||||
private String symbol;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BiAnTotalValueDto implements Serializable {
|
||||
|
||||
private double price;
|
||||
|
||||
private double volume;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BiAnVolumeDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据条数 */
|
||||
private double volume;
|
||||
|
||||
private double avgV;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BiAnWSDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
private Date openTime;
|
||||
|
||||
private Date closeTime;
|
||||
|
||||
private String symbol;
|
||||
|
||||
private BigDecimal closePrice;
|
||||
|
||||
private BigDecimal openPrice;
|
||||
|
||||
private BigDecimal highPrice;
|
||||
|
||||
private BigDecimal lowPrice;
|
||||
|
||||
private BigDecimal volume;
|
||||
|
||||
private BigDecimal quality;
|
||||
|
||||
private BigDecimal buyVolume;
|
||||
|
||||
private BigDecimal buyQuality;
|
||||
|
||||
private BigDecimal num;
|
||||
|
||||
private BigDecimal changeRate;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/7/18 11:47
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BigSellDto implements Serializable {
|
||||
|
||||
private int id;
|
||||
|
||||
private Date dateTime;
|
||||
|
||||
private int daysEarliest;
|
||||
|
||||
private int daysLatest;
|
||||
|
||||
private int daysLargest;
|
||||
|
||||
private int daysCurrent;
|
||||
|
||||
private Double buyprice;
|
||||
|
||||
private Double sellprice;
|
||||
|
||||
private Double amount;
|
||||
|
||||
private Double profit;
|
||||
|
||||
private String address;
|
||||
|
||||
private String txId;
|
||||
|
||||
private int height;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/7/18 11:47
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BlockAmountDto implements Serializable {
|
||||
|
||||
private int id;
|
||||
|
||||
private Date dateTime;
|
||||
|
||||
private Double amount;
|
||||
|
||||
private int height;
|
||||
|
||||
private String blockId;
|
||||
|
||||
private Double price;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/8/1 12:39
|
||||
* @02.
|
||||
* Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BorderDto {
|
||||
|
||||
private int price;
|
||||
|
||||
private BigDecimal num;
|
||||
|
||||
public BorderDto(int price, BigDecimal num) {
|
||||
this.price = price;
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public BorderDto() {
|
||||
this.price = 0;
|
||||
this.num = BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
import org.springframework.data.mongodb.core.mapping.MongoId;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/7/29 17:38
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BuyAmountDto {
|
||||
|
||||
@MongoId
|
||||
private String id;
|
||||
|
||||
@Field("unixdt")
|
||||
private String date;
|
||||
|
||||
|
||||
@Field("buy_amount0")
|
||||
private int buyAmount0;
|
||||
|
||||
@Field("buy_amount1000")
|
||||
private int buyAmount1000;
|
||||
|
||||
@Field("buy_amount2000")
|
||||
private int buyAmount2000;
|
||||
|
||||
@Field("buy_amount3000")
|
||||
private int buyAmount3000;
|
||||
|
||||
@Field("buy_amount4000")
|
||||
private int buyAmount4000;
|
||||
|
||||
@Field("buy_amount5000")
|
||||
private int buyAmount5000;
|
||||
|
||||
@Field("buy_amount6000")
|
||||
private int buyAmount6000;
|
||||
|
||||
@Field("buy_amount7000")
|
||||
private int buyAmount7000;
|
||||
|
||||
@Field("buy_amount8000")
|
||||
private int buyAmount8000;
|
||||
|
||||
@Field("buy_amount9000")
|
||||
private int buyAmount9000;
|
||||
|
||||
@Field("buy_amount10000")
|
||||
private int buyAmount10000;
|
||||
|
||||
@Field("buy_amount11000")
|
||||
private int buyAmount11000;
|
||||
|
||||
@Field("buy_amount12000")
|
||||
private int buyAmount12000;
|
||||
|
||||
@Field("buy_amount13000")
|
||||
private int buyAmount13000;
|
||||
|
||||
@Field("buy_amount14000")
|
||||
private int buyAmount14000;
|
||||
|
||||
@Field("buy_amount15000")
|
||||
private int buyAmount15000;
|
||||
|
||||
@Field("buy_amount16000")
|
||||
private int buyAmount16000;
|
||||
|
||||
@Field("buy_amount17000")
|
||||
private int buyAmount17000;
|
||||
|
||||
@Field("buy_amount18000")
|
||||
private int buyAmount18000;
|
||||
|
||||
@Field("buy_amount19000")
|
||||
private int buyAmount19000;
|
||||
|
||||
@Field("buy_amount20000")
|
||||
private int buyAmount20000;
|
||||
|
||||
@Field("buy_amount21000")
|
||||
private int buyAmount21000;
|
||||
|
||||
@Field("buy_amount22000")
|
||||
private int buyAmount22000;
|
||||
|
||||
@Field("buy_amount23000")
|
||||
private int buyAmount23000;
|
||||
|
||||
@Field("buy_amount24000")
|
||||
private int buyAmount24000;
|
||||
|
||||
@Field("buy_amount25000")
|
||||
private int buyAmount25000;
|
||||
|
||||
@Field("buy_amount26000")
|
||||
private int buyAmount26000;
|
||||
|
||||
@Field("buy_amount27000")
|
||||
private int buyAmount27000;
|
||||
|
||||
@Field("buy_amount28000")
|
||||
private int buyAmount28000;
|
||||
|
||||
@Field("buy_amount29000")
|
||||
private int buyAmount29000;
|
||||
|
||||
@Field("buy_amount30000")
|
||||
private int buyAmount30000;
|
||||
|
||||
@Field("buy_amount31000")
|
||||
private int buyAmount31000;
|
||||
|
||||
@Field("buy_amount32000")
|
||||
private int buyAmount32000;
|
||||
|
||||
@Field("buy_amount33000")
|
||||
private int buyAmount33000;
|
||||
|
||||
@Field("buy_amount34000")
|
||||
private int buyAmount34000;
|
||||
|
||||
@Field("buy_amount35000")
|
||||
private int buyAmount35000;
|
||||
|
||||
@Field("buy_amount36000")
|
||||
private int buyAmount36000;
|
||||
|
||||
@Field("buy_amount37000")
|
||||
private int buyAmount37000;
|
||||
|
||||
@Field("buy_amount38000")
|
||||
private int buyAmount38000;
|
||||
|
||||
@Field("buy_amount39000")
|
||||
private int buyAmount39000;
|
||||
|
||||
@Field("buy_amount40000")
|
||||
private int buyAmount40000;
|
||||
|
||||
@Field("buy_amount41000")
|
||||
private int buyAmount41000;
|
||||
|
||||
@Field("buy_amount42000")
|
||||
private int buyAmount42000;
|
||||
|
||||
@Field("buy_amount43000")
|
||||
private int buyAmount43000;
|
||||
|
||||
@Field("buy_amount44000")
|
||||
private int buyAmount44000;
|
||||
|
||||
@Field("buy_amount45000")
|
||||
private int buyAmount45000;
|
||||
|
||||
@Field("buy_amount46000")
|
||||
private int buyAmount46000;
|
||||
|
||||
@Field("buy_amount47000")
|
||||
private int buyAmount47000;
|
||||
|
||||
@Field("buy_amount48000")
|
||||
private int buyAmount48000;
|
||||
|
||||
@Field("buy_amount49000")
|
||||
private int buyAmount49000;
|
||||
|
||||
@Field("buy_amount50000")
|
||||
private int buyAmount50000;
|
||||
|
||||
@Field("buy_amount51000")
|
||||
private int buyAmount51000;
|
||||
|
||||
@Field("buy_amount52000")
|
||||
private int buyAmount52000;
|
||||
|
||||
@Field("buy_amount53000")
|
||||
private int buyAmount53000;
|
||||
|
||||
@Field("buy_amount54000")
|
||||
private int buyAmount54000;
|
||||
|
||||
@Field("buy_amount55000")
|
||||
private int buyAmount55000;
|
||||
|
||||
@Field("buy_amount56000")
|
||||
private int buyAmount56000;
|
||||
|
||||
@Field("buy_amount57000")
|
||||
private int buyAmount57000;
|
||||
|
||||
@Field("buy_amount58000")
|
||||
private int buyAmount58000;
|
||||
|
||||
@Field("buy_amount59000")
|
||||
private int buyAmount59000;
|
||||
|
||||
@Field("buy_amount60000")
|
||||
private int buyAmount60000;
|
||||
|
||||
@Field("buy_amount61000")
|
||||
private int buyAmount61000;
|
||||
|
||||
@Field("buy_amount62000")
|
||||
private int buyAmount62000;
|
||||
|
||||
@Field("buy_amount63000")
|
||||
private int buyAmount63000;
|
||||
|
||||
@Field("buy_amount64000")
|
||||
private int buyAmount64000;
|
||||
|
||||
@Field("buy_amount65000")
|
||||
private int buyAmount65000;
|
||||
|
||||
@Field("buy_amount66000")
|
||||
private int buyAmount66000;
|
||||
|
||||
@Field("buy_amount67000")
|
||||
private int buyAmount67000;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
import org.springframework.data.mongodb.core.mapping.MongoId;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/7/29 17:38
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BuyDto {
|
||||
|
||||
@MongoId
|
||||
private String id;
|
||||
|
||||
@Field("unixdt")
|
||||
private String date;
|
||||
|
||||
private int buy0;
|
||||
private int buy1000;
|
||||
private int buy2000;
|
||||
private int buy3000;
|
||||
private int buy4000;
|
||||
private int buy5000;
|
||||
private int buy6000;
|
||||
private int buy7000;
|
||||
private int buy8000;
|
||||
private int buy9000;
|
||||
private int buy10000;
|
||||
private int buy11000;
|
||||
private int buy12000;
|
||||
private int buy13000;
|
||||
private int buy14000;
|
||||
private int buy15000;
|
||||
private int buy16000;
|
||||
private int buy17000;
|
||||
private int buy18000;
|
||||
private int buy19000;
|
||||
private int buy20000;
|
||||
private int buy21000;
|
||||
private int buy22000;
|
||||
private int buy23000;
|
||||
private int buy24000;
|
||||
private int buy25000;
|
||||
private int buy26000;
|
||||
private int buy27000;
|
||||
private int buy28000;
|
||||
private int buy29000;
|
||||
private int buy30000;
|
||||
private int buy31000;
|
||||
private int buy32000;
|
||||
private int buy33000;
|
||||
private int buy34000;
|
||||
private int buy35000;
|
||||
private int buy36000;
|
||||
private int buy37000;
|
||||
private int buy38000;
|
||||
private int buy39000;
|
||||
private int buy40000;
|
||||
private int buy41000;
|
||||
private int buy42000;
|
||||
private int buy43000;
|
||||
private int buy44000;
|
||||
private int buy45000;
|
||||
private int buy46000;
|
||||
private int buy47000;
|
||||
private int buy48000;
|
||||
private int buy49000;
|
||||
private int buy50000;
|
||||
private int buy51000;
|
||||
private int buy52000;
|
||||
private int buy53000;
|
||||
private int buy54000;
|
||||
private int buy55000;
|
||||
private int buy56000;
|
||||
private int buy57000;
|
||||
private int buy58000;
|
||||
private int buy59000;
|
||||
private int buy60000;
|
||||
private int buy61000;
|
||||
private int buy62000;
|
||||
private int buy63000;
|
||||
private int buy64000;
|
||||
private int buy65000;
|
||||
private int buy66000;
|
||||
private int buy67000;
|
||||
private int buy68000;
|
||||
private int buy69000;
|
||||
private int buy70000;
|
||||
private int buy71000;
|
||||
private int buy72000;
|
||||
private int buy73000;
|
||||
private int buy74000;
|
||||
private int buy75000;
|
||||
private int buy76000;
|
||||
private int buy77000;
|
||||
private int buy78000;
|
||||
private int buy79000;
|
||||
private int buy80000;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/8/1 12:39
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BuyPowerDto {
|
||||
|
||||
private int maxPrice;
|
||||
|
||||
private int minPrice;
|
||||
|
||||
private int interval;
|
||||
|
||||
private List<BuyPowerMongoDto> list;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.jxy.marketall.entity.KeyValue;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
import org.springframework.data.mongodb.core.mapping.MongoId;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/8/1 12:39
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class BuyPowerMongoDto {
|
||||
|
||||
@Field("unixdt")
|
||||
private Date date;
|
||||
|
||||
private List<BorderDto> value;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author duyi
|
||||
* @create 2022-07-27 11:20
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CapRealDto implements Serializable {
|
||||
|
||||
private Date time;
|
||||
|
||||
private Double capReal;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class CirculatingSupplyDataDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal value;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class CoinDayDesDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal cdd;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal sacdd;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal eacdd;
|
||||
|
||||
private BigDecimal price;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||
import com.jxy.marketall.entity.CoinMarketData;
|
||||
import lombok.Data;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class CoinPriceListDto implements Serializable {
|
||||
|
||||
/** id */
|
||||
private int id;
|
||||
|
||||
/** 其他参数 */
|
||||
private String param;
|
||||
|
||||
/** 数据值 */
|
||||
private Object value;
|
||||
|
||||
/** 时间 */
|
||||
private Date time;
|
||||
|
||||
private List<CoinMarketData> list;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class ComDataDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据值 */
|
||||
private Object value;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class CountDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date dataTime;
|
||||
|
||||
/** 数据条数 */
|
||||
private int num;
|
||||
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/7/18 11:47
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DailyBuySellDto {
|
||||
|
||||
private int id;
|
||||
|
||||
private Date dateTime;
|
||||
|
||||
private Double price;
|
||||
|
||||
private Double buyVolume;
|
||||
|
||||
private Double sellVolume;
|
||||
|
||||
private int height;
|
||||
|
||||
private String profit;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DailyMsgCountDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据条数 */
|
||||
private int total;
|
||||
|
||||
private int solvdCount;
|
||||
|
||||
private int pendingCount;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/7/18 11:47
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DataCheckDto implements Serializable {
|
||||
|
||||
private int id;
|
||||
|
||||
private String tableServer;
|
||||
|
||||
private String db;
|
||||
|
||||
private String tableName;
|
||||
|
||||
private Date dateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/8/4 11:31
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DataCountDto {
|
||||
|
||||
private Long countNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DataDto implements Serializable {
|
||||
|
||||
/** id */
|
||||
private int id;
|
||||
|
||||
/** 其他参数 */
|
||||
private String param;
|
||||
|
||||
/** 时间 */
|
||||
@SerializedName(value = "time" ,alternate = {"date"})
|
||||
private Date time;
|
||||
|
||||
/** 数据值 */
|
||||
private Object value;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DateBigDecimalDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal value;
|
||||
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DateBigDecimalsDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal value1;
|
||||
|
||||
private BigDecimal value2;
|
||||
|
||||
private BigDecimal value3;
|
||||
|
||||
private BigDecimal value4;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DateStrBigDecimalDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private String date;
|
||||
|
||||
/** 数据值 */
|
||||
private BigDecimal value;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DateStrStringDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private String date;
|
||||
|
||||
/** 数据值 */
|
||||
private String value;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DateStringDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 数据值 */
|
||||
private String value;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
import org.springframework.data.mongodb.core.mapping.MongoId;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author duyi
|
||||
* @create 2022-07-27 11:20
|
||||
*/
|
||||
@Data
|
||||
public class DayBalanceDto implements Serializable {
|
||||
|
||||
@MongoId
|
||||
private String id;
|
||||
|
||||
@Field("unixdt")
|
||||
private String dateTime;
|
||||
|
||||
@Field("day_0")
|
||||
private Integer day0;
|
||||
|
||||
@Field("day_1")
|
||||
private Integer day1;
|
||||
|
||||
@Field("day_2")
|
||||
private Integer day2;
|
||||
|
||||
@Field("day_3")
|
||||
private Integer day3;
|
||||
|
||||
@Field("day_4")
|
||||
private Integer day4;
|
||||
|
||||
@Field("day_5")
|
||||
private Integer day5;
|
||||
|
||||
@Field("day_6")
|
||||
private Integer day6;
|
||||
|
||||
@Field("day_7")
|
||||
private Integer day7;
|
||||
|
||||
@Field("day_15")
|
||||
private Integer day15;
|
||||
|
||||
@Field("day_30")
|
||||
private Integer day30;
|
||||
|
||||
@Field("day_60")
|
||||
private Integer day60;
|
||||
|
||||
@Field("day_90")
|
||||
private Integer day90;
|
||||
|
||||
@Field("day_180")
|
||||
private Integer day180;
|
||||
|
||||
@Field("day_360")
|
||||
private Integer day360;
|
||||
|
||||
@Field("day_540")
|
||||
private Integer day540;
|
||||
|
||||
@Field("day_720")
|
||||
private Integer day720;
|
||||
|
||||
@Field("day_1080")
|
||||
private Integer day1080;
|
||||
|
||||
@Field("day_1440")
|
||||
private Integer day1440;
|
||||
|
||||
@Field("day_1880")
|
||||
private Integer day1880;
|
||||
|
||||
@Field("day_2160")
|
||||
private Integer day2160;
|
||||
|
||||
@Field("day_2520")
|
||||
private Integer day2520;
|
||||
|
||||
@Field("day_2880")
|
||||
private Integer day2880;
|
||||
|
||||
@Field("day_3240")
|
||||
private Integer day3240;
|
||||
|
||||
@Field("day_3600")
|
||||
private Integer day3600;
|
||||
|
||||
@Field("day_3960")
|
||||
private Integer day3960;
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
import org.springframework.data.mongodb.core.mapping.MongoId;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/7/29 17:38
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DiffAmountDto {
|
||||
|
||||
@MongoId
|
||||
private String id;
|
||||
|
||||
@Field(name = "unixdt")
|
||||
private String date;
|
||||
|
||||
private int diffAmount0;
|
||||
private int diffAmount1000;
|
||||
private int diffAmount2000;
|
||||
private int diffAmount3000;
|
||||
private int diffAmount4000;
|
||||
private int diffAmount5000;
|
||||
private int diffAmount6000;
|
||||
private int diffAmount7000;
|
||||
private int diffAmount8000;
|
||||
private int diffAmount9000;
|
||||
private int diffAmount10000;
|
||||
private int diffAmount11000;
|
||||
private int diffAmount12000;
|
||||
private int diffAmount13000;
|
||||
private int diffAmount14000;
|
||||
private int diffAmount15000;
|
||||
private int diffAmount16000;
|
||||
private int diffAmount17000;
|
||||
private int diffAmount18000;
|
||||
private int diffAmount19000;
|
||||
private int diffAmount20000;
|
||||
private int diffAmount21000;
|
||||
private int diffAmount22000;
|
||||
private int diffAmount23000;
|
||||
|
||||
@Field("diff_amount-1000")
|
||||
private int diffAmountM1000;
|
||||
|
||||
@Field("diff_amount-2000")
|
||||
private int diffAmountM2000;
|
||||
|
||||
@Field("diff_amount-3000")
|
||||
private int diffAmountM3000;
|
||||
|
||||
@Field("diff_amount-4000")
|
||||
private int diffAmountM4000;
|
||||
|
||||
@Field("diff_amount-5000")
|
||||
private int diffAmountM5000;
|
||||
|
||||
@Field("diff_amount-6000")
|
||||
private int diffAmountM6000;
|
||||
|
||||
@Field("diff_amount-7000")
|
||||
private int diffAmountM7000;
|
||||
|
||||
@Field("diff_amount-8000")
|
||||
private int diffAmountM8000;
|
||||
|
||||
@Field("diff_amount-9000")
|
||||
private int diffAmountM9000;
|
||||
|
||||
@Field("diff_amount-10000")
|
||||
private int diffAmountM10000;
|
||||
|
||||
@Field("diff_amount-11000")
|
||||
private int diffAmountM11000;
|
||||
|
||||
@Field("diff_amount-12000")
|
||||
private int diffAmountM12000;
|
||||
|
||||
@Field("diff_amount-13000")
|
||||
private int diffAmountM13000;
|
||||
|
||||
@Field("diff_amount-14000")
|
||||
private int diffAmountM14000;
|
||||
|
||||
@Field("diff_amount-15000")
|
||||
private int diffAmountM15000;
|
||||
|
||||
@Field("diff_amount-16000")
|
||||
private int diffAmountM16000;
|
||||
|
||||
@Field("diff_amount-17000")
|
||||
private int diffAmountM17000;
|
||||
|
||||
@Field("diff_amount-18000")
|
||||
private int diffAmountM18000;
|
||||
|
||||
@Field("diff_amount-19000")
|
||||
private int diffAmountM19000;
|
||||
|
||||
@Field("diff_amount-20000")
|
||||
private int diffAmountM20000;
|
||||
|
||||
@Field("diff_amount-21000")
|
||||
private int diffAmountM21000;
|
||||
|
||||
@Field("diff_amount-22000")
|
||||
private int diffAmountM22000;
|
||||
|
||||
@Field("diff_amount-23000")
|
||||
private int diffAmountM23000;
|
||||
|
||||
@Field("diff_amount-24000")
|
||||
private int diffAmountM24000;
|
||||
|
||||
@Field("diff_amount-25000")
|
||||
private int diffAmountM25000;
|
||||
|
||||
@Field("diff_amount-26000")
|
||||
private int diffAmountM26000;
|
||||
|
||||
@Field("diff_amount-27000")
|
||||
private int diffAmountM27000;
|
||||
|
||||
@Field("diff_amount-28000")
|
||||
private int diffAmountM28000;
|
||||
|
||||
@Field("diff_amount-29000")
|
||||
private int diffAmountM29000;
|
||||
|
||||
@Field("diff_amount-30000")
|
||||
private int diffAmountM30000;
|
||||
|
||||
@Field("diff_amount-31000")
|
||||
private int diffAmountM31000;
|
||||
|
||||
@Field("diff_amount-32000")
|
||||
private int diffAmountM32000;
|
||||
|
||||
@Field("diff_amount-33000")
|
||||
private int diffAmountM33000;
|
||||
|
||||
@Field("diff_amount-34000")
|
||||
private int diffAmountM34000;
|
||||
|
||||
@Field("diff_amount-35000")
|
||||
private int diffAmountM35000;
|
||||
|
||||
@Field("diff_amount-36000")
|
||||
private int diffAmountM36000;
|
||||
|
||||
@Field("diff_amount-37000")
|
||||
private int diffAmountM37000;
|
||||
|
||||
@Field("diff_amount-38000")
|
||||
private int diffAmountM38000;
|
||||
|
||||
@Field("diff_amount-39000")
|
||||
private int diffAmountM39000;
|
||||
|
||||
@Field("diff_amount-40000")
|
||||
private int diffAmountM40000;
|
||||
|
||||
@Field("diff_amount-41000")
|
||||
private int diffAmountM41000;
|
||||
|
||||
@Field("diff_amount-42000")
|
||||
private int diffAmountM42000;
|
||||
|
||||
@Field("diff_amount-43000")
|
||||
private int diffAmountM43000;
|
||||
|
||||
@Field("diff_amount-44000")
|
||||
private int diffAmountM44000;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
import org.springframework.data.mongodb.core.mapping.MongoId;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Date 2022/7/29 17:38
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DiffDto {
|
||||
|
||||
@MongoId
|
||||
private String id;
|
||||
|
||||
@Field(name = "unixdt")
|
||||
private String date;
|
||||
|
||||
private int diff0;
|
||||
private int diff1000;
|
||||
private int diff2000;
|
||||
private int diff3000;
|
||||
private int diff4000;
|
||||
private int diff5000;
|
||||
private int diff6000;
|
||||
private int diff7000;
|
||||
private int diff8000;
|
||||
private int diff9000;
|
||||
private int diff10000;
|
||||
private int diff11000;
|
||||
private int diff12000;
|
||||
private int diff13000;
|
||||
private int diff14000;
|
||||
private int diff15000;
|
||||
private int diff16000;
|
||||
private int diff17000;
|
||||
private int diff18000;
|
||||
private int diff19000;
|
||||
private int diff20000;
|
||||
private int diff21000;
|
||||
private int diff22000;
|
||||
private int diff23000;
|
||||
|
||||
@Field("diff-1000")
|
||||
private int diffM1000;
|
||||
|
||||
@Field("diff-2000")
|
||||
private int diffM2000;
|
||||
|
||||
@Field("diff-3000")
|
||||
private int diffM3000;
|
||||
|
||||
@Field("diff-4000")
|
||||
private int diffM4000;
|
||||
|
||||
@Field("diff-5000")
|
||||
private int diffM5000;
|
||||
|
||||
@Field("diff-6000")
|
||||
private int diffM6000;
|
||||
|
||||
@Field("diff-7000")
|
||||
private int diffM7000;
|
||||
|
||||
@Field("diff-8000")
|
||||
private int diffM8000;
|
||||
|
||||
@Field("diff-9000")
|
||||
private int diffM9000;
|
||||
|
||||
@Field("diff-10000")
|
||||
private int diffM10000;
|
||||
|
||||
@Field("diff-11000")
|
||||
private int diffM11000;
|
||||
|
||||
@Field("diff-12000")
|
||||
private int diffM12000;
|
||||
|
||||
@Field("diff-13000")
|
||||
private int diffM13000;
|
||||
|
||||
@Field("diff-14000")
|
||||
private int diffM14000;
|
||||
|
||||
@Field("diff-15000")
|
||||
private int diffM15000;
|
||||
|
||||
@Field("diff-16000")
|
||||
private int diffM16000;
|
||||
|
||||
@Field("diff-17000")
|
||||
private int diffM17000;
|
||||
|
||||
@Field("diff-18000")
|
||||
private int diffM18000;
|
||||
|
||||
@Field("diff-19000")
|
||||
private int diffM19000;
|
||||
|
||||
@Field("diff-20000")
|
||||
private int diffM20000;
|
||||
|
||||
@Field("diff-21000")
|
||||
private int diffM21000;
|
||||
|
||||
@Field("diff-22000")
|
||||
private int diffM22000;
|
||||
|
||||
@Field("diff-23000")
|
||||
private int diffM23000;
|
||||
|
||||
@Field("diff-24000")
|
||||
private int diffM24000;
|
||||
|
||||
@Field("diff-25000")
|
||||
private int diffM25000;
|
||||
|
||||
@Field("diff-26000")
|
||||
private int diffM26000;
|
||||
|
||||
@Field("diff-27000")
|
||||
private int diffM27000;
|
||||
|
||||
@Field("diff-28000")
|
||||
private int diffM28000;
|
||||
|
||||
@Field("diff-29000")
|
||||
private int diffM29000;
|
||||
|
||||
@Field("diff-30000")
|
||||
private int diffM30000;
|
||||
|
||||
@Field("diff-31000")
|
||||
private int diffM31000;
|
||||
|
||||
@Field("diff-32000")
|
||||
private int diffM32000;
|
||||
|
||||
@Field("diff-33000")
|
||||
private int diffM33000;
|
||||
|
||||
@Field("diff-34000")
|
||||
private int diffM34000;
|
||||
|
||||
@Field("diff-35000")
|
||||
private int diffM35000;
|
||||
|
||||
@Field("diff-36000")
|
||||
private int diffM36000;
|
||||
|
||||
@Field("diff-37000")
|
||||
private int diffM37000;
|
||||
|
||||
@Field("diff-38000")
|
||||
private int diffM38000;
|
||||
|
||||
@Field("diff-39000")
|
||||
private int diffM39000;
|
||||
|
||||
@Field("diff-40000")
|
||||
private int diffM40000;
|
||||
|
||||
@Field("diff-41000")
|
||||
private int diffM41000;
|
||||
|
||||
@Field("diff-42000")
|
||||
private int diffM42000;
|
||||
|
||||
@Field("diff-43000")
|
||||
private int diffM43000;
|
||||
|
||||
@Field("diff-44000")
|
||||
private int diffM44000;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class DormancyDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
private BigDecimal dormancy;
|
||||
|
||||
private BigDecimal sadormancy;
|
||||
|
||||
private BigDecimal eadormancy;
|
||||
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class ETHAddressBalanceDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
private BigDecimal nozero;
|
||||
|
||||
private BigDecimal balance1;
|
||||
|
||||
private BigDecimal balance10;
|
||||
|
||||
private BigDecimal balance100;
|
||||
|
||||
private BigDecimal balance1k;
|
||||
|
||||
private BigDecimal balance10k;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class ETHAddressDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
/** 活跃地址数 */
|
||||
private BigDecimal activeAddress;
|
||||
|
||||
/** 发送地址数 */
|
||||
private BigDecimal sendAddress;
|
||||
|
||||
/** 接收地址数 */
|
||||
private BigDecimal receiveAddress;
|
||||
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.jxy.marketall.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 返回数据实体
|
||||
* @Date 2022/5/30 11:17
|
||||
* @Author 杜懿
|
||||
*/
|
||||
@Data
|
||||
public class ETHCoinDaysDescDto implements Serializable {
|
||||
|
||||
/** 时间 */
|
||||
private Date date;
|
||||
|
||||
private BigDecimal cdd1;
|
||||
|
||||
private BigDecimal cdd7;
|
||||
|
||||
private BigDecimal cdd30;
|
||||
|
||||
private BigDecimal cdd60;
|
||||
|
||||
private BigDecimal cdd90;
|
||||
|
||||
private BigDecimal cdd180;
|
||||
|
||||
private BigDecimal cdd365;
|
||||
|
||||
private BigDecimal cdd730;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user