From ccc3e0c9f1758be4ce1614ed23cbba406c5db90e Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Mon, 5 Sep 2022 08:46:06 +0000 Subject: [PATCH] bug fixed --- src/api/betting/models.rs | 3 ++- src/api/member_account/api.rs | 12 +----------- src/api/member_account/models.rs | 3 ++- src/synchronizations/betting_history/synchronizer.rs | 12 +----------- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/api/betting/models.rs b/src/api/betting/models.rs index 31fd32b..353da34 100644 --- a/src/api/betting/models.rs +++ b/src/api/betting/models.rs @@ -36,7 +36,8 @@ pub struct Betting { #[serde(rename = "groupKey")] pub group_key: Option, /// 게임 데이터 - pub detail: Option, + #[serde(skip_deserializing)] + pub detail: Option, /// 보너스 여부 #[serde(rename = "isBonus")] pub is_bonus: bool, diff --git a/src/api/member_account/api.rs b/src/api/member_account/api.rs index a54a63a..f23c427 100644 --- a/src/api/member_account/api.rs +++ b/src/api/member_account/api.rs @@ -69,17 +69,7 @@ impl Api { let balance = r.balance.unwrap_or(0.00); let balance_bota = r.balance_bota.unwrap_or(0.00); let balance_sum = r.balance_sum.unwrap_or(0.00); - let companies = match r.companies { - Some(v) => { - let vv = serde_json::from_value::(v).map_err(|e| Error { - code: -1, - msg: Some(e.to_string()), - })?; - - Some(vv) - } - None => None, - }; + let companies = r.companies; Ok(models::GetBalanceForUserResponse { balance, diff --git a/src/api/member_account/models.rs b/src/api/member_account/models.rs index f977f31..4c164f7 100644 --- a/src/api/member_account/models.rs +++ b/src/api/member_account/models.rs @@ -13,7 +13,8 @@ pub struct _GetBalanceForUserResponse { pub balance_bota: Option, #[serde(rename = "balanceSum")] pub balance_sum: Option, - pub companies: Option, + #[serde(skip_deserializing)] + pub companies: Option, } #[derive(Serialize, Deserialize, Debug)] diff --git a/src/synchronizations/betting_history/synchronizer.rs b/src/synchronizations/betting_history/synchronizer.rs index 64e34ba..8f87c1d 100644 --- a/src/synchronizations/betting_history/synchronizer.rs +++ b/src/synchronizations/betting_history/synchronizer.rs @@ -137,17 +137,7 @@ impl Synchronizer { }); } }; - let detail = match b.detail { - Some(v) => { - let vv = serde_json::from_value::(v).map_err(|e| api::core::models::Error { - code: -1, - msg: Some(format!("serde_json::from_value error: {}", e)), - })?; - - Some(vv) - } - None => None, - }; + let detail = b.detail; new_betting_history.push(repositories::betting_history::models::NewBettingHistory { id: b._id,