Add as single line string for MenuToppingList
Signed-off-by: Pakin <pakin.t@forth.co.th>
This commit is contained in:
parent
0dea2e47ad
commit
1c4dea7b27
1 changed files with 22 additions and 0 deletions
|
|
@ -1932,6 +1932,28 @@ pub struct MenuToppingList {
|
||||||
// pub extra: std::collections::HashMap<String, Value>,
|
// pub extra: std::collections::HashMap<String, Value>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl MenuToppingList {
|
||||||
|
pub fn to_single_line(&mut self) -> String {
|
||||||
|
format!(
|
||||||
|
"#__ListGroupID={:?},defaultIDSelect={},groupID={},isUse={}",
|
||||||
|
self.ListGroupID
|
||||||
|
.clone()
|
||||||
|
.unwrap_or_default()
|
||||||
|
.iter()
|
||||||
|
.map(|gid| gid.as_i64().unwrap().to_string())
|
||||||
|
.collect::<Vec<String>>(),
|
||||||
|
self.defaultIDSelect.as_i64().unwrap(),
|
||||||
|
self.groupID
|
||||||
|
.clone()
|
||||||
|
.unwrap_or_default()
|
||||||
|
.as_str()
|
||||||
|
.unwrap()
|
||||||
|
.to_string(),
|
||||||
|
self.isUse
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The `Topping` struct represents a collection of topping groups and topping lists.
|
/// The `Topping` struct represents a collection of topping groups and topping lists.
|
||||||
///
|
///
|
||||||
/// Properties:
|
/// Properties:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue