JiahengHe преди 1 година
родител
ревизия
d7a28b64f9
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      price_collection/src/main/java/com/liangjiang/price_collection/service/impl/TableServiceImpl.java

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

@@ -24,7 +24,7 @@ public class TableServiceImpl implements ITableService {
 
     @Override
     public boolean createTable(String source, String coin, String type){
-        String tableName = String.format("%s_%s_%s", source, coin.replaceAll("_", ""), type).toUpperCase();
+        String tableName = String.format("%s_%s_%s", coin.replaceAll("_", ""), source, type).toUpperCase();
         synchronized (interner.intern(tableName)){
             try {
                 tableMapper.createTable(tableName);
@@ -48,7 +48,7 @@ public class TableServiceImpl implements ITableService {
 
     @Override
     public void savePrice(PriceInfoDto dto){
-        String tableName = String.format("%s_%s_%s", dto.getSource(), dto.getCoin().replaceAll("_", ""), dto.getType()).toUpperCase();
+        String tableName = String.format("%s_%s_%s", dto.getCoin().replaceAll("_", ""), dto.getSource(), dto.getType()).toUpperCase();
         try {
             // 尝试先写入
             this.tableMapper.savePrice(tableName, dto.getTime(), dto.getAsk(), dto.getBid());