Added skeleton endpoint to get songs
This commit is contained in:
@@ -92,6 +92,13 @@ pub mod request {
|
|||||||
pub user_id: uuid::Uuid,
|
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 {
|
pub mod response {
|
||||||
@@ -158,6 +165,14 @@ pub mod response {
|
|||||||
pub data: Vec<uuid::Uuid>,
|
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
|
// 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))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user