From f4c9192b9cc2f08c38822ed477a48dd7599238d6 Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Fri, 26 Sep 2025 22:51:14 +0300 Subject: Add the queue access router --- src/routers/queue/access.rs | 7 +++++++ src/routers/queue/manage.rs | 14 +++++++------- src/routers/queue/mod.rs | 5 ++++- 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 src/routers/queue/access.rs (limited to 'src/routers/queue') diff --git a/src/routers/queue/access.rs b/src/routers/queue/access.rs new file mode 100644 index 0000000..1cba0b1 --- /dev/null +++ b/src/routers/queue/access.rs @@ -0,0 +1,7 @@ +use utoipa_axum::router::OpenApiRouter; + +use crate::AppState; + +pub fn router() -> OpenApiRouter { + OpenApiRouter::new() +} diff --git a/src/routers/queue/manage.rs b/src/routers/queue/manage.rs index 67a3abc..8f42e07 100644 --- a/src/routers/queue/manage.rs +++ b/src/routers/queue/manage.rs @@ -12,7 +12,7 @@ use crate::{ ApiError, ApiResult, AppState, ClientError, GlobalResponses, SuccessResponse, extract::{ApiJson, ApiQuery, Auth}, models::Queue, - tags::QUEUE_MANAGEMENT, + tags::QUEUE, }; async fn user_exists(id: i64, db: &DatabaseConnection) -> Result { @@ -83,7 +83,7 @@ struct DeleteQueueRequest { #[utoipa::path( get, path = "/get/id", - tag = QUEUE_MANAGEMENT, + tag = QUEUE, summary = "Get by id", description = "Get the queue by id", params(GetByIdQueueQuery), @@ -110,7 +110,7 @@ async fn get_by_id( #[utoipa::path( get, path = "/get/owner", - tag = QUEUE_MANAGEMENT, + tag = QUEUE, summary = "Get by owner", description = "Get queues for a given owner", params(GetByOwnerIdQuery), @@ -140,7 +140,7 @@ async fn get_by_owner( #[utoipa::path( post, path = "/create", - tag = QUEUE_MANAGEMENT, + tag = QUEUE, summary = "Create", description = "Create a new queue", request_body = CreateQueueRequest, @@ -173,7 +173,7 @@ async fn create( #[utoipa::path( put, path = "/update/name", - tag = QUEUE_MANAGEMENT, + tag = QUEUE, summary = "Change name", description = "Change queue name", request_body = ChangeQueueNameRequest, @@ -204,7 +204,7 @@ async fn update_name( #[utoipa::path( put, path = "/update/owner", - tag = QUEUE_MANAGEMENT, + tag = QUEUE, summary = "Change owner", description = "Reassign queue ownership", request_body = ChangeQueueOwnershipRequest, @@ -242,7 +242,7 @@ async fn update_owner( #[utoipa::path( delete, path = "/delete", - tag = QUEUE_MANAGEMENT, + tag = QUEUE, summary = "Delete", description = "Delete the queue", request_body = DeleteQueueRequest, diff --git a/src/routers/queue/mod.rs b/src/routers/queue/mod.rs index bf2acb5..dd03956 100644 --- a/src/routers/queue/mod.rs +++ b/src/routers/queue/mod.rs @@ -1,3 +1,4 @@ +mod access; mod manage; use utoipa_axum::router::OpenApiRouter; @@ -5,5 +6,7 @@ use utoipa_axum::router::OpenApiRouter; use crate::AppState; pub fn router() -> OpenApiRouter { - OpenApiRouter::new().merge(manage::router()) + OpenApiRouter::new() + .merge(manage::router()) + .merge(access::router()) } -- cgit v1.2.3