More changes. Not functional yet
This commit is contained in:
@@ -2,24 +2,31 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::models;
|
||||
|
||||
// mod managers {
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct UserManager {
|
||||
user: models::user::User,
|
||||
ica_action: models::icarus_action::IcarusAction,
|
||||
pub user: models::user::User,
|
||||
pub ica_action: models::icarus_action::IcarusAction,
|
||||
}
|
||||
|
||||
impl UserManager {
|
||||
// TODO: Implement
|
||||
pub fn retrieve_user(&self) -> models::user::User {
|
||||
return models::user::User {
|
||||
username: String::from(""),
|
||||
password: String::from(""),
|
||||
};
|
||||
return self.user.clone();
|
||||
}
|
||||
|
||||
// TODO: Implement
|
||||
fn parse_user_from_actions(&self) {}
|
||||
pub fn parse_user_from_actions(&mut self) {
|
||||
let args = &self.ica_action.flags;
|
||||
|
||||
for arg in args {
|
||||
let flag = &arg.flag;
|
||||
|
||||
if flag == "-u" {
|
||||
self.user.username = String::from(&arg.value);
|
||||
}
|
||||
|
||||
if flag == "-p" {
|
||||
self.user.password = String::from(&arg.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user