From b14283182044ae6133dee1ce0b8e93e0659b7b43 Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Mon, 5 Sep 2022 13:39:30 +0000 Subject: [PATCH] bug fixed --- src/api/betting/models.rs | 2 +- src/api/member_account/api.rs | 5 +---- src/api/member_account/models.rs | 2 +- src/synchronizations/betting_history/synchronizer.rs | 5 +---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/api/betting/models.rs b/src/api/betting/models.rs index 69dd378..3c99129 100644 --- a/src/api/betting/models.rs +++ b/src/api/betting/models.rs @@ -36,7 +36,7 @@ pub struct Betting { #[serde(rename = "groupKey")] pub group_key: Option, /// 게임 데이터 - pub detail: Option, + 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 e63b30f..84b0773 100644 --- a/src/api/member_account/api.rs +++ b/src/api/member_account/api.rs @@ -69,10 +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) => v.as_str().map(|ss| ss.to_string()), - None => None, - }; + let companies = r.companies.map(|v| v.get().to_string()); Ok(models::GetBalanceForUserResponse { balance, diff --git a/src/api/member_account/models.rs b/src/api/member_account/models.rs index af0f806..ccf2cd1 100644 --- a/src/api/member_account/models.rs +++ b/src/api/member_account/models.rs @@ -13,7 +13,7 @@ pub struct _GetBalanceForUserResponse { pub balance_bota: Option, #[serde(rename = "balanceSum")] pub balance_sum: Option, - pub companies: Option, + pub companies: Option>, } #[derive(Serialize, Deserialize, Debug)] diff --git a/src/synchronizations/betting_history/synchronizer.rs b/src/synchronizations/betting_history/synchronizer.rs index b9042b3..a986a55 100644 --- a/src/synchronizations/betting_history/synchronizer.rs +++ b/src/synchronizations/betting_history/synchronizer.rs @@ -137,10 +137,7 @@ impl Synchronizer { }); } }; - let detail = match b.detail { - Some(v) => v.as_str().map(|ss| ss.to_string()), - None => None, - }; + let detail = b.detail.map(|v| v.get().to_string()); new_betting_history.push(repositories::betting_history::models::NewBettingHistory { id: b._id,