aboutsummaryrefslogtreecommitdiff
path: root/src/routers/queue
diff options
context:
space:
mode:
Diffstat (limited to 'src/routers/queue')
-rw-r--r--src/routers/queue/access.rs7
-rw-r--r--src/routers/queue/manage.rs14
-rw-r--r--src/routers/queue/mod.rs5
3 files changed, 18 insertions, 8 deletions
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 @@
1use utoipa_axum::router::OpenApiRouter;
2
3use crate::AppState;
4
5pub fn router() -> OpenApiRouter<AppState> {
6 OpenApiRouter::new()
7}
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::{
12 ApiError, ApiResult, AppState, ClientError, GlobalResponses, SuccessResponse, 12 ApiError, ApiResult, AppState, ClientError, GlobalResponses, SuccessResponse,
13 extract::{ApiJson, ApiQuery, Auth}, 13 extract::{ApiJson, ApiQuery, Auth},
14 models::Queue, 14 models::Queue,
15 tags::QUEUE_MANAGEMENT, 15 tags::QUEUE,
16}; 16};
17 17
18async fn user_exists(id: i64, db: &DatabaseConnection) -> Result<bool, ApiError> { 18async fn user_exists(id: i64, db: &DatabaseConnection) -> Result<bool, ApiError> {
@@ -83,7 +83,7 @@ struct DeleteQueueRequest {
83#[utoipa::path( 83#[utoipa::path(
84 get, 84 get,
85 path = "/get/id", 85 path = "/get/id",
86 tag = QUEUE_MANAGEMENT, 86 tag = QUEUE,
87 summary = "Get by id", 87 summary = "Get by id",
88 description = "Get the queue by id", 88 description = "Get the queue by id",
89 params(GetByIdQueueQuery), 89 params(GetByIdQueueQuery),
@@ -110,7 +110,7 @@ async fn get_by_id(
110#[utoipa::path( 110#[utoipa::path(
111 get, 111 get,
112 path = "/get/owner", 112 path = "/get/owner",
113 tag = QUEUE_MANAGEMENT, 113 tag = QUEUE,
114 summary = "Get by owner", 114 summary = "Get by owner",
115 description = "Get queues for a given owner", 115 description = "Get queues for a given owner",
116 params(GetByOwnerIdQuery), 116 params(GetByOwnerIdQuery),
@@ -140,7 +140,7 @@ async fn get_by_owner(
140#[utoipa::path( 140#[utoipa::path(
141 post, 141 post,
142 path = "/create", 142 path = "/create",
143 tag = QUEUE_MANAGEMENT, 143 tag = QUEUE,
144 summary = "Create", 144 summary = "Create",
145 description = "Create a new queue", 145 description = "Create a new queue",
146 request_body = CreateQueueRequest, 146 request_body = CreateQueueRequest,
@@ -173,7 +173,7 @@ async fn create(
173#[utoipa::path( 173#[utoipa::path(
174 put, 174 put,
175 path = "/update/name", 175 path = "/update/name",
176 tag = QUEUE_MANAGEMENT, 176 tag = QUEUE,
177 summary = "Change name", 177 summary = "Change name",
178 description = "Change queue name", 178 description = "Change queue name",
179 request_body = ChangeQueueNameRequest, 179 request_body = ChangeQueueNameRequest,
@@ -204,7 +204,7 @@ async fn update_name(
204#[utoipa::path( 204#[utoipa::path(
205 put, 205 put,
206 path = "/update/owner", 206 path = "/update/owner",
207 tag = QUEUE_MANAGEMENT, 207 tag = QUEUE,
208 summary = "Change owner", 208 summary = "Change owner",
209 description = "Reassign queue ownership", 209 description = "Reassign queue ownership",
210 request_body = ChangeQueueOwnershipRequest, 210 request_body = ChangeQueueOwnershipRequest,
@@ -242,7 +242,7 @@ async fn update_owner(
242#[utoipa::path( 242#[utoipa::path(
243 delete, 243 delete,
244 path = "/delete", 244 path = "/delete",
245 tag = QUEUE_MANAGEMENT, 245 tag = QUEUE,
246 summary = "Delete", 246 summary = "Delete",
247 description = "Delete the queue", 247 description = "Delete the queue",
248 request_body = DeleteQueueRequest, 248 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 @@
1mod access;
1mod manage; 2mod manage;
2 3
3use utoipa_axum::router::OpenApiRouter; 4use utoipa_axum::router::OpenApiRouter;
@@ -5,5 +6,7 @@ use utoipa_axum::router::OpenApiRouter;
5use crate::AppState; 6use crate::AppState;
6 7
7pub fn router() -> OpenApiRouter<AppState> { 8pub fn router() -> OpenApiRouter<AppState> {
8 OpenApiRouter::new().merge(manage::router()) 9 OpenApiRouter::new()
10 .merge(manage::router())
11 .merge(access::router())
9} 12}