JiahengHe 1 рік тому
батько
коміт
f2dc0762b6

+ 1 - 0
.gitignore

@@ -2,3 +2,4 @@
 .idea
 basic/target
 logs
+/price_collection/target/

+ 1 - 1
price_collection/src/main/java/com/liangjiang/price_collection/dto/PriceInfoDto.java

@@ -7,7 +7,7 @@ public class PriceInfoDto {
     // 交易所
     private String source;
     // 合约还是现货 swap spot
-    private String type;
+    private String b_type;
     // 币对
     private String coin;
     // 时间戳 秒级

+ 2 - 2
price_collection/src/main/java/com/liangjiang/price_collection/service/impl/TableServiceImpl.java

@@ -93,13 +93,13 @@ public class TableServiceImpl implements ITableService {
 
     @Override
     public void savePrice(PriceInfoDto dto){
-        String tableName = String.format("%s_%s_%s", dto.getCoin().replaceAll("_", ""), dto.getSource(), dto.getType()).toUpperCase();
+        String tableName = String.format("%s_%s_%s", dto.getCoin().replaceAll("_", ""), dto.getSource(), dto.getB_type()).toUpperCase();
         try {
             // 尝试先写入
             this.tableMapper.savePrice(tableName, dto.getTime(), dto.getAsk(), dto.getBid());
         } catch (BadSqlGrammarException ex){// 捕获表不存在的异常
             // 建表
-            this.createTable(dto.getSource(), dto.getCoin(), dto.getType());
+            this.createTable(dto.getSource(), dto.getCoin(), dto.getB_type());
             try {
                 // 写入
                this.tableMapper.savePrice(tableName, dto.getTime(), dto.getAsk(), dto.getBid());