bug fixed
This commit is contained in:
parent
496c22af81
commit
3a203ad2db
|
@ -31,8 +31,7 @@ openssl = { version = "0", features = ["vendored"] }
|
|||
prost = { version = "0" }
|
||||
reqwest = { version = "0", features = ["json"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_bytes = { version = "0" }
|
||||
serde_json = { version = "1" }
|
||||
serde_json = { version = "1", features = ["raw_value"] }
|
||||
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
||||
tokio-cron-scheduler = { version = "0" }
|
||||
uuid = { version = "0", features = ["serde", "v4", "v5"] }
|
||||
|
|
|
@ -36,8 +36,7 @@ pub struct Betting {
|
|||
#[serde(rename = "groupKey")]
|
||||
pub group_key: Option<String>,
|
||||
/// 게임 데이터
|
||||
#[serde(with = "serde_bytes")]
|
||||
pub detail: Option<Vec<u8>>,
|
||||
pub detail: Option<serde_json::value::Value>,
|
||||
/// 보너스 여부
|
||||
#[serde(rename = "isBonus")]
|
||||
pub is_bonus: bool,
|
||||
|
|
|
@ -70,15 +70,7 @@ impl Api {
|
|||
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) => match std::str::from_utf8(v.as_slice()) {
|
||||
Ok(v) => Some(v.to_string()),
|
||||
Err(e) => {
|
||||
return Err(Error {
|
||||
code: -1,
|
||||
msg: Some(e.to_string()),
|
||||
});
|
||||
}
|
||||
},
|
||||
Some(v) => v.as_str().map(|ss| ss.to_string()),
|
||||
None => None,
|
||||
};
|
||||
|
||||
|
|
|
@ -13,8 +13,7 @@ pub struct _GetBalanceForUserResponse {
|
|||
pub balance_bota: Option<f64>,
|
||||
#[serde(rename = "balanceSum")]
|
||||
pub balance_sum: Option<f64>,
|
||||
#[serde(with = "serde_bytes")]
|
||||
pub companies: Option<Vec<u8>>,
|
||||
pub companies: Option<serde_json::value::Value>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
|
@ -138,15 +138,7 @@ impl Synchronizer {
|
|||
}
|
||||
};
|
||||
let detail = match b.detail {
|
||||
Some(v) => match std::str::from_utf8(v.as_slice()) {
|
||||
Ok(v) => Some(v.to_string()),
|
||||
Err(e) => {
|
||||
return Err(api::core::models::Error {
|
||||
code: -1,
|
||||
msg: Some(format!("std::str::from_utf8 error: {}", e)),
|
||||
});
|
||||
}
|
||||
},
|
||||
Some(v) => v.as_str().map(|ss| ss.to_string()),
|
||||
None => None,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user