Kaynağa Gözat

调整命名规则

JiahengHe 1 yıl önce
ebeveyn
işleme
d7a28b64f9

+ 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());