From e52e86fc4342f8687c5004e42bbb028f70f452be Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 1 Jun 2020 17:17:18 +0200 Subject: [PATCH] Ready to implement new method --- src/controllers/mod.rs | 3 ++- src/controllers/routes.rs | 6 +++++- src/controllers/virtual_directory_controller.rs | 11 +++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 src/controllers/virtual_directory_controller.rs diff --git a/src/controllers/mod.rs b/src/controllers/mod.rs index 232d0b0..d78da64 100644 --- a/src/controllers/mod.rs +++ b/src/controllers/mod.rs @@ -3,4 +3,5 @@ pub mod server; pub mod server_controller; pub mod account_controller; -pub mod user_controller; \ No newline at end of file +pub mod user_controller; +pub mod virtual_directory_controller; \ No newline at end of file diff --git a/src/controllers/routes.rs b/src/controllers/routes.rs index 105ee94..7af6979 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -1,7 +1,7 @@ use std::error::Error; use crate::controllers::routes::Method::{GET, POST}; -use crate::controllers::{server_controller, account_controller, user_controller}; +use crate::controllers::{server_controller, account_controller, user_controller, virtual_directory_controller}; use crate::data::http_request_handler::HttpRequestHandler; /// Project routes @@ -87,5 +87,9 @@ pub fn get_routes() -> Vec { Route::post_without_login("/user/getAdvancedUserInfo", Box::new(user_controller::get_advanced_info)), Route::post_without_login("/user/getAdvancedUserInfos", Box::new(user_controller::get_advanced_info)), + + + // Virtual directory controller + Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)), ] } \ No newline at end of file diff --git a/src/controllers/virtual_directory_controller.rs b/src/controllers/virtual_directory_controller.rs new file mode 100644 index 0000000..816e786 --- /dev/null +++ b/src/controllers/virtual_directory_controller.rs @@ -0,0 +1,11 @@ +//! # Virtual directory controller +//! +//! @author Pierre Hubert + +use crate::data::http_request_handler::HttpRequestHandler; +use crate::controllers::routes::RequestResult; + +/// Find a user by its virtual directory +pub fn find_user(r: &mut HttpRequestHandler) -> RequestResult { + r.success("implement it") +} \ No newline at end of file