tsk-170: Added documentation for song queue endpoint
This commit is contained in:
+13
-3
@@ -104,7 +104,7 @@ pub mod request {
|
|||||||
pub mod response {
|
pub mod response {
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Default, Deserialize, Serialize)]
|
#[derive(Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
pub struct Response {
|
pub struct Response {
|
||||||
pub message: String,
|
pub message: String,
|
||||||
pub data: Vec<uuid::Uuid>,
|
pub data: Vec<uuid::Uuid>,
|
||||||
@@ -856,13 +856,23 @@ mod song_queue {
|
|||||||
|
|
||||||
pub mod endpoint {
|
pub mod endpoint {
|
||||||
use axum::{Json, http::StatusCode, response::IntoResponse};
|
use axum::{Json, http::StatusCode, response::IntoResponse};
|
||||||
use utoipa::OpenApi;
|
|
||||||
use utoipa_swagger_ui::SwaggerUi;
|
|
||||||
|
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
use crate::callers::song::song_queue;
|
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(
|
pub async fn queue_song(
|
||||||
axum::Extension(pool): axum::Extension<sqlx::PgPool>,
|
axum::Extension(pool): axum::Extension<sqlx::PgPool>,
|
||||||
mut multipart: axum::extract::Multipart,
|
mut multipart: axum::extract::Multipart,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
pub mod auth;
|
pub mod auth;
|
||||||
pub mod callers;
|
pub mod callers;
|
||||||
|
|
||||||
|
|
||||||
pub mod db {
|
pub mod db {
|
||||||
|
|
||||||
use sqlx::postgres::PgPoolOptions;
|
use sqlx::postgres::PgPoolOptions;
|
||||||
|
|||||||
Reference in New Issue
Block a user