From 693ce6780612c2015a594c8610fee231bd33cbb6 Mon Sep 17 00:00:00 2001 From: Mika Date: Wed, 2 Apr 2025 14:30:57 +0200 Subject: [PATCH] added more endpoints for todo --- crates/backend/src/controller.rs | 1 + crates/backend/src/controller/class.rs | 21 +++++++++++++++++++++ crates/backend/src/controller/group.rs | 2 +- crates/backend/src/controller/template.rs | 5 +++++ crates/backend/src/controller/user.rs | 5 +++++ 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 crates/backend/src/controller/class.rs diff --git a/crates/backend/src/controller.rs b/crates/backend/src/controller.rs index ec2ef9b..a129913 100644 --- a/crates/backend/src/controller.rs +++ b/crates/backend/src/controller.rs @@ -1,5 +1,6 @@ use actix_web::web::{self, ServiceConfig}; +mod class; mod group; mod project; mod template; diff --git a/crates/backend/src/controller/class.rs b/crates/backend/src/controller/class.rs new file mode 100644 index 0000000..ad7448a --- /dev/null +++ b/crates/backend/src/controller/class.rs @@ -0,0 +1,21 @@ +use actix_web::{Responder, delete, get, post}; + +#[get("")] +async fn get_classes() -> impl Responder { + "" +} + +#[get("/{id}")] +async fn get_class() -> impl Responder { + "" +} + +#[post("")] +async fn create_class() -> impl Responder { + "" +} + +#[delete("/{id}")] +async fn delete_class() -> impl Responder { + "" +} diff --git a/crates/backend/src/controller/group.rs b/crates/backend/src/controller/group.rs index 36a378c..3bda7e3 100644 --- a/crates/backend/src/controller/group.rs +++ b/crates/backend/src/controller/group.rs @@ -6,7 +6,7 @@ async fn get_groups() -> impl Responder { } #[get("/{project}")] -async fn get_projects_for_project() -> impl Responder { +async fn get_groups_for_project() -> impl Responder { "" } diff --git a/crates/backend/src/controller/template.rs b/crates/backend/src/controller/template.rs index f1ecb8a..a0e5ea3 100644 --- a/crates/backend/src/controller/template.rs +++ b/crates/backend/src/controller/template.rs @@ -5,6 +5,11 @@ async fn get_templates() -> impl Responder { "" } +#[get("/{id}")] +async fn get_template() -> impl Responder { + "" +} + #[post("")] async fn create_template() -> impl Responder { "" diff --git a/crates/backend/src/controller/user.rs b/crates/backend/src/controller/user.rs index 16b6cf2..46902b8 100644 --- a/crates/backend/src/controller/user.rs +++ b/crates/backend/src/controller/user.rs @@ -5,6 +5,11 @@ async fn get_users() -> impl Responder { "" } +#[get("/{id}")] +async fn get_class() -> impl Responder { + "" +} + #[post("")] async fn create_user() -> impl Responder { ""