Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api-server): Add queue api #2767

Merged
merged 2 commits into from
Dec 25, 2024
Merged

Conversation

Su-Yong
Copy link
Collaborator

@Su-Yong Su-Yong commented Dec 25, 2024

Description

  • Added APIs
     {
       "/api/v1/queue": {
         "post": {
           "summary": "add song to queue",
           "description": "Add a song to the queue",
           "parameters": [
             {
               "schema": {
                 "type": "string",
                 "example": "Bearer token"
               },
               "required": true,
               "name": "authorization",
               "in": "header"
             }
           ],
           "requestBody": {
             "description": "video id of the song to add",
             "content": {
               "application/json": {
                 "schema": {
                   "type": "object",
                   "properties": {
                     "videoId": {
                       "type": "string"
                     }
                   },
                   "required": [
                     "videoId"
                   ]
                 }
               }
             }
           },
           "responses": {
             "204": {
               "description": "Success"
             }
           }
         },
         "patch": {
           "summary": "set queue index",
           "description": "Set the current index of the queue",
           "parameters": [
             {
               "schema": {
                 "type": "string",
                 "example": "Bearer token"
               },
               "required": true,
               "name": "authorization",
               "in": "header"
             }
           ],
           "requestBody": {
             "description": "index to move the song to",
             "content": {
               "application/json": {
                 "schema": {
                   "type": "object",
                   "properties": {
                     "index": {
                       "type": "integer",
                       "minimum": 0
                     }
                   },
                   "required": [
                     "index"
                   ]
                 }
               }
             }
           },
           "responses": {
             "204": {
               "description": "Success"
             }
           }
         },
         "delete": {
           "summary": "clear queue",
           "description": "Clear the queue",
           "responses": {
             "204": {
               "description": "Success"
             }
           }
         }
       },
       "/api/v1/queue/{index}": {
         "patch": {
           "summary": "move song in queue",
           "description": "Move a song in the queue",
           "parameters": [
             {
               "schema": {
                 "type": "integer",
                 "minimum": 0
               },
               "required": true,
               "name": "index",
               "in": "path"
             },
             {
               "schema": {
                 "type": "string",
                 "example": "Bearer token"
               },
               "required": true,
               "name": "authorization",
               "in": "header"
             }
           ],
           "requestBody": {
             "description": "index to move the song to",
             "content": {
               "application/json": {
                 "schema": {
                   "type": "object",
                   "properties": {
                     "toIndex": {
                       "type": "number"
                     }
                   },
                   "required": [
                     "toIndex"
                   ]
                 }
               }
             }
           },
           "responses": {
             "204": {
               "description": "Success"
             }
           }
         },
         "delete": {
           "summary": "remove song from queue",
           "description": "Remove a song from the queue",
           "parameters": [
             {
               "schema": {
                 "type": "integer",
                 "minimum": 0
               },
               "required": true,
               "name": "index",
               "in": "path"
             },
             {
               "schema": {
                 "type": "string",
                 "example": "Bearer token"
               },
               "required": true,
               "name": "authorization",
               "in": "header"
             }
           ],
           "responses": {
             "204": {
               "description": "Success"
             }
           }
         }
       }
     }
    • POST /queue: add song to queue
    • PATCH /queue/:index: change an index of the song you specified
    • DELETE /queue/:index: remove song from queue
    • PATCH /queue: change queue index
    • DELETE /queue: clear queue
    • POST /search: search

Note

@Su-Yong Su-Yong added the enhancement New feature or request label Dec 25, 2024
@Su-Yong Su-Yong self-assigned this Dec 25, 2024
@JellyBrick JellyBrick merged commit 1d6251b into master Dec 25, 2024
8 checks passed
@JellyBrick JellyBrick deleted the feature/improve-api-server branch December 25, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: API Server Add/Modify Song Queue
2 participants