Browse Source

空字符串处理。exchange, symbol。

skyffire 1 year ago
parent
commit
648f67ee14
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/msv.rs

+ 10 - 2
src/msv.rs

@@ -27,7 +27,11 @@ pub async fn generate_msv(query_value: Value) -> HttpResponse {
             "gate_usdt_swap"
         }
         Some(exchange) => {
-            exchange
+            if exchange.is_empty() {
+                "gate_usdt_swap"
+            } else {
+                exchange
+            }
         }
     };
     let symbol = match query_value["symbol"].as_str() {
@@ -35,7 +39,11 @@ pub async fn generate_msv(query_value: Value) -> HttpResponse {
             "BTC_USDT".to_string()
         }
         Some(symbol) => {
-            symbol_fix(symbol)
+            if symbol.is_empty() {
+                "BTC_USDT".to_string()
+            } else {
+                symbol_fix(symbol)
+            }
         }
     };
     let mills_back = match query_value["mills_back"].as_str() {