mirror of
https://github.com/JuLi0n21/pwa-player.git
synced 2026-04-19 23:40:05 +00:00
actual changes :3
This commit is contained in:
683
grpc-backend/docs/docs.go
Normal file
683
grpc-backend/docs/docs.go
Normal file
@@ -0,0 +1,683 @@
|
||||
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
||||
package docs
|
||||
|
||||
import "github.com/swaggo/swag"
|
||||
|
||||
const docTemplate = `{
|
||||
"schemes": {{ marshal .Schemes }},
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"description": "{{escape .Description}}",
|
||||
"title": "{{.Title}}",
|
||||
"contact": {},
|
||||
"version": "{{.Version}}"
|
||||
},
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/audio/{filepath}": {
|
||||
"get": {
|
||||
"description": "Retrieves a song file from the server based on the provided encoded filepath",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"files"
|
||||
],
|
||||
"summary": "Retrieves a song file by its encoded path",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Base64 encoded file path",
|
||||
"name": "filepath",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "The requested song file",
|
||||
"schema": {
|
||||
"type": "file"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "File Not Found",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/collection": {
|
||||
"get": {
|
||||
"description": "Retrieves a collection of songs using the provided index.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"songs"
|
||||
],
|
||||
"summary": "Get a collection of songs by index",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Index",
|
||||
"name": "index",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Index",
|
||||
"name": "name",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid parameter",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/image/{filepath}": {
|
||||
"get": {
|
||||
"description": "Retrieves an image file from the server based on the provided encoded filepath",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"files"
|
||||
],
|
||||
"summary": "Retrieves an image file by its encoded path",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Base64 encoded file path",
|
||||
"name": "filepath",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "The requested image file",
|
||||
"schema": {
|
||||
"type": "file"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "File Not Found",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/login": {
|
||||
"get": {
|
||||
"description": "Redirects users to an external authentication page",
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Redirect to login page",
|
||||
"responses": {
|
||||
"307": {
|
||||
"description": "Temporary Redirect",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/ping": {
|
||||
"get": {
|
||||
"description": "Returns a pong response if the server is running",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"summary": "Check server health",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "pong",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/search/active": {
|
||||
"get": {
|
||||
"description": "Searches active records in the database based on the query parameter",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"search"
|
||||
],
|
||||
"summary": "Searches active records based on a query",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Search query",
|
||||
"name": "query",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit the number of results",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset for pagination",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Active search result",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/main.ActiveSearch"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/search/artist": {
|
||||
"get": {
|
||||
"description": "Searches for artists in the database based on the query parameter",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"search"
|
||||
],
|
||||
"summary": "Searches for artists based on a query",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Search query",
|
||||
"name": "query",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit the number of results",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset for pagination",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of artists",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/main.Artist"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/search/collections": {
|
||||
"get": {
|
||||
"description": "Searches collections in the database based on the query parameter",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"search"
|
||||
],
|
||||
"summary": "Searches collections based on a query",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Search query",
|
||||
"name": "query",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit the number of results",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset for pagination",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of collections",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Collection"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/song/{hash}": {
|
||||
"get": {
|
||||
"description": "Retrieves a song using its unique hash identifier.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"songs"
|
||||
],
|
||||
"summary": "Get a song by its hash",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Song hash",
|
||||
"name": "hash",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid parameter",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Song not found",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"songs"
|
||||
],
|
||||
"summary": "Get a list of favorite songs based on a query",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Search query",
|
||||
"name": "query",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid parameter",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/songs/recents": {
|
||||
"get": {
|
||||
"description": "Retrieves recent songs with pagination support.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"songs"
|
||||
],
|
||||
"summary": "Get a list of recent songs",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"main.ActiveSearch": {
|
||||
"description": "ActiveSearch holds search results for a given artist",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"artist": {
|
||||
"type": "string",
|
||||
"example": "Ed Sheeran"
|
||||
},
|
||||
"songs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"example": 15
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"example": "Best of 2023"
|
||||
},
|
||||
"songs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"main.Song": {
|
||||
"description": "Song represents a song with metadata",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"artist": {
|
||||
"type": "string",
|
||||
"example": "Ed Sheeran"
|
||||
},
|
||||
"audio": {
|
||||
"type": "string",
|
||||
"example": "audio.mp3"
|
||||
},
|
||||
"beatmap_id": {
|
||||
"type": "integer",
|
||||
"example": 123456
|
||||
},
|
||||
"creator": {
|
||||
"type": "string",
|
||||
"example": "JohnDoe"
|
||||
},
|
||||
"file": {
|
||||
"type": "string",
|
||||
"example": "beatmap.osu"
|
||||
},
|
||||
"folder": {
|
||||
"type": "string",
|
||||
"example": "osu/Songs/123456"
|
||||
},
|
||||
"image": {
|
||||
"type": "string",
|
||||
"example": "cover.jpg"
|
||||
},
|
||||
"md5_hash": {
|
||||
"type": "string",
|
||||
"example": "abcd1234efgh5678"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"example": "Shape of You"
|
||||
},
|
||||
"total_time": {
|
||||
"type": "integer",
|
||||
"example": 240
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||
var SwaggerInfo = &swag.Spec{
|
||||
Version: "",
|
||||
Host: "",
|
||||
BasePath: "",
|
||||
Schemes: []string{},
|
||||
Title: "",
|
||||
Description: "",
|
||||
InfoInstanceName: "swagger",
|
||||
SwaggerTemplate: docTemplate,
|
||||
}
|
||||
|
||||
func init() {
|
||||
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
||||
}
|
||||
656
grpc-backend/docs/swagger.json
Normal file
656
grpc-backend/docs/swagger.json
Normal file
@@ -0,0 +1,656 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"contact": {}
|
||||
},
|
||||
"paths": {
|
||||
"/audio/{filepath}": {
|
||||
"get": {
|
||||
"description": "Retrieves a song file from the server based on the provided encoded filepath",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"files"
|
||||
],
|
||||
"summary": "Retrieves a song file by its encoded path",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Base64 encoded file path",
|
||||
"name": "filepath",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "The requested song file",
|
||||
"schema": {
|
||||
"type": "file"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "File Not Found",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/collection": {
|
||||
"get": {
|
||||
"description": "Retrieves a collection of songs using the provided index.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"songs"
|
||||
],
|
||||
"summary": "Get a collection of songs by index",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Index",
|
||||
"name": "index",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Index",
|
||||
"name": "name",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid parameter",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/image/{filepath}": {
|
||||
"get": {
|
||||
"description": "Retrieves an image file from the server based on the provided encoded filepath",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"files"
|
||||
],
|
||||
"summary": "Retrieves an image file by its encoded path",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Base64 encoded file path",
|
||||
"name": "filepath",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "The requested image file",
|
||||
"schema": {
|
||||
"type": "file"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "File Not Found",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/login": {
|
||||
"get": {
|
||||
"description": "Redirects users to an external authentication page",
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Redirect to login page",
|
||||
"responses": {
|
||||
"307": {
|
||||
"description": "Temporary Redirect",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/ping": {
|
||||
"get": {
|
||||
"description": "Returns a pong response if the server is running",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"summary": "Check server health",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "pong",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/search/active": {
|
||||
"get": {
|
||||
"description": "Searches active records in the database based on the query parameter",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"search"
|
||||
],
|
||||
"summary": "Searches active records based on a query",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Search query",
|
||||
"name": "query",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit the number of results",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset for pagination",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Active search result",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/main.ActiveSearch"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/search/artist": {
|
||||
"get": {
|
||||
"description": "Searches for artists in the database based on the query parameter",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"search"
|
||||
],
|
||||
"summary": "Searches for artists based on a query",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Search query",
|
||||
"name": "query",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit the number of results",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset for pagination",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of artists",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/main.Artist"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/search/collections": {
|
||||
"get": {
|
||||
"description": "Searches collections in the database based on the query parameter",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"search"
|
||||
],
|
||||
"summary": "Searches collections based on a query",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Search query",
|
||||
"name": "query",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit the number of results",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset for pagination",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of collections",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Collection"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/song/{hash}": {
|
||||
"get": {
|
||||
"description": "Retrieves a song using its unique hash identifier.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"songs"
|
||||
],
|
||||
"summary": "Get a song by its hash",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Song hash",
|
||||
"name": "hash",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid parameter",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Song not found",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"songs"
|
||||
],
|
||||
"summary": "Get a list of favorite songs based on a query",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Search query",
|
||||
"name": "query",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid parameter",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/songs/recents": {
|
||||
"get": {
|
||||
"description": "Retrieves recent songs with pagination support.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"songs"
|
||||
],
|
||||
"summary": "Get a list of recent songs",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"description": "Limit",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Offset",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"main.ActiveSearch": {
|
||||
"description": "ActiveSearch holds search results for a given artist",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"artist": {
|
||||
"type": "string",
|
||||
"example": "Ed Sheeran"
|
||||
},
|
||||
"songs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"example": 15
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"example": "Best of 2023"
|
||||
},
|
||||
"songs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/main.Song"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"main.Song": {
|
||||
"description": "Song represents a song with metadata",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"artist": {
|
||||
"type": "string",
|
||||
"example": "Ed Sheeran"
|
||||
},
|
||||
"audio": {
|
||||
"type": "string",
|
||||
"example": "audio.mp3"
|
||||
},
|
||||
"beatmap_id": {
|
||||
"type": "integer",
|
||||
"example": 123456
|
||||
},
|
||||
"creator": {
|
||||
"type": "string",
|
||||
"example": "JohnDoe"
|
||||
},
|
||||
"file": {
|
||||
"type": "string",
|
||||
"example": "beatmap.osu"
|
||||
},
|
||||
"folder": {
|
||||
"type": "string",
|
||||
"example": "osu/Songs/123456"
|
||||
},
|
||||
"image": {
|
||||
"type": "string",
|
||||
"example": "cover.jpg"
|
||||
},
|
||||
"md5_hash": {
|
||||
"type": "string",
|
||||
"example": "abcd1234efgh5678"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"example": "Shape of You"
|
||||
},
|
||||
"total_time": {
|
||||
"type": "integer",
|
||||
"example": 240
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
441
grpc-backend/docs/swagger.yaml
Normal file
441
grpc-backend/docs/swagger.yaml
Normal file
@@ -0,0 +1,441 @@
|
||||
definitions:
|
||||
main.ActiveSearch:
|
||||
description: ActiveSearch holds search results for a given artist
|
||||
properties:
|
||||
artist:
|
||||
example: Ed Sheeran
|
||||
type: string
|
||||
songs:
|
||||
items:
|
||||
$ref: '#/definitions/main.Song'
|
||||
type: array
|
||||
type: object
|
||||
main.Artist:
|
||||
description: Artist holds search results for a given artist
|
||||
properties:
|
||||
artist:
|
||||
example: Miku
|
||||
type: string
|
||||
count:
|
||||
example: 21
|
||||
type: integer
|
||||
type: object
|
||||
main.Collection:
|
||||
description: Collection holds a list of songs
|
||||
properties:
|
||||
items:
|
||||
example: 15
|
||||
type: integer
|
||||
name:
|
||||
example: Best of 2023
|
||||
type: string
|
||||
songs:
|
||||
items:
|
||||
$ref: '#/definitions/main.Song'
|
||||
type: array
|
||||
type: object
|
||||
main.Song:
|
||||
description: Song represents a song with metadata
|
||||
properties:
|
||||
artist:
|
||||
example: Ed Sheeran
|
||||
type: string
|
||||
audio:
|
||||
example: audio.mp3
|
||||
type: string
|
||||
beatmap_id:
|
||||
example: 123456
|
||||
type: integer
|
||||
creator:
|
||||
example: JohnDoe
|
||||
type: string
|
||||
file:
|
||||
example: beatmap.osu
|
||||
type: string
|
||||
folder:
|
||||
example: osu/Songs/123456
|
||||
type: string
|
||||
image:
|
||||
example: cover.jpg
|
||||
type: string
|
||||
md5_hash:
|
||||
example: abcd1234efgh5678
|
||||
type: string
|
||||
title:
|
||||
example: Shape of You
|
||||
type: string
|
||||
total_time:
|
||||
example: 240
|
||||
type: integer
|
||||
type: object
|
||||
info:
|
||||
contact: {}
|
||||
paths:
|
||||
/audio/{filepath}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Retrieves a song file from the server based on the provided encoded
|
||||
filepath
|
||||
parameters:
|
||||
- description: Base64 encoded file path
|
||||
in: path
|
||||
name: filepath
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: The requested song file
|
||||
schema:
|
||||
type: file
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
type: string
|
||||
"404":
|
||||
description: File Not Found
|
||||
schema:
|
||||
type: string
|
||||
summary: Retrieves a song file by its encoded path
|
||||
tags:
|
||||
- files
|
||||
/collection:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Retrieves a collection of songs using the provided index.
|
||||
parameters:
|
||||
- description: Index
|
||||
in: query
|
||||
name: index
|
||||
type: integer
|
||||
- description: Index
|
||||
in: query
|
||||
name: name
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/main.Song'
|
||||
type: array
|
||||
"400":
|
||||
description: Invalid parameter
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
type: string
|
||||
summary: Get a collection of songs by index
|
||||
tags:
|
||||
- songs
|
||||
/image/{filepath}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Retrieves an image file from the server based on the provided encoded
|
||||
filepath
|
||||
parameters:
|
||||
- description: Base64 encoded file path
|
||||
in: path
|
||||
name: filepath
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: The requested image file
|
||||
schema:
|
||||
type: file
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
type: string
|
||||
"404":
|
||||
description: File Not Found
|
||||
schema:
|
||||
type: string
|
||||
summary: Retrieves an image file by its encoded path
|
||||
tags:
|
||||
- files
|
||||
/login:
|
||||
get:
|
||||
description: Redirects users to an external authentication page
|
||||
responses:
|
||||
"307":
|
||||
description: Temporary Redirect
|
||||
schema:
|
||||
type: string
|
||||
summary: Redirect to login page
|
||||
tags:
|
||||
- auth
|
||||
/ping:
|
||||
get:
|
||||
description: Returns a pong response if the server is running
|
||||
responses:
|
||||
"200":
|
||||
description: pong
|
||||
schema:
|
||||
type: string
|
||||
summary: Check server health
|
||||
tags:
|
||||
- health
|
||||
/search/active:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Searches active records in the database based on the query parameter
|
||||
parameters:
|
||||
- description: Search query
|
||||
in: query
|
||||
name: query
|
||||
required: true
|
||||
type: string
|
||||
- default: 10
|
||||
description: Limit the number of results
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- default: 0
|
||||
description: Offset for pagination
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Active search result
|
||||
schema:
|
||||
$ref: '#/definitions/main.ActiveSearch'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
type: string
|
||||
summary: Searches active records based on a query
|
||||
tags:
|
||||
- search
|
||||
/search/artist:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Searches for artists in the database based on the query parameter
|
||||
parameters:
|
||||
- description: Search query
|
||||
in: query
|
||||
name: query
|
||||
required: true
|
||||
type: string
|
||||
- default: 10
|
||||
description: Limit the number of results
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- default: 0
|
||||
description: Offset for pagination
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: List of artists
|
||||
schema:
|
||||
$ref: '#/definitions/main.Artist'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
type: string
|
||||
summary: Searches for artists based on a query
|
||||
tags:
|
||||
- search
|
||||
/search/collections:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Searches collections in the database based on the query parameter
|
||||
parameters:
|
||||
- description: Search query
|
||||
in: query
|
||||
name: query
|
||||
required: true
|
||||
type: string
|
||||
- default: 10
|
||||
description: Limit the number of results
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- default: 0
|
||||
description: Offset for pagination
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: List of collections
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/main.Collection'
|
||||
type: array
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
type: string
|
||||
summary: Searches collections based on a query
|
||||
tags:
|
||||
- search
|
||||
/song/{hash}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Retrieves a song using its unique hash identifier.
|
||||
parameters:
|
||||
- description: Song hash
|
||||
in: path
|
||||
name: hash
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/main.Song'
|
||||
"400":
|
||||
description: Invalid parameter
|
||||
schema:
|
||||
type: string
|
||||
"404":
|
||||
description: Song not found
|
||||
schema:
|
||||
type: string
|
||||
summary: Get a song by its hash
|
||||
tags:
|
||||
- songs
|
||||
/songs/artist:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: Artist Name
|
||||
in: query
|
||||
name: artist
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/main.Song'
|
||||
type: array
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
type: string
|
||||
summary: Returns all the Songs of a specific Artist
|
||||
tags:
|
||||
- songs
|
||||
/songs/favorites:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Retrieves favorite songs filtered by a query with pagination support.
|
||||
parameters:
|
||||
- description: Search query
|
||||
in: query
|
||||
name: query
|
||||
required: true
|
||||
type: string
|
||||
- default: 10
|
||||
description: Limit
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- default: 0
|
||||
description: Offset
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/main.Song'
|
||||
type: array
|
||||
"400":
|
||||
description: Invalid parameter
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
type: string
|
||||
summary: Get a list of favorite songs based on a query
|
||||
tags:
|
||||
- songs
|
||||
/songs/recents:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Retrieves recent songs with pagination support.
|
||||
parameters:
|
||||
- default: 10
|
||||
description: Limit
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- default: 0
|
||||
description: Offset
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/main.Song'
|
||||
type: array
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
type: string
|
||||
summary: Get a list of recent songs
|
||||
tags:
|
||||
- songs
|
||||
swagger: "2.0"
|
||||
Reference in New Issue
Block a user