This commit is contained in:
fengchuanhn@gmail.com
2026-05-21 02:40:08 +08:00
parent 14cf9b7bf5
commit 426a69cd69
14 changed files with 754 additions and 45 deletions

View File

@@ -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),
}
}