1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-22 13:29:21 +00:00

Start to create report route

This commit is contained in:
Pierre HUBERT 2022-03-16 19:33:28 +01:00
parent 0eebfbe98a
commit 98e267f7e7
3 changed files with 20 additions and 1 deletions

View File

@ -20,4 +20,5 @@ pub mod web_app_controller;
pub mod calls_controller;
pub mod user_ws_actions;
pub mod push_notifications_controller;
pub mod report_controller;
pub mod forez_controller;

View File

@ -0,0 +1,15 @@
use crate::data::base_request_handler::BaseRequestHandler;
use crate::data::config::conf;
use crate::data::http_request_handler::HttpRequestHandler;
use crate::routes::RequestResult;
/// Submit a new report
pub async fn report(r: &mut HttpRequestHandler) -> RequestResult {
if !conf().allow_reporting {
r.bad_request("Reporting is disabled!".to_string())?;
}
// TODO : continue
r.success("go on")
}

View File

@ -440,6 +440,9 @@ pub async fn find_route(req_uri: &str, call: Option<&mut HttpRequestHandler>) ->
// Web application controller
route!(req_uri, call, POST_LOGIN, "/webApp/getMemberships", web_app_controller::get_memberships);
// Report controller
route!(req_uri, call, LTD_POST_LOGIN, "/report/create", report_controller::report, LimitPolicy::ANY(10));
// Forez controller
route!(req_uri, call, POST_LOGIN, "/forez/get_groups", forez_controller::get_list_groups);
route!(req_uri, call, POST_LOGIN, "/forez/get_member_info", forez_controller::get_member_info);