11
This commit is contained in:
@@ -19,6 +19,7 @@ pub struct SoftwareInfo {
|
||||
pub software_name: String,
|
||||
pub logo_url: Option<String>,
|
||||
pub wechat: Option<String>,
|
||||
pub wechat_qrcode_url: Option<String>,
|
||||
}
|
||||
|
||||
fn empty_info(oem_id: i64) -> SoftwareInfo {
|
||||
@@ -27,6 +28,7 @@ fn empty_info(oem_id: i64) -> SoftwareInfo {
|
||||
software_name: String::new(),
|
||||
logo_url: None,
|
||||
wechat: None,
|
||||
wechat_qrcode_url: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +54,11 @@ fn parse_software_info(oem_id: i64, value: &Value) -> SoftwareInfo {
|
||||
.and_then(|v| v.as_str())
|
||||
.filter(|s| !s.is_empty())
|
||||
.map(str::to_string),
|
||||
wechat_qrcode_url: data
|
||||
.get("wechat_qrcode_url")
|
||||
.and_then(|v| v.as_str())
|
||||
.filter(|s| !s.is_empty())
|
||||
.map(str::to_string),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user