Added skeleton endpoint to get songs

This commit is contained in:
kdeng00
2025-07-25 16:25:23 -04:00
parent b40c0fb1ca
commit 60a114af96
+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))
}
}