add collection sugar

This commit is contained in:
2025-02-06 00:23:12 +01:00
parent 905b488fd4
commit 2791b6de76
8 changed files with 124 additions and 230 deletions

View File

@@ -77,8 +77,13 @@ const docTemplate = `{
"type": "integer",
"description": "Index",
"name": "index",
"in": "query",
"required": true
"in": "query"
},
{
"type": "string",
"description": "Index",
"name": "name",
"in": "query"
}
],
"responses": {
@@ -106,66 +111,6 @@ const docTemplate = `{
}
}
},
"/collections": {
"get": {
"description": "Retrieves collections from the database with pagination based on the query parameter",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"search"
],
"summary": "Retrieves collections based on a query",
"parameters": [
{
"type": "string",
"description": "Search query",
"name": "query",
"in": "query"
},
{
"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"
}
}
}
}
},
"/image/{filepath}": {
"get": {
"description": "Retrieves an image file from the server based on the provided encoded filepath",