Get songs endpoint #162

Merged
kdeng00 merged 27 commits from get_songs into v0.2 2025-07-25 18:20:28 -04:00
Showing only changes of commit 60a114af96 - Show all commits
+23
View File
@@ -92,6 +92,13 @@ pub mod request {
pub user_id: uuid::Uuid,
}
}
pub mod get_songs {
#[derive(Debug, Default, serde::Deserialize, serde::Serialize)]
pub struct Params {
pub id: Option<uuid::Uuid>
}
}
}
pub mod response {
@@ -158,6 +165,14 @@ pub mod response {
pub data: Vec<uuid::Uuid>,
}
}
pub mod get_songs {
#[derive(Debug, Default, serde::Deserialize, serde::Serialize)]
pub struct Response {
pub message: String,
pub data: Vec<i32>
}
}
}
// TODO: Might make a distinction between year and date in a song's tag at some point
@@ -968,4 +983,12 @@ pub mod endpoint {
}
}
}
pub async fn get_songs(axum::Extension(pool): axum::Extension<sqlx::PgPool>,
axum::extract::Query(params): axum::extract::Query<super::request::get_songs::Params>)
-> (axum::http::StatusCode, Json<super::response::get_songs::Response>) {
let mut response = super::response::get_songs::Response::default();
(axum::http::StatusCode::OK, axum::Json(response))
}
}