Gave control to documents service.

This commit is contained in:
2025-04-26 10:29:58 -04:00
parent 55ffa538e8
commit 1bfbfc5e44
4 changed files with 65 additions and 37 deletions

View File

@ -73,7 +73,7 @@ mod mtt_replies {
let reply = MTTReply::new(msg);
match reply.get_error() {
Some(err) => match err {
ErrorType::DocumentNotFound => {},
ErrorType::DocumentNotFound => {}
},
None => unreachable!("should return an error type"),
}
@ -94,7 +94,7 @@ mod mtt_replies {
let reply = MTTReply::new(msg);
match reply.get_error() {
Some(err) => match err {
ErrorType::DocumentNotFound => {},
ErrorType::DocumentNotFound => {}
},
None => unreachable!("should return an error type"),
}
@ -131,7 +131,10 @@ impl MoreThanText {
reply.get_data("sess_id").unwrap().to_uuid().unwrap()
}
pub fn get_document<S>(&self, sess_id: Uuid, action: ActionType, doc_name: S) -> MTTReply where S: Into<String> {
pub fn get_document<S>(&self, sess_id: Uuid, action: ActionType, doc_name: S) -> MTTReply
where
S: Into<String>,
{
let mut msg = Message::new(MsgType::DocumentRequest);
msg.add_data("sess_id", sess_id);
msg.add_data("name", doc_name.into());
@ -180,6 +183,5 @@ mod mtt {
let id = mtt.validate_session(Some(Uuid::new_v4()));
let output = mtt.get_document(id, ActionType::Get, "root".to_string());
assert!(output.get_error().is_none());
}
}