add count to artist songs

This commit is contained in:
2025-02-06 00:58:49 +01:00
parent 6caefaffb2
commit 2afbf31ed6
6 changed files with 256 additions and 76 deletions

View File

@@ -287,10 +287,7 @@ const docTemplate = `{
"200": {
"description": "List of artists",
"schema": {
"type": "array",
"items": {
"type": "string"
}
"$ref": "#/definitions/main.Artist"
}
},
"400": {
@@ -413,6 +410,52 @@ const docTemplate = `{
}
}
},
"/songs/artist": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"songs"
],
"summary": "Returns all the Songs of a specific Artist",
"parameters": [
{
"type": "string",
"description": "Artist Name",
"name": "artist",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/main.Song"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/songs/favorites": {
"get": {
"description": "Retrieves favorite songs filtered by a query with pagination support.",
@@ -540,6 +583,20 @@ const docTemplate = `{
}
}
},
"main.Artist": {
"description": "Artist holds search results for a given artist",
"type": "object",
"properties": {
"artist": {
"type": "string",
"example": "Miku"
},
"count": {
"type": "integer",
"example": 21
}
}
},
"main.Collection": {
"description": "Collection holds a list of songs",
"type": "object",