2025-01-26 04:39:11 +03:00
|
|
|
pub mod contact;
|
2025-01-27 17:17:13 +03:00
|
|
|
pub mod interaction;
|
|
|
|
pub mod login;
|
2025-01-25 23:50:45 +03:00
|
|
|
pub mod role;
|
|
|
|
pub mod user;
|
2025-01-26 04:39:11 +03:00
|
|
|
pub mod user_contact;
|
2025-01-25 23:50:45 +03:00
|
|
|
|
|
|
|
use axum::Router;
|
|
|
|
|
2025-01-26 04:39:11 +03:00
|
|
|
use super::middleware::builder_or_admin_by_authorization_token;
|
2025-01-25 23:50:45 +03:00
|
|
|
|
|
|
|
pub fn route() -> Router {
|
|
|
|
Router::new()
|
2025-01-27 17:17:13 +03:00
|
|
|
.nest("/logins", login::route())
|
2025-01-25 23:50:45 +03:00
|
|
|
.nest("/users", user::route())
|
|
|
|
.nest("/roles", role::route())
|
2025-01-26 04:39:11 +03:00
|
|
|
.nest("/contacts", contact::route())
|
|
|
|
.nest("/user_contacts", user_contact::route())
|
2025-01-27 17:17:13 +03:00
|
|
|
.nest("/interactions", interaction::route())
|
2025-01-25 23:50:45 +03:00
|
|
|
.route_layer(axum::middleware::from_fn(
|
2025-01-26 04:39:11 +03:00
|
|
|
builder_or_admin_by_authorization_token,
|
2025-01-25 23:50:45 +03:00
|
|
|
))
|
|
|
|
}
|