Prechádzať zdrojové kódy

取消所有订单的功能实现建议

skyfffire 2 rokov pred
rodič
commit
18b14fa7fc
1 zmenil súbory, kde vykonal 21 pridanie a 17 odobranie
  1. 21 17
      standard/src/bitget_spot.rs

+ 21 - 17
standard/src/bitget_spot.rs

@@ -392,23 +392,27 @@ impl Platform for BitgetSpot {
         let symbol_format = utils::format_symbol(self.symbol.clone(), "");
         let res_data = self.request.spot_cancel_symbol_orders(symbol_format.to_string()).await;
         if res_data.code == "200" {
-            let res_data_str = &res_data.data;
-            let res_data_json: serde_json::Value = serde_json::from_str(res_data_str).unwrap();
-            let order_info_list: Vec<serde_json::Value> = res_data_json["successList"].as_array().unwrap().clone();
-            let result = order_info_list.iter().map(|item|
-                Order {
-                    id: item["orderId"].as_str().unwrap().to_string(),
-                    custom_id: item["clientOid"].as_str().unwrap().to_string(),
-                    price: Decimal::ZERO,
-                    amount: Decimal::ZERO,
-                    deal_amount: Decimal::ZERO,
-                    avg_price: Decimal::ZERO,
-                    status: "REMOVE".to_string(),
-                    order_type: "".to_string(),
-                    trace_stack: TraceStack::default().on_special("405 bitget_spot".to_string()),
-                }
-            ).collect();
-            Ok(result)
+            // 1. 获取当前委托列表
+            // 2. 取消委托列表,不然就不会传详情回来
+
+            // let res_data_str = &res_data.data;
+            // let res_data_json: serde_json::Value = serde_json::from_str(res_data_str).unwrap();
+            // info!(?res_data);
+            // let order_info_list: Vec<serde_json::Value> = res_data_json["successList"].as_array().unwrap().clone();
+            // let result = order_info_list.iter().map(|item|
+            //     Order {
+            //         id: item["orderId"].as_str().unwrap().to_string(),
+            //         custom_id: item["clientOid"].as_str().unwrap().to_string(),
+            //         price: Decimal::ZERO,
+            //         amount: Decimal::ZERO,
+            //         deal_amount: Decimal::ZERO,
+            //         avg_price: Decimal::ZERO,
+            //         status: "REMOVE".to_string(),
+            //         order_type: "".to_string(),
+            //         trace_stack: TraceStack::default().on_special("405 bitget_spot".to_string()),
+            //     }
+            // ).collect();
+            Ok(vec![])
         } else {
             Err(Error::new(ErrorKind::Other, res_data.to_string()))
         }