feat: initialized all controllers for release 1;

feat: authentication added to swagger
This commit is contained in:
2025-06-18 18:27:12 +03:00
parent 582c0f15d8
commit b1ef3e06f6
7 changed files with 434 additions and 7 deletions

View File

@@ -10,11 +10,34 @@ const docTemplate = `{
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"license": {
"name": "GPL 3.0"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/account/changePassword": {
"put": {
"security": [
{
"JWT": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Account"
],
"summary": "Change account password",
"responses": {}
}
},
"/auth/login": {
"post": {
"consumes": [
@@ -105,6 +128,93 @@ const docTemplate = `{
"responses": {}
}
},
"/profile/me": {
"get": {
"security": [
{
"JWT": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Profile"
],
"summary": "Get own profile when authorized",
"responses": {}
}
},
"/profile/privacy": {
"get": {
"security": [
{
"JWT": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Profile"
],
"summary": "Get profile privacy settings",
"responses": {}
},
"patch": {
"security": [
{
"JWT": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Profile"
],
"summary": "Update profile privacy settings",
"responses": {}
}
},
"/profile/{username}": {
"get": {
"security": [
{
"JWT": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Profile"
],
"summary": "Get someone's profile details",
"parameters": [
{
"type": "string",
"description": "Username",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {}
}
},
"/service/health": {
"get": {
"description": "Used internally for checking service health",
@@ -138,17 +248,24 @@ const docTemplate = `{
}
}
}
},
"securityDefinitions": {
"JWT": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "",
Version: "1.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "",
Description: "",
BasePath: "/api/",
Schemes: []string{"http"},
Title: "Easywish client API",
Description: "Easy and feature-rich wishlist.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",