From 7adbf6332ad148db16b3ff36cc6e405a6538d1e8 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Tue, 19 Aug 2025 12:52:27 -0400 Subject: [PATCH 01/13] tsk-170: Added utopia crates for API documentation --- Cargo.lock | 174 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 + 2 files changed, 176 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 7524b89..40081ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,6 +38,15 @@ version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "atoi" version = "2.0.0" @@ -378,6 +387,17 @@ dependencies = [ "serde", ] +[[package]] +name = "derive_arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.10.7" @@ -476,6 +496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", + "libz-rs-sys", "miniz_oxide", ] @@ -844,6 +865,8 @@ dependencies = [ "tower-http", "tracing-subscriber", "url", + "utoipa", + "utoipa-swagger-ui", "uuid", ] @@ -992,6 +1015,7 @@ checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown", + "serde", ] [[package]] @@ -1073,6 +1097,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "libz-rs-sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "172a788537a2221661b480fee8dc5f96c580eb34fa88764d3205dc356c7e4221" +dependencies = [ + "zlib-rs", +] + [[package]] name = "linux-raw-sys" version = "0.9.4" @@ -1644,6 +1677,40 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rust-embed" +version = "8.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "025908b8682a26ba8d12f6f2d66b987584a4a87bc024abc5bbc12553a8cd178a" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "8.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6065f1a4392b71819ec1ea1df1120673418bf386f50de1d6f54204d836d4349c" +dependencies = [ + "proc-macro2", + "quote", + "rust-embed-utils", + "syn", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "8.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6cc0c81648b20b70c491ff8cce00c1c3b223bb8ed2b5d41f0e54c6c4c0a3594" +dependencies = [ + "sha2", + "walkdir", +] + [[package]] name = "rustc-demangle" version = "0.1.25" @@ -1675,6 +1742,15 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.27" @@ -1824,6 +1900,12 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simple_asn1" version = "0.6.3" @@ -2473,6 +2555,47 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "utoipa" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fcc29c80c21c31608227e0912b2d7fddba57ad76b606890627ba8ee7964e993" +dependencies = [ + "indexmap", + "serde", + "serde_json", + "utoipa-gen", +] + +[[package]] +name = "utoipa-gen" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d79d08d92ab8af4c5e8a6da20c47ae3f61a0f1dabc1997cdf2d082b757ca08b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "utoipa-swagger-ui" +version = "9.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d047458f1b5b65237c2f6dc6db136945667f40a7668627b3490b9513a3d43a55" +dependencies = [ + "axum", + "base64 0.22.1", + "mime_guess", + "regex", + "rust-embed", + "serde", + "serde_json", + "url", + "utoipa", + "zip", +] + [[package]] name = "uuid" version = "1.17.0" @@ -2503,6 +2626,16 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -2608,6 +2741,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2953,3 +3095,35 @@ dependencies = [ "quote", "syn", ] + +[[package]] +name = "zip" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12598812502ed0105f607f941c386f43d441e00148fce9dec3ca5ffb0bde9308" +dependencies = [ + "arbitrary", + "crc32fast", + "flate2", + "indexmap", + "memchr", + "zopfli", +] + +[[package]] +name = "zlib-rs" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626bd9fa9734751fc50d6060752170984d7053f5a39061f524cda68023d4db8a" + +[[package]] +name = "zopfli" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfc5ee405f504cd4984ecc6f14d02d55cfda60fa4b689434ef4102aae150cd7" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] diff --git a/Cargo.toml b/Cargo.toml index 74ef755..e9509fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,8 @@ thiserror = "1.0" base64 = "0.21" jsonwebtoken = { version = "9.3.1" } josekit = { version = "0.10.1" } +utoipa = { version = "5.4.0" } +utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.3.0" } icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.5" } icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.2" } -- 2.47.3 From 2bbb8a1617b0bcfe578a86aef5a20e4bbf0bd916 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Tue, 19 Aug 2025 13:09:53 -0400 Subject: [PATCH 02/13] tsk-170: Adding code to document API --- src/callers/song.rs | 3 +++ src/main.rs | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/callers/song.rs b/src/callers/song.rs index 2bfc552..c853eb0 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -856,6 +856,9 @@ mod song_queue { pub mod endpoint { use axum::{Json, http::StatusCode, response::IntoResponse}; + use utoipa::OpenApi; + use utoipa_swagger_ui::SwaggerUi; + use std::io::Write; use crate::callers::song::song_queue; diff --git a/src/main.rs b/src/main.rs index f016dbf..dbdd9d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ pub mod auth; pub mod callers; + pub mod db { use sqlx::postgres::PgPoolOptions; @@ -29,6 +30,16 @@ pub mod db { } } +#[derive(utoipa::OpenApi)] +#[openapi( + paths(crate::callers::song::endpoint::queue_song), + components(schemas(crate::callers::song::response::Response)), + tags( + (name = "queue song", description = "Start process to upload song by queueing the song") + ) +)] +struct ApiDoc; + #[tokio::main] async fn main() { // initialize tracing -- 2.47.3 From 542eeb915d423c7f030d452f4ec8c5d9103bca86 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Tue, 19 Aug 2025 18:30:51 -0400 Subject: [PATCH 03/13] tsk-170: icarus_models version bump Added schema capabilities --- Cargo.lock | 6 ++++-- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 40081ba..7ab4b98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -889,14 +889,15 @@ dependencies = [ [[package]] name = "icarus_models" -version = "0.5.5" -source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.5#f43bcaa314694c25cea65dbfcfbabc8fc7bf395a" +version = "0.5.6" +source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.6-58-13b030bbca-111#13b030bbcabeff9c7a7593929db508dee5db6914" dependencies = [ "josekit", "rand 0.9.1", "serde", "serde_json", "time", + "utoipa", "uuid", ] @@ -2576,6 +2577,7 @@ dependencies = [ "proc-macro2", "quote", "syn", + "uuid", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index e9509fd..c4c0eb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ josekit = { version = "0.10.1" } utoipa = { version = "5.4.0" } utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.3.0" } -icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.5" } +icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.6-58-13b030bbca-111" } icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.2" } [dev-dependencies] -- 2.47.3 From e9b22f264b14c2460eb07598891d9d74dae142ff Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Tue, 19 Aug 2025 19:05:15 -0400 Subject: [PATCH 04/13] tsk-170: crate changes --- Cargo.lock | 1 + Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 7ab4b98..3584991 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2576,6 +2576,7 @@ checksum = "6d79d08d92ab8af4c5e8a6da20c47ae3f61a0f1dabc1997cdf2d082b757ca08b" dependencies = [ "proc-macro2", "quote", + "regex", "syn", "uuid", ] diff --git a/Cargo.toml b/Cargo.toml index c4c0eb7..ff8f75a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ thiserror = "1.0" base64 = "0.21" jsonwebtoken = { version = "9.3.1" } josekit = { version = "0.10.1" } -utoipa = { version = "5.4.0" } +utoipa = { version = "5.4.0", features = ["axum_extras"] } utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.3.0" } icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.6-58-13b030bbca-111" } -- 2.47.3 From 41d6293373d4269b238a4139489e7cf1321ba5ea Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Tue, 19 Aug 2025 19:05:51 -0400 Subject: [PATCH 05/13] tsk-170: Added documentation for song queue endpoint --- src/callers/song.rs | 16 +++++++++++++--- src/main.rs | 1 - 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/callers/song.rs b/src/callers/song.rs index c853eb0..ee6e119 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -104,7 +104,7 @@ pub mod request { pub mod response { use serde::{Deserialize, Serialize}; - #[derive(Default, Deserialize, Serialize)] + #[derive(Default, Deserialize, Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -856,13 +856,23 @@ mod song_queue { pub mod endpoint { use axum::{Json, http::StatusCode, response::IntoResponse}; - use utoipa::OpenApi; - use utoipa_swagger_ui::SwaggerUi; use std::io::Write; use crate::callers::song::song_queue; + #[utoipa::path( + post, + path = "/song/queue", + request_body( + content = Object, + description = "Multipart form data for uploading song", + content_type = "multipart/form-data" + ), + responses( + (status = 200, description = "Song queued", body = super::response::Response) + ) + )] pub async fn queue_song( axum::Extension(pool): axum::Extension, mut multipart: axum::extract::Multipart, diff --git a/src/main.rs b/src/main.rs index dbdd9d1..ff1258a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,6 @@ pub mod auth; pub mod callers; - pub mod db { use sqlx::postgres::PgPoolOptions; -- 2.47.3 From 4a59212b5f5d969dae74d88a1636e90522cdf874 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 22 Aug 2025 15:10:35 -0400 Subject: [PATCH 06/13] tsk-170: Swagger openapi docs are now up Well, at least one --- src/callers/song.rs | 16 +++++++++++++++- src/main.rs | 21 ++++++++++++--------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/callers/song.rs b/src/callers/song.rs index ee6e119..793752e 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -7,6 +7,19 @@ pub mod request { pub message: String, } + pub mod song_queue { + #[derive(utoipa::ToSchema)] + pub struct SongQueueRequest { + /// Filename + pub file: String, + #[schema(rename = "type")] + /// File type. Should be a file and not a value + pub file_type: String, + /// Raw data of the flac file + pub value: Vec, + } + } + pub mod update_status { #[derive(Default, serde::Deserialize, serde::Serialize)] pub struct Request { @@ -861,11 +874,12 @@ pub mod endpoint { use crate::callers::song::song_queue; + #[utoipa::path( post, path = "/song/queue", request_body( - content = Object, + content = super::request::song_queue::SongQueueRequest, description = "Multipart form data for uploading song", content_type = "multipart/form-data" ), diff --git a/src/main.rs b/src/main.rs index ff1258a..05cfc09 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,15 +29,6 @@ pub mod db { } } -#[derive(utoipa::OpenApi)] -#[openapi( - paths(crate::callers::song::endpoint::queue_song), - components(schemas(crate::callers::song::response::Response)), - tags( - (name = "queue song", description = "Start process to upload song by queueing the song") - ) -)] -struct ApiDoc; #[tokio::main] async fn main() { @@ -57,6 +48,7 @@ async fn main() { pub mod init { use axum::routing::{delete, get, patch, post}; use std::time::Duration; + use utoipa::OpenApi; use tower_http::timeout::TimeoutLayer; use axum::http::{ @@ -64,6 +56,16 @@ pub mod init { header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE}, }; + #[derive(utoipa::OpenApi)] + #[openapi( + paths(crate::callers::song::endpoint::queue_song), + components(schemas(crate::callers::song::response::Response)), + tags( + (name = "queue song", description = "Start process to upload song by queueing the song") + ) + )] + struct ApiDoc; + pub async fn routes() -> axum::Router { axum::Router::new() .route(crate::ROOT, get(crate::root)) @@ -221,6 +223,7 @@ pub mod init { routes() .await + .merge(utoipa_swagger_ui::SwaggerUi::new("/swagger-ui").url("/api-docs/openapi.json", ApiDoc::openapi())) .layer(axum::Extension(pool)) .layer(axum::extract::DefaultBodyLimit::max(1024 * 1024 * 1024)) .layer(TimeoutLayer::new(Duration::from_secs(300))) -- 2.47.3 From 96be29a818e15619ef3011c00c4f4f2b5dab9f36 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 22 Aug 2025 15:22:51 -0400 Subject: [PATCH 07/13] tsk-170: Some documentation --- src/callers/song.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/callers/song.rs b/src/callers/song.rs index 793752e..00cb740 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -117,9 +117,11 @@ pub mod request { pub mod response { use serde::{Deserialize, Serialize}; + /// Song queue response #[derive(Default, Deserialize, Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, + /// Id of the queued song pub data: Vec, } @@ -867,6 +869,7 @@ mod song_queue { } } +/// Module for song related endpoints pub mod endpoint { use axum::{Json, http::StatusCode, response::IntoResponse}; @@ -875,6 +878,7 @@ pub mod endpoint { use crate::callers::song::song_queue; + /// Endpoint to queue a song. Starts the process and places the song in a queue #[utoipa::path( post, path = "/song/queue", -- 2.47.3 From 922a6b9a350cda47b7a7423daa7d0cf58cc9544a Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 22 Aug 2025 15:23:21 -0400 Subject: [PATCH 08/13] tsk-170: Code formatting --- src/callers/song.rs | 1 - src/main.rs | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/callers/song.rs b/src/callers/song.rs index 00cb740..b704d9a 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -877,7 +877,6 @@ pub mod endpoint { use crate::callers::song::song_queue; - /// Endpoint to queue a song. Starts the process and places the song in a queue #[utoipa::path( post, diff --git a/src/main.rs b/src/main.rs index 05cfc09..f2fce76 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,6 @@ pub mod db { } } - #[tokio::main] async fn main() { // initialize tracing @@ -48,8 +47,8 @@ async fn main() { pub mod init { use axum::routing::{delete, get, patch, post}; use std::time::Duration; - use utoipa::OpenApi; use tower_http::timeout::TimeoutLayer; + use utoipa::OpenApi; use axum::http::{ HeaderValue, Method, @@ -223,7 +222,10 @@ pub mod init { routes() .await - .merge(utoipa_swagger_ui::SwaggerUi::new("/swagger-ui").url("/api-docs/openapi.json", ApiDoc::openapi())) + .merge( + utoipa_swagger_ui::SwaggerUi::new("/swagger-ui") + .url("/api-docs/openapi.json", ApiDoc::openapi()), + ) .layer(axum::Extension(pool)) .layer(axum::extract::DefaultBodyLimit::max(1024 * 1024 * 1024)) .layer(TimeoutLayer::new(Duration::from_secs(300))) -- 2.47.3 From 594410cb12919e85063bc046bb5dae706eced6b7 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 22 Aug 2025 15:53:29 -0400 Subject: [PATCH 09/13] tsk-170: Saving changes --- src/callers/coverart.rs | 104 +++++++++++++++++++++++ src/callers/metadata.rs | 26 ++++++ src/callers/song.rs | 183 ++++++++++++++++++++++++++++++++++++---- src/main.rs | 6 +- 4 files changed, 302 insertions(+), 17 deletions(-) diff --git a/src/callers/coverart.rs b/src/callers/coverart.rs index a2b2aa0..7b1c8aa 100644 --- a/src/callers/coverart.rs +++ b/src/callers/coverart.rs @@ -465,6 +465,19 @@ pub mod endpoint { use axum::response::IntoResponse; + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn queue( axum::Extension(pool): axum::Extension, mut multipart: axum::extract::Multipart, @@ -510,6 +523,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn link( axum::Extension(pool): axum::Extension, axum::Json(payload): axum::Json, @@ -537,6 +563,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn fetch_coverart_no_data( axum::Extension(pool): axum::Extension, axum::extract::Query(params): axum::extract::Query< @@ -584,6 +623,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn fetch_coverart_with_data( axum::Extension(pool): axum::Extension, axum::extract::Path(id): axum::extract::Path, @@ -612,6 +664,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn create_coverart( axum::Extension(pool): axum::Extension, axum::Json(payload): axum::Json, @@ -672,6 +737,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn wipe_data_from_coverart_queue( axum::Extension(pool): axum::Extension, axum::Json(payload): axum::Json, @@ -701,6 +779,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn get_coverart( axum::Extension(pool): axum::Extension, axum::extract::Query(params): axum::extract::Query, @@ -729,6 +820,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn download_coverart( axum::Extension(pool): axum::Extension, axum::extract::Path(id): axum::extract::Path, diff --git a/src/callers/metadata.rs b/src/callers/metadata.rs index 6825fbd..20d9e7b 100644 --- a/src/callers/metadata.rs +++ b/src/callers/metadata.rs @@ -207,6 +207,19 @@ pub mod metadata_queue { pub mod endpoint { use axum::{Json, http::StatusCode}; + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn queue_metadata( axum::Extension(pool): axum::Extension, Json(payload): Json, @@ -233,6 +246,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn fetch_metadata( axum::Extension(pool): axum::Extension, axum::extract::Query(params): axum::extract::Query, diff --git a/src/callers/song.rs b/src/callers/song.rs index b704d9a..57b19e6 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -21,7 +21,7 @@ pub mod request { } pub mod update_status { - #[derive(Default, serde::Deserialize, serde::Serialize)] + #[derive(Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Request { pub id: uuid::Uuid, pub status: String, @@ -29,7 +29,7 @@ pub mod request { } pub mod create_metadata { - #[derive(Debug, serde::Deserialize, serde::Serialize)] + #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Request { pub title: String, pub artist: String, @@ -92,14 +92,14 @@ pub mod request { } pub mod wipe_data_from_song_queue { - #[derive(Debug, serde::Deserialize, serde::Serialize)] + #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Request { pub song_queue_id: uuid::Uuid, } } pub mod link_user_id { - #[derive(Debug, serde::Deserialize, serde::Serialize)] + #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Request { pub song_queue_id: uuid::Uuid, pub user_id: uuid::Uuid, @@ -107,7 +107,7 @@ pub mod request { } pub mod get_songs { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Params { pub id: Option, } @@ -128,7 +128,7 @@ pub mod response { pub mod fetch_queue_song { use serde::{Deserialize, Serialize}; - #[derive(Default, Deserialize, Serialize)] + #[derive(Default, Deserialize, Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -136,7 +136,7 @@ pub mod response { } pub mod update_status { - #[derive(serde::Deserialize, serde::Serialize)] + #[derive(serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct ChangedStatus { pub old_status: String, pub new_status: String, @@ -150,7 +150,7 @@ pub mod response { } pub mod update_song_queue { - #[derive(Default, serde::Deserialize, serde::Serialize)] + #[derive(Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -158,7 +158,7 @@ pub mod response { } pub mod create_metadata { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -166,7 +166,7 @@ pub mod response { } pub mod wipe_data_from_song_queue { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -174,7 +174,7 @@ pub mod response { } pub mod link_user_id { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -182,7 +182,7 @@ pub mod response { } pub mod get_songs { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -190,7 +190,7 @@ pub mod response { } pub mod delete_song { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct SongAndCoverArt { pub song: icarus_models::song::Song, pub coverart: icarus_models::coverart::CoverArt, @@ -576,7 +576,8 @@ mod song_queue { pub id: uuid::Uuid, } - #[derive(Debug, serde::Deserialize, serde::Serialize, sqlx::FromRow)] + // TODO: Move this somewhere else at some point + #[derive(Debug, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema)] pub struct SongQueue { pub id: uuid::Uuid, pub filename: String, @@ -880,7 +881,7 @@ pub mod endpoint { /// Endpoint to queue a song. Starts the process and places the song in a queue #[utoipa::path( post, - path = "/song/queue", + path = "/api/v2/song/queue", request_body( content = super::request::song_queue::SongQueueRequest, description = "Multipart form data for uploading song", @@ -938,6 +939,20 @@ pub mod endpoint { (StatusCode::OK, Json(response)) } + /// Endpoint to link a user id to a queued song + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn link_user_id( axum::Extension(pool): axum::Extension, axum::Json(payload): axum::Json, @@ -969,6 +984,14 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = super::super::endpoints::NEXTQUEUESONG, + responses( + (status = 200, description = "Queued song is present and available", body = super::response::fetch_queue_song::Response), + (status = 400, description = "Linkage failed", body = super::response::fetch_queue_song::Response) + ) + )] pub async fn fetch_queue_song( axum::Extension(pool): axum::Extension, ) -> ( @@ -991,6 +1014,19 @@ pub mod endpoint { } // TODO: Rename + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn download_flac( axum::Extension(pool): axum::Extension, axum::extract::Path(id): axum::extract::Path, @@ -1019,6 +1055,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn update_song_queue_status( axum::Extension(pool): axum::Extension, axum::Json(payload): axum::Json, @@ -1071,6 +1120,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn update_song_queue( axum::extract::Path(id): axum::extract::Path, axum::Extension(pool): axum::Extension, @@ -1117,6 +1179,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn create_metadata( axum::Extension(pool): axum::Extension, axum::Json(payload): axum::Json, @@ -1200,6 +1275,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn wipe_data_from_song_queue( axum::Extension(pool): axum::Extension, axum::Json(payload): axum::Json, @@ -1230,6 +1318,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn get_songs( axum::Extension(pool): axum::Extension, axum::extract::Query(params): axum::extract::Query, @@ -1258,6 +1359,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn get_all_songs( axum::Extension(pool): axum::Extension, ) -> ( @@ -1279,6 +1393,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn stream_song( axum::Extension(pool): axum::Extension, axum::extract::Path(id): axum::extract::Path, @@ -1326,6 +1453,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn download_song( axum::Extension(pool): axum::Extension, axum::extract::Path(id): axum::extract::Path, @@ -1361,6 +1501,19 @@ pub mod endpoint { } } + #[utoipa::path( + post, + path = "/api/v2/song/queue/link", + request_body( + content = super::request::link_user_id::Request, + description = "User Id and queued song id", + content_type = "application/json" + ), + responses( + (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), + (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + ) + )] pub async fn delete_song( axum::Extension(pool): axum::Extension, axum::extract::Path(id): axum::extract::Path, diff --git a/src/main.rs b/src/main.rs index f2fce76..008aa4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,10 +55,12 @@ pub mod init { header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE}, }; + use crate::callers::song as song_caller; + #[derive(utoipa::OpenApi)] #[openapi( - paths(crate::callers::song::endpoint::queue_song), - components(schemas(crate::callers::song::response::Response)), + paths(song_caller::endpoint::queue_song, song_caller::endpoint::link_user_id), + components(schemas(song_caller::response::Response, song_caller::response::link_user_id::Response)), tags( (name = "queue song", description = "Start process to upload song by queueing the song") ) -- 2.47.3 From 1706eccdf128d03beaab257f045148ce5d74920c Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 22 Aug 2025 19:43:08 -0400 Subject: [PATCH 10/13] tsk-170: Added more documentation --- src/callers/coverart.rs | 89 ++++++++++++---------- src/callers/song.rs | 160 +++++++++++++++++++--------------------- 2 files changed, 124 insertions(+), 125 deletions(-) diff --git a/src/callers/coverart.rs b/src/callers/coverart.rs index 7b1c8aa..e804315 100644 --- a/src/callers/coverart.rs +++ b/src/callers/coverart.rs @@ -6,9 +6,21 @@ pub struct CoverArtQueue { } pub mod request { + pub mod queue { + #[derive(utoipa::ToSchema)] + pub struct Request { + /// Filename + pub file: String, + #[schema(rename = "type")] + /// File type. Should be a file and not a value + pub file_type: String, + /// Raw data of the cover art file + pub value: Vec, + } + } pub mod link { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Request { pub coverart_id: uuid::Uuid, pub song_queue_id: uuid::Uuid, @@ -16,7 +28,7 @@ pub mod request { } pub mod fetch_coverart_no_data { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Params { pub id: Option, pub song_queue_id: Option, @@ -24,7 +36,7 @@ pub mod request { } pub mod fetch_coverart_with_data { - #[derive(Debug, serde::Deserialize, serde::Serialize)] + #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Params { pub id: Option, pub song_queue_id: Option, @@ -32,7 +44,7 @@ pub mod request { } pub mod create_coverart { - #[derive(Debug, serde::Deserialize, serde::Serialize)] + #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Request { pub song_id: uuid::Uuid, pub coverart_queue_id: uuid::Uuid, @@ -40,14 +52,14 @@ pub mod request { } pub mod wipe_data_from_coverart_queue { - #[derive(Debug, serde::Deserialize, serde::Serialize)] + #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Request { pub coverart_queue_id: uuid::Uuid, } } pub mod get_coverart { - #[derive(Debug, serde::Deserialize, serde::Serialize)] + #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Params { pub id: Option, } @@ -55,20 +67,20 @@ pub mod request { } pub mod response { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, } pub mod link { - #[derive(Debug, serde::Deserialize, serde::Serialize)] + #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Id { pub coverart_id: uuid::Uuid, pub song_queue_id: uuid::Uuid, } - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -76,7 +88,7 @@ pub mod response { } pub mod fetch_coverart_no_data { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -84,7 +96,7 @@ pub mod response { } pub mod fetch_coverart_with_data { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec>, @@ -92,7 +104,7 @@ pub mod response { } pub mod create_coverart { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -100,7 +112,7 @@ pub mod response { } pub mod wipe_data_from_coverart_queue { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -108,7 +120,7 @@ pub mod response { } pub mod get_coverart { - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -465,17 +477,16 @@ pub mod endpoint { use axum::response::IntoResponse; + /// Endpoint to queue cover art #[utoipa::path( post, - path = "/api/v2/song/queue/link", + path = super::super::endpoints::QUEUECOVERART, request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" + content = super::request::queue::Request, ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Successful", body = super::response::Response), + (status = 400, description = "Error queueing cover art", body = super::response::Response) ) )] pub async fn queue( @@ -523,17 +534,18 @@ pub mod endpoint { } } + /// Endpoint to link queued cover art #[utoipa::path( post, - path = "/api/v2/song/queue/link", + path = super::super::endpoints::QUEUECOVERARTLINK, request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", + content = super::request::link::Request, + description = "Linking queued cover art to queued song", content_type = "application/json" ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Queued cover art linked", body = super::response::link::Response), + (status = 400, description = "Linkage failed", body = super::response::link::Response) ) )] pub async fn link( @@ -563,19 +575,17 @@ pub mod endpoint { } } + /* #[utoipa::path( post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" - ), + path = super::super::endpoints::QUEUECOVERART, + params(super::request::fetch_coverart_no_data::Params), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Queued song linked", body = super::response::fetch_coverart_no_data::Response), + (status = 400, description = "Linkage failed", body = super::response::fetch_coverart_no_data::Response) ) )] + */ pub async fn fetch_coverart_no_data( axum::Extension(pool): axum::Extension, axum::extract::Query(params): axum::extract::Query< @@ -623,17 +633,14 @@ pub mod endpoint { } } + /// Endpoint to fetch the queued cover art data #[utoipa::path( post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" - ), + path = super::super::endpoints::QUEUECOVERARTDATA, + params(("id" = uuid::Uuid, Path, description = "Queued cover art Id")), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Queued cover art data", body = Vec), + (status = 400, description = "Error fetching queued cover art data", body = Vec) ) )] pub async fn fetch_coverart_with_data( diff --git a/src/callers/song.rs b/src/callers/song.rs index 57b19e6..e3def6f 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -142,7 +142,7 @@ pub mod response { pub new_status: String, } - #[derive(Default, serde::Deserialize, serde::Serialize)] + #[derive(Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -196,7 +196,7 @@ pub mod response { pub coverart: icarus_models::coverart::CoverArt, } - #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -881,7 +881,7 @@ pub mod endpoint { /// Endpoint to queue a song. Starts the process and places the song in a queue #[utoipa::path( post, - path = "/api/v2/song/queue", + path = super::super::endpoints::QUEUESONG, request_body( content = super::request::song_queue::SongQueueRequest, description = "Multipart form data for uploading song", @@ -941,8 +941,8 @@ pub mod endpoint { /// Endpoint to link a user id to a queued song #[utoipa::path( - post, - path = "/api/v2/song/queue/link", + patch, + path = super::super::endpoints::QUEUESONGLINKUSERID, request_body( content = super::request::link_user_id::Request, description = "User Id and queued song id", @@ -984,8 +984,9 @@ pub mod endpoint { } } + /// Endpoint to fetch the next queued song as long as it is available #[utoipa::path( - post, + get, path = super::super::endpoints::NEXTQUEUESONG, responses( (status = 200, description = "Queued song is present and available", body = super::response::fetch_queue_song::Response), @@ -1014,17 +1015,14 @@ pub mod endpoint { } // TODO: Rename + /// Endpoint to download the queued song #[utoipa::path( - post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" - ), + get, + path = super::super::endpoints::QUEUESONGDATA, + params(("id" = uuid::Uuid, Path, description = "Queued song Id")), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Queued song linked", body = Vec), + (status = 400, description = "Linkage failed", body = Vec) ) )] pub async fn download_flac( @@ -1055,17 +1053,18 @@ pub mod endpoint { } } + /// Endpoint to update the status of a queued song #[utoipa::path( - post, - path = "/api/v2/song/queue/link", + patch, + path = super::super::endpoints::QUEUESONG, request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", + content = super::request::update_status::Request, + description = "Update the status of a queued song", content_type = "application/json" ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Status has been updated", body = super::response::update_status::Response), + (status = 400, description = "Error updating status of queued song", body = super::response::update_status::Response) ) )] pub async fn update_song_queue_status( @@ -1120,17 +1119,20 @@ pub mod endpoint { } } + /// Endpoint to update the queued song data #[utoipa::path( - post, - path = "/api/v2/song/queue/link", + patch, + path = super::super::endpoints::QUEUESONGUPDATE, request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" + content = super::request::song_queue::SongQueueRequest, + description = "Multipart form data for uploading song", + content_type = "multipart/form-data" ), + params(("id" = uuid::Uuid, Path, description = "Queued song Id")), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Queued song updated", body = super::response::update_song_queue::Response), + (status = 400, description = "Error updating queued song", body = super::response::update_song_queue::Response), + (status = 404, description = "Queued song not found", body = super::response::update_song_queue::Response) ) )] pub async fn update_song_queue( @@ -1179,17 +1181,19 @@ pub mod endpoint { } } + /// Endpoint to create song #[utoipa::path( post, - path = "/api/v2/song/queue/link", + path = super::super::endpoints::QUEUEMETADATA, request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", + content = super::request::create_metadata::Request, + description = "Data needed to create the song and save it to the filesystem", content_type = "application/json" ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Song created", body = super::response::create_metadata::Response), + (status = 400, description = "Error", body = super::response::create_metadata::Response), + (status = 505, description = "Error creating song", body = super::response::create_metadata::Response) ) )] pub async fn create_metadata( @@ -1275,17 +1279,18 @@ pub mod endpoint { } } + /// Endpoint to wipe the data from a queued song #[utoipa::path( - post, - path = "/api/v2/song/queue/link", + patch, + path = super::super::endpoints::QUEUESONGDATAWIPE, request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", + content = super::request::wipe_data_from_song_queue::Request, + description = "Pass the queued song Id to wipe the data", content_type = "application/json" ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Queued song data wiped", body = super::response::wipe_data_from_song_queue::Response), + (status = 404, description = "Queued song cannot be found", body = super::response::wipe_data_from_song_queue::Response) ) )] pub async fn wipe_data_from_song_queue( @@ -1318,19 +1323,17 @@ pub mod endpoint { } } + /* #[utoipa::path( - post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" - ), + get, + path = super::super::endpoints::GETSONGS, + params(super::request::get_songs::Params), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Songs found", body = super::response::get_songs::Response), + (status = 400, description = "Error getting songs", body = super::response::get_songs::Response) ) )] + */ pub async fn get_songs( axum::Extension(pool): axum::Extension, axum::extract::Query(params): axum::extract::Query, @@ -1359,17 +1362,13 @@ pub mod endpoint { } } + /// Endpoint to get all songs #[utoipa::path( - post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" - ), + get, + path = super::super::endpoints::GETALLSONGS, responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Getting all songs", body = super::response::get_songs::Response), + (status = 404, description = "Song not found", body = super::response::get_songs::Response) ) )] pub async fn get_all_songs( @@ -1393,17 +1392,14 @@ pub mod endpoint { } } + /// Ednpoint to stream song #[utoipa::path( - post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" - ), + get, + path = super::super::endpoints::STREAMSONG, + params(("id" = uuid::Uuid, Path, description = "Song Id")), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Stream song", body = Vec), + (status = 500, description = "Error streaming song", body = (u64, String)) ) )] pub async fn stream_song( @@ -1453,17 +1449,15 @@ pub mod endpoint { } } + /// Endpoint to download song #[utoipa::path( - post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" - ), + get, + path = super::super::endpoints::DOWNLOADSONG, + params(("id" = uuid::Uuid, Path, description = "Song Id")), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Download song", body = (u64, Vec)), + (status = 404, description = "Song not found", body = (u64, Vec)), + (status = 400, description = "Error downloading song", body = (u64, Vec)) ) )] pub async fn download_song( @@ -1501,17 +1495,15 @@ pub mod endpoint { } } + /// Endpoint to delete the song #[utoipa::path( - post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" - ), + delete, + path = super::super::endpoints::DELETESONG, + params(("id" = uuid::Uuid, Path, description = "Song Id")), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Song deleted", body = super::response::delete_song::Response), + (status = 404, description = "Song not found", body = super::response::delete_song::Response), + (status = 500, description = "Error deleting song", body = super::response::delete_song::Response) ) )] pub async fn delete_song( -- 2.47.3 From 404af8b157a132d27df0100599be7e2bca0c2cfe Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Sat, 23 Aug 2025 16:48:52 -0400 Subject: [PATCH 11/13] tsk-170: Added the rest of the documentation --- src/callers/coverart.rs | 69 +++++++++++++++++++++-------------------- src/callers/metadata.rs | 48 +++++++++++++++------------- src/callers/song.rs | 7 +++-- src/main.rs | 25 +++++++++++++-- 4 files changed, 89 insertions(+), 60 deletions(-) diff --git a/src/callers/coverart.rs b/src/callers/coverart.rs index e804315..b386c1b 100644 --- a/src/callers/coverart.rs +++ b/src/callers/coverart.rs @@ -1,5 +1,5 @@ // TODO: Separate queue and coverart endpoints -#[derive(Debug, Default, serde::Deserialize, serde::Serialize)] +#[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct CoverArtQueue { pub id: uuid::Uuid, pub song_queue_id: uuid::Uuid, @@ -575,17 +575,19 @@ pub mod endpoint { } } - /* + /// Endpoint to fetch cover art details #[utoipa::path( - post, + get, path = super::super::endpoints::QUEUECOVERART, - params(super::request::fetch_coverart_no_data::Params), + params( + ("id" = uuid::Uuid, Path, description = "Queued cover art Id"), + ("song_queue_id" = uuid::Uuid, Path, description = "Queued song Id") + ), responses( (status = 200, description = "Queued song linked", body = super::response::fetch_coverart_no_data::Response), (status = 400, description = "Linkage failed", body = super::response::fetch_coverart_no_data::Response) ) )] - */ pub async fn fetch_coverart_no_data( axum::Extension(pool): axum::Extension, axum::extract::Query(params): axum::extract::Query< @@ -635,7 +637,7 @@ pub mod endpoint { /// Endpoint to fetch the queued cover art data #[utoipa::path( - post, + get, path = super::super::endpoints::QUEUECOVERARTDATA, params(("id" = uuid::Uuid, Path, description = "Queued cover art Id")), responses( @@ -671,17 +673,18 @@ pub mod endpoint { } } + /// Endpoint to create cover art #[utoipa::path( post, - path = "/api/v2/song/queue/link", + path = super::super::endpoints::CREATECOVERART, request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", + content = super::request::create_coverart::Request, + description = "Data required to create cover art", content_type = "application/json" ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Cover art created", body = super::response::create_coverart::Response), + (status = 400, description = "Failure in creating cover art", body = super::response::create_coverart::Response) ) )] pub async fn create_coverart( @@ -744,17 +747,19 @@ pub mod endpoint { } } + /// Endpoint to wipe data from the cover art queue #[utoipa::path( - post, - path = "/api/v2/song/queue/link", + patch, + path = super::super::endpoints::QUEUECOVERARTDATAWIPE, request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", + content = super::request::wipe_data_from_coverart_queue::Request, + description = "Data required to wipe the data from the cover art queue", content_type = "application/json" ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Data wiped from cover art queue", body = super::response::wipe_data_from_coverart_queue::Response), + (status = 400, description = "Error wiping the data", body = super::response::wipe_data_from_coverart_queue::Response), + (status = 404, description = "Cover art not found", body = super::response::wipe_data_from_coverart_queue::Response) ) )] pub async fn wipe_data_from_coverart_queue( @@ -786,17 +791,16 @@ pub mod endpoint { } } + /// Endpoint to get cover art with criteria #[utoipa::path( - post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" + get, + path = super::super::endpoints::GETCOVERART, + params( + ("id" = uuid::Uuid, Path, description = "Cover art Id") ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Cover art retrieved", body = super::response::get_coverart::Response), + (status = 400, description = "Error retrieving cover art", body = super::response::get_coverart::Response) ) )] pub async fn get_coverart( @@ -827,17 +831,16 @@ pub mod endpoint { } } + /// Endpoint to download cover art #[utoipa::path( - post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" + get, + path = super::super::endpoints::DOWNLOADCOVERART, + params( + ("id" = uuid::Uuid, Path, description = "Cover art Id") ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Cover art downloading", body = Vec), + (status = 404, description = "Cover art not found", body = Vec) ) )] pub async fn download_coverart( diff --git a/src/callers/metadata.rs b/src/callers/metadata.rs index 20d9e7b..a509e6d 100644 --- a/src/callers/metadata.rs +++ b/src/callers/metadata.rs @@ -1,10 +1,9 @@ // TODO: Explicitly make this module target queueing a song's metadata pub mod request { - pub mod queue_metadata { use serde::{Deserialize, Serialize}; - #[derive(Debug, Default, Deserialize, Serialize, sqlx::FromRow)] + #[derive(Debug, Default, Deserialize, Serialize, sqlx::FromRow, utoipa::ToSchema)] pub struct Request { pub song_queue_id: uuid::Uuid, pub album: String, @@ -43,7 +42,13 @@ pub mod request { pub mod fetch_metadata { #[derive( - Debug, Default, serde::Deserialize, serde::Serialize, sqlx::FromRow, sqlx::Decode, + Debug, + Default, + serde::Deserialize, + serde::Serialize, + sqlx::FromRow, + sqlx::Decode, + utoipa::ToSchema, )] pub struct Params { pub id: Option, @@ -53,11 +58,10 @@ pub mod request { } pub mod response { - pub mod queue_metadata { use serde::{Deserialize, Serialize}; - #[derive(Default, Deserialize, Serialize)] + #[derive(Default, Deserialize, Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -67,7 +71,7 @@ pub mod response { pub mod fetch_metadata { use serde::{Deserialize, Serialize}; - #[derive(Default, Deserialize, Serialize)] + #[derive(Default, Deserialize, Serialize, utoipa::ToSchema)] pub struct Response { pub message: String, pub data: Vec, @@ -83,7 +87,7 @@ pub mod metadata_queue { pub id: uuid::Uuid, } - #[derive(Debug, serde::Deserialize, serde::Serialize, sqlx::FromRow)] + #[derive(Debug, serde::Deserialize, serde::Serialize, sqlx::FromRow, utoipa::ToSchema)] pub struct MetadataQueue { pub id: uuid::Uuid, pub metadata: serde_json::Value, @@ -204,20 +208,22 @@ pub mod metadata_queue { } } +/// Module for metadata related endpoints pub mod endpoint { use axum::{Json, http::StatusCode}; + /// Endpoint to create queued metadata #[utoipa::path( post, - path = "/api/v2/song/queue/link", + path = super::super::endpoints::QUEUEMETADATA, request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", + content = super::request::queue_metadata::Request, + description = "Data required to create queued metadata", content_type = "application/json" ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Queued metadata created", body = super::response::queue_metadata::Response), + (status = 400, description = "Error creating queued metadata", body = super::response::queue_metadata::Response) ) )] pub async fn queue_metadata( @@ -234,7 +240,7 @@ pub mod endpoint { response.message = if response.data.is_empty() { String::from("Error") } else { - String::from("Success") + String::from(super::super::response::SUCCESSFUL) }; (StatusCode::OK, Json(response)) @@ -246,17 +252,17 @@ pub mod endpoint { } } + /// Endpoint to get queued metadata #[utoipa::path( - post, - path = "/api/v2/song/queue/link", - request_body( - content = super::request::link_user_id::Request, - description = "User Id and queued song id", - content_type = "application/json" + get, + path = super::super::endpoints::QUEUEMETADATA, + params( + ("id" = uuid::Uuid, Path, description = "Id of queued metadata"), + ("song_queue_id" = uuid::Uuid, Path, description = "Id of queued song") ), responses( - (status = 200, description = "Queued song linked", body = super::response::link_user_id::Response), - (status = 400, description = "Linkage failed", body = super::response::link_user_id::Response) + (status = 200, description = "Queued metadata retrieved", body = super::response::fetch_metadata::Response), + (status = 400, description = "Error retrieving queued metadata", body = super::response::fetch_metadata::Response) ) )] pub async fn fetch_metadata( diff --git a/src/callers/song.rs b/src/callers/song.rs index e3def6f..2051fda 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -1323,17 +1323,18 @@ pub mod endpoint { } } - /* + // Endpoint to get songs #[utoipa::path( get, path = super::super::endpoints::GETSONGS, - params(super::request::get_songs::Params), + params( + ("id" = uuid::Uuid, Path, description = "Id of song") + ), responses( (status = 200, description = "Songs found", body = super::response::get_songs::Response), (status = 400, description = "Error getting songs", body = super::response::get_songs::Response) ) )] - */ pub async fn get_songs( axum::Extension(pool): axum::Extension, axum::extract::Query(params): axum::extract::Query, diff --git a/src/main.rs b/src/main.rs index 008aa4d..369894f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,14 +55,33 @@ pub mod init { header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE}, }; + use crate::callers::coverart as coverart_caller; + use crate::callers::metadata as metadata_caller; use crate::callers::song as song_caller; + use coverart_caller::endpoint as coverart_endpoints; + use coverart_caller::response as coverart_responses; + use metadata_caller::endpoint as metadata_endpoints; + use metadata_caller::response as metadata_responses; + use song_caller::endpoint as song_endpoints; + use song_caller::response as song_responses; #[derive(utoipa::OpenApi)] #[openapi( - paths(song_caller::endpoint::queue_song, song_caller::endpoint::link_user_id), - components(schemas(song_caller::response::Response, song_caller::response::link_user_id::Response)), + paths(song_endpoints::queue_song, song_endpoints::link_user_id, song_endpoints::fetch_queue_song, song_endpoints::download_flac, + song_endpoints::update_song_queue_status, song_endpoints::update_song_queue, song_endpoints::create_metadata, song_endpoints::wipe_data_from_song_queue, song_endpoints::get_songs, song_endpoints::get_all_songs, song_endpoints::stream_song, song_endpoints::download_song, + song_endpoints::delete_song, coverart_endpoints::queue, coverart_endpoints::link, coverart_endpoints::fetch_coverart_no_data, + coverart_endpoints::fetch_coverart_with_data, coverart_endpoints::create_coverart, coverart_endpoints::wipe_data_from_coverart_queue, + coverart_endpoints::get_coverart, coverart_endpoints::download_coverart, + metadata_endpoints::queue_metadata, metadata_endpoints::fetch_metadata), + components(schemas(song_responses::Response, song_responses::link_user_id::Response, song_responses::fetch_queue_song::Response, + song_responses::update_status::Response, song_responses::update_song_queue::Response, song_responses::create_metadata::Response, + song_responses::wipe_data_from_song_queue::Response, song_responses::get_songs::Response, song_responses::delete_song::Response, + coverart_responses::Response, coverart_responses::link::Response, coverart_responses::fetch_coverart_no_data::Response, + coverart_responses::fetch_coverart_with_data::Response, coverart_responses::create_coverart::Response, + coverart_responses::wipe_data_from_coverart_queue::Response, coverart_responses::get_coverart::Response, + metadata_responses::queue_metadata::Response, metadata_responses::fetch_metadata::Response)), tags( - (name = "queue song", description = "Start process to upload song by queueing the song") + (name = "Icarus API", description = "Web API to manage music") ) )] struct ApiDoc; -- 2.47.3 From db1bc07fa82b9e23b7888e1ee2a7b3368629447f Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Sun, 24 Aug 2025 19:53:32 -0400 Subject: [PATCH 12/13] tsk-170: Formatting --- src/callers/metadata.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/callers/metadata.rs b/src/callers/metadata.rs index a509e6d..72f5d10 100644 --- a/src/callers/metadata.rs +++ b/src/callers/metadata.rs @@ -220,7 +220,7 @@ pub mod endpoint { content = super::request::queue_metadata::Request, description = "Data required to create queued metadata", content_type = "application/json" - ), + ), responses( (status = 200, description = "Queued metadata created", body = super::response::queue_metadata::Response), (status = 400, description = "Error creating queued metadata", body = super::response::queue_metadata::Response) -- 2.47.3 From 01523f0bb22ad0dc1c2376aa3dc16cf9826f69cb Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Sun, 24 Aug 2025 19:54:48 -0400 Subject: [PATCH 13/13] tsk-170: icarus_models version bump --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3584991..313aceb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -890,7 +890,7 @@ dependencies = [ [[package]] name = "icarus_models" version = "0.5.6" -source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.6-58-13b030bbca-111#13b030bbcabeff9c7a7593929db508dee5db6914" +source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.6#2d6b550ae6721b41ecc3039799f6a5e873869077" dependencies = [ "josekit", "rand 0.9.1", diff --git a/Cargo.toml b/Cargo.toml index ff8f75a..2374089 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ josekit = { version = "0.10.1" } utoipa = { version = "5.4.0", features = ["axum_extras"] } utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.3.0" } -icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.6-58-13b030bbca-111" } +icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.6" } icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.2" } [dev-dependencies] -- 2.47.3