From d38e2ee4ab59aa2dd5b140b83c39a11c7995e44e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 23 Jun 2020 19:04:32 +0200 Subject: [PATCH] Ready to create new groups --- src/controllers/groups_controller.rs | 11 +++++++++++ src/controllers/mod.rs | 1 + src/controllers/routes.rs | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/controllers/groups_controller.rs diff --git a/src/controllers/groups_controller.rs b/src/controllers/groups_controller.rs new file mode 100644 index 0000000..61c3c2c --- /dev/null +++ b/src/controllers/groups_controller.rs @@ -0,0 +1,11 @@ +//! # Groups controller +//! +//! @author Pierre Hubert + +use crate::controllers::routes::RequestResult; +use crate::data::http_request_handler::HttpRequestHandler; + +/// Create a new group +pub fn create(r: &mut HttpRequestHandler) -> RequestResult { + r.success("implement me") +} \ No newline at end of file diff --git a/src/controllers/mod.rs b/src/controllers/mod.rs index 9a2b282..ed5300a 100644 --- a/src/controllers/mod.rs +++ b/src/controllers/mod.rs @@ -6,4 +6,5 @@ pub mod account_controller; pub mod user_controller; pub mod conversations_controller; pub mod search_controller; +pub mod groups_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 7a50370..57ee9d2 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -1,6 +1,6 @@ use std::error::Error; -use crate::controllers::{account_controller, conversations_controller, search_controller, server_controller, user_controller, virtual_directory_controller}; +use crate::controllers::{account_controller, conversations_controller, search_controller, server_controller, user_controller, virtual_directory_controller, groups_controller}; use crate::controllers::routes::Method::{GET, POST}; use crate::data::http_request_handler::HttpRequestHandler; @@ -127,6 +127,10 @@ pub fn get_routes() -> Vec { Route::post("/search/global", Box::new(search_controller::search_global)), + // Groups controller + Route::post("/groups/create", Box::new(groups_controller::create)), + + // Virtual directory controller Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)),