aboutsummaryrefslogtreecommitdiff
path: root/src/routers/queue.rs
diff options
context:
space:
mode:
authorTolmachev Igor <me@igorek.dev>2025-09-25 14:01:41 +0300
committerTolmachev Igor <me@igorek.dev>2025-09-25 14:01:41 +0300
commit493fe44b23d3f4c3f271278b5137f4968cba036c (patch)
tree21826e2e7e0b09e8d7eea2749c9e1ad6e9434803 /src/routers/queue.rs
parent6c91e53be0e1fa75b1f1569353f18a2ffb182686 (diff)
downloadqueue_server-493fe44b23d3f4c3f271278b5137f4968cba036c.tar.gz
queue_server-493fe44b23d3f4c3f271278b5137f4968cba036c.zip
Fix grammar
Diffstat (limited to 'src/routers/queue.rs')
-rw-r--r--src/routers/queue.rs24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/routers/queue.rs b/src/routers/queue.rs
index 1e93b2a..df846fb 100644
--- a/src/routers/queue.rs
+++ b/src/routers/queue.rs
@@ -32,12 +32,14 @@ async fn get_owned_queue(
32} 32}
33 33
34#[derive(Deserialize, ToSchema)] 34#[derive(Deserialize, ToSchema)]
35#[schema(description = "Body of the create queue request")]
35struct CreateQueueRequest { 36struct CreateQueueRequest {
36 #[schema(examples("John's queue", "Очередь Ивана"))] 37 #[schema(examples("John's queue", "Очередь Ивана"))]
37 name: String, 38 name: String,
38} 39}
39 40
40#[derive(Deserialize, ToSchema)] 41#[derive(Deserialize, ToSchema)]
42#[schema(description = "Body of the change queue name request")]
41struct ChangeQueueNameRequest { 43struct ChangeQueueNameRequest {
42 #[schema(examples(1))] 44 #[schema(examples(1))]
43 id: i64, 45 id: i64,
@@ -46,7 +48,8 @@ struct ChangeQueueNameRequest {
46} 48}
47 49
48#[derive(Deserialize, ToSchema)] 50#[derive(Deserialize, ToSchema)]
49struct ChangeQueueOwnerRequest { 51#[schema(description = "Body of the change queue ownership request")]
52struct ChangeQueueOwnershipRequest {
50 #[schema(examples(1))] 53 #[schema(examples(1))]
51 id: i64, 54 id: i64,
52 #[schema(examples(1))] 55 #[schema(examples(1))]
@@ -54,6 +57,7 @@ struct ChangeQueueOwnerRequest {
54} 57}
55 58
56#[derive(Deserialize, ToSchema)] 59#[derive(Deserialize, ToSchema)]
60#[schema(description = "Body of the delete queue request")]
57struct DeleteQueueRequest { 61struct DeleteQueueRequest {
58 #[schema(examples(1))] 62 #[schema(examples(1))]
59 id: i64, 63 id: i64,
@@ -64,7 +68,7 @@ struct DeleteQueueRequest {
64 path = "/owned", 68 path = "/owned",
65 tag = QUEUE, 69 tag = QUEUE,
66 summary = "Get owned", 70 summary = "Get owned",
67 description = "Get your own queues", 71 description = "Get your queues",
68 responses( 72 responses(
69 ( 73 (
70 status = 200, body = SuccessResponse<Vec<Queue>>, 74 status = 200, body = SuccessResponse<Vec<Queue>>,
@@ -96,7 +100,7 @@ async fn owned(State(state): State<AppState>, Auth(user): Auth) -> ApiResult<Vec
96 responses( 100 responses(
97 ( 101 (
98 status = 200, body = SuccessResponse<Queue>, 102 status = 200, body = SuccessResponse<Queue>,
99 description = "Success response with created queue" 103 description = "Success response with the created queue"
100 ), 104 ),
101 GlobalResponses 105 GlobalResponses
102 ), 106 ),
@@ -129,7 +133,7 @@ async fn create(
129 responses( 133 responses(
130 ( 134 (
131 status = 200, body = SuccessResponse<Queue>, 135 status = 200, body = SuccessResponse<Queue>,
132 description = "Success response with changed queue data" 136 description = "Success response with the changed queue data"
133 ), 137 ),
134 GlobalResponses 138 GlobalResponses
135 ), 139 ),
@@ -155,12 +159,12 @@ async fn change_name(
155 path = "/change/owner", 159 path = "/change/owner",
156 tag = QUEUE, 160 tag = QUEUE,
157 summary = "Change owner", 161 summary = "Change owner",
158 description = "Transfer ownership of the queue", 162 description = "Reassign queue ownership",
159 request_body = ChangeQueueOwnerRequest, 163 request_body = ChangeQueueOwnershipRequest,
160 responses( 164 responses(
161 ( 165 (
162 status = 200, body = SuccessResponse<Queue>, 166 status = 200, body = SuccessResponse<Queue>,
163 description = "Success response with changed queue data" 167 description = "Success response with the changed queue data"
164 ), 168 ),
165 GlobalResponses 169 GlobalResponses
166 ), 170 ),
@@ -169,7 +173,7 @@ async fn change_name(
169async fn change_owner( 173async fn change_owner(
170 State(state): State<AppState>, 174 State(state): State<AppState>,
171 Auth(user): Auth, 175 Auth(user): Auth,
172 ApiJson(req): ApiJson<ChangeQueueOwnerRequest>, 176 ApiJson(req): ApiJson<ChangeQueueOwnershipRequest>,
173) -> ApiResult<Queue> { 177) -> ApiResult<Queue> {
174 if !user_exists(req.new_owner_id, &state.db).await? { 178 if !user_exists(req.new_owner_id, &state.db).await? {
175 return Err(ClientError::UserNotFound { 179 return Err(ClientError::UserNotFound {
@@ -193,12 +197,12 @@ async fn change_owner(
193 path = "/delete", 197 path = "/delete",
194 tag = QUEUE, 198 tag = QUEUE,
195 summary = "Delete", 199 summary = "Delete",
196 description = "Delete queue", 200 description = "Delete the queue",
197 request_body = DeleteQueueRequest, 201 request_body = DeleteQueueRequest,
198 responses( 202 responses(
199 ( 203 (
200 status = 200, body = SuccessResponse<Queue>, 204 status = 200, body = SuccessResponse<Queue>,
201 description = "Success response with deleted queue data" 205 description = "Success response with the deleted queue data"
202 ), 206 ),
203 GlobalResponses 207 GlobalResponses
204 ), 208 ),