From 59961129c5069eac3ae6f18a42998571d03b6a06 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 12 Jul 2020 14:32:18 +0200 Subject: [PATCH] Ready to implement new method --- src/controllers/mod.rs | 1 + src/controllers/routes.rs | 6 +++++- src/controllers/web_app_controller.rs | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/controllers/web_app_controller.rs diff --git a/src/controllers/mod.rs b/src/controllers/mod.rs index 8e79236..0022e03 100644 --- a/src/controllers/mod.rs +++ b/src/controllers/mod.rs @@ -15,3 +15,4 @@ pub mod surveys_controller; pub mod notifications_controller; pub mod movies_controller; pub mod virtual_directory_controller; +pub mod web_app_controller; \ No newline at end of file diff --git a/src/controllers/routes.rs b/src/controllers/routes.rs index 78bb145..5f8f829 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -1,6 +1,6 @@ use std::error::Error; -use crate::controllers::{account_controller, comments_controller, conversations_controller, friends_controller, groups_controller, likes_controller, movies_controller, notifications_controller, posts_controller, search_controller, server_controller, surveys_controller, user_controller, virtual_directory_controller}; +use crate::controllers::{account_controller, comments_controller, conversations_controller, friends_controller, groups_controller, likes_controller, movies_controller, notifications_controller, posts_controller, search_controller, server_controller, surveys_controller, user_controller, virtual_directory_controller, web_app_controller}; use crate::controllers::routes::Method::{GET, POST}; use crate::data::http_request_handler::HttpRequestHandler; @@ -266,5 +266,9 @@ pub fn get_routes() -> Vec { Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)), Route::post("/virtualDirectory/find", Box::new(virtual_directory_controller::find)), + + + // Web application controller + Route::post("/webApp/getMemberships", Box::new(web_app_controller::get_memberships)), ] } \ No newline at end of file diff --git a/src/controllers/web_app_controller.rs b/src/controllers/web_app_controller.rs new file mode 100644 index 0000000..915bfa1 --- /dev/null +++ b/src/controllers/web_app_controller.rs @@ -0,0 +1,11 @@ +//! # Web application controller +//! +//! @author Pierre Hubert + +use crate::controllers::routes::RequestResult; +use crate::data::http_request_handler::HttpRequestHandler; + +/// Get the list of memberships of a given user +pub fn get_memberships(r: &mut HttpRequestHandler) -> RequestResult { + r.success("Implement me") +} \ No newline at end of file