feat: add price handler, commit, push, pull
- price handler for getting or editing price (only applied to main profile) - routine pull sync recipe repo & backup commit recover Signed-off-by: Pakin <pakin.t@forth.co.th>
This commit is contained in:
parent
ab84060ab5
commit
0f857445a4
Notes:
pakin
2026-05-05 20:35:20 +07:00
feat: commit - not support multiple files yet feat: routine backup commit flush - not support order of commit yet, this may results in random commit
9 changed files with 610 additions and 23 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use super::model::*;
|
||||
use axum::extract::ws::{CloseFrame, Message, WebSocket};
|
||||
use redis::{TypedCommands, cmd};
|
||||
|
|
@ -64,3 +66,21 @@ pub fn convert_sys_msg_command(msg: &serde_json::Value) -> Option<SysMessage> {
|
|||
Err(_) => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_extra_parameters(s: String) -> HashMap<String, String> {
|
||||
let mut result = HashMap::new();
|
||||
|
||||
let plist: Vec<String> = s.split(",").map(|x| x.to_string()).collect();
|
||||
|
||||
for pl in plist {
|
||||
let sm: Vec<String> = pl.split("=").map(|x| x.to_string()).collect();
|
||||
|
||||
if sm.len() != 2 {
|
||||
continue;
|
||||
}
|
||||
|
||||
result.insert(sm[0].to_string(), sm[1].to_string());
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue