bug fixed

This commit is contained in:
병준 박 2022-09-05 08:46:06 +00:00
parent dfc328b636
commit ccc3e0c9f1
4 changed files with 6 additions and 24 deletions

View File

@ -36,7 +36,8 @@ pub struct Betting {
#[serde(rename = "groupKey")] #[serde(rename = "groupKey")]
pub group_key: Option<String>, pub group_key: Option<String>,
/// 게임 데이터 /// 게임 데이터
pub detail: Option<serde_json::Value>, #[serde(skip_deserializing)]
pub detail: Option<String>,
/// 보너스 여부 /// 보너스 여부
#[serde(rename = "isBonus")] #[serde(rename = "isBonus")]
pub is_bonus: bool, pub is_bonus: bool,

View File

@ -69,17 +69,7 @@ impl Api {
let balance = r.balance.unwrap_or(0.00); let balance = r.balance.unwrap_or(0.00);
let balance_bota = r.balance_bota.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 balance_sum = r.balance_sum.unwrap_or(0.00);
let companies = match r.companies { let companies = r.companies;
Some(v) => {
let vv = serde_json::from_value::<String>(v).map_err(|e| Error {
code: -1,
msg: Some(e.to_string()),
})?;
Some(vv)
}
None => None,
};
Ok(models::GetBalanceForUserResponse { Ok(models::GetBalanceForUserResponse {
balance, balance,

View File

@ -13,7 +13,8 @@ pub struct _GetBalanceForUserResponse {
pub balance_bota: Option<f64>, pub balance_bota: Option<f64>,
#[serde(rename = "balanceSum")] #[serde(rename = "balanceSum")]
pub balance_sum: Option<f64>, pub balance_sum: Option<f64>,
pub companies: Option<serde_json::Value>, #[serde(skip_deserializing)]
pub companies: Option<String>,
} }
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]

View File

@ -137,17 +137,7 @@ impl Synchronizer {
}); });
} }
}; };
let detail = match b.detail { let detail = b.detail;
Some(v) => {
let vv = serde_json::from_value::<String>(v).map_err(|e| api::core::models::Error {
code: -1,
msg: Some(format!("serde_json::from_value error: {}", e)),
})?;
Some(vv)
}
None => None,
};
new_betting_history.push(repositories::betting_history::models::NewBettingHistory { new_betting_history.push(repositories::betting_history::models::NewBettingHistory {
id: b._id, id: b._id,