// 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": { "/api/v1/auth/github/callback": { "get": { "description": "Exchanges GitHub code and returns local access/refresh tokens.", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "GitHub OAuth callback", "parameters": [ { "type": "string", "description": "oauth state", "name": "state", "in": "query", "required": true }, { "type": "string", "description": "authorization code", "name": "code", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "503": { "description": "Service Unavailable", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/auth/github/login": { "get": { "description": "Returns GitHub authorization URL and sets state cookie for CSRF protection.", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Start GitHub OAuth login", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "503": { "description": "Service Unavailable", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/auth/google/callback": { "get": { "description": "Exchanges Google code and returns local access/refresh tokens.", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Google OAuth callback", "parameters": [ { "type": "string", "description": "oauth state", "name": "state", "in": "query", "required": true }, { "type": "string", "description": "authorization code", "name": "code", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "503": { "description": "Service Unavailable", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/auth/google/login": { "get": { "description": "Returns Google authorization URL and sets state cookie for CSRF protection.", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Start Google OAuth login", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "503": { "description": "Service Unavailable", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/auth/login": { "post": { "description": "Returns access and refresh tokens.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Login with email/password", "parameters": [ { "description": "login payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.LoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/auth/refresh": { "post": { "description": "Exchanges a valid refresh token for a new access token.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Refresh access token", "parameters": [ { "description": "refresh payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.RefreshRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/auth/register": { "post": { "description": "Creates a user and sends an email verification link.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Register a new user", "parameters": [ { "description": "register payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.RegisterRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/auth/verify-email": { "get": { "description": "Activates account using email verification token.", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Verify email address", "parameters": [ { "type": "string", "description": "email verification token", "name": "token", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/blog/categories": { "get": { "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "List blog categories", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Create blog category", "parameters": [ { "description": "category payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertCategoryRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/blog/categories/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Update blog category", "parameters": [ { "type": "integer", "description": "category id", "name": "id", "in": "path", "required": true }, { "description": "category payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertCategoryRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Delete blog category", "parameters": [ { "type": "integer", "description": "category id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/blog/posts": { "get": { "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "List blog posts", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Create blog post", "parameters": [ { "description": "post payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertPostRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/v1/blog/posts/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Get blog post", "parameters": [ { "type": "integer", "description": "post id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Update blog post", "parameters": [ { "type": "integer", "description": "post id", "name": "id", "in": "path", "required": true }, { "description": "post payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertPostRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Delete blog post", "parameters": [ { "type": "integer", "description": "post id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/blog/tags": { "get": { "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "List blog tags", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Create blog tag", "parameters": [ { "description": "tag payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertTagRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/v1/blog/tags/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Update blog tag", "parameters": [ { "type": "integer", "description": "tag id", "name": "id", "in": "path", "required": true }, { "description": "tag payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertTagRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Blog" ], "summary": "Delete blog tag", "parameters": [ { "type": "integer", "description": "tag id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/me": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Returns user_id, email and username from the authenticated user.", "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Get current user info", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/settings": { "get": { "description": "Returns the latest settings record.", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Get global setting", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Creates the first setting record if none exists, otherwise updates the latest one.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Create or update global setting", "parameters": [ { "description": "setting payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertSettingRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/settings/cors/blacklist": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Returns all CORS blacklist records.", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "List CORS blacklist items", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Creates a new blacklist origin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Create CORS blacklist item", "parameters": [ { "description": "cors blacklist payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertCorsBlacklistRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/settings/cors/blacklist/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Updates a blacklist origin by id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Update CORS blacklist item", "parameters": [ { "type": "integer", "description": "blacklist id", "name": "id", "in": "path", "required": true }, { "description": "cors blacklist payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertCorsBlacklistRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Deletes a blacklist origin by id.", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Delete CORS blacklist item", "parameters": [ { "type": "integer", "description": "blacklist id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/settings/cors/whitelist": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Returns all CORS whitelist records.", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "List CORS whitelist items", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Creates a new whitelist origin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Create CORS whitelist item", "parameters": [ { "description": "cors whitelist payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertCorsWhitelistRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/settings/cors/whitelist/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Updates a whitelist origin by id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Update CORS whitelist item", "parameters": [ { "type": "integer", "description": "whitelist id", "name": "id", "in": "path", "required": true }, { "description": "cors whitelist payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertCorsWhitelistRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Deletes a whitelist origin by id.", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Delete CORS whitelist item", "parameters": [ { "type": "integer", "description": "whitelist id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/settings/heroes": { "get": { "description": "Returns all hero records ordered by id desc.", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "List heroes", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Creates a new hero record.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Create hero", "parameters": [ { "description": "hero payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertHeroRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/settings/heroes/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Updates a hero by id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Update hero", "parameters": [ { "type": "integer", "description": "hero id", "name": "id", "in": "path", "required": true }, { "description": "hero payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertHeroRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Deletes a hero by id.", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Delete hero", "parameters": [ { "type": "integer", "description": "hero id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/settings/rate-limits": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Returns all rate-limit settings.", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "List rate limits", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Creates a new rate-limit setting.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Create rate limit", "parameters": [ { "description": "rate limit payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertRateLimitRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/settings/rate-limits/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Updates a rate-limit setting by id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Update rate limit", "parameters": [ { "type": "integer", "description": "rate limit id", "name": "id", "in": "path", "required": true }, { "description": "rate limit payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertRateLimitRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Deletes a rate-limit setting by id.", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "Delete rate limit", "parameters": [ { "type": "integer", "description": "rate limit id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/shop/cart": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Returns the authenticated user's cart with items.", "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Get my cart", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/shop/cart/items": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Creates or increments a cart item for authenticated user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Add item to my cart", "parameters": [ { "description": "cart item payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertCartItemRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/shop/cart/items/{itemId}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Updates a cart item owned by authenticated user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Update my cart item", "parameters": [ { "type": "integer", "description": "cart item id", "name": "itemId", "in": "path", "required": true }, { "description": "cart item payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertCartItemRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Deletes a cart item owned by authenticated user.", "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Delete item from my cart", "parameters": [ { "type": "integer", "description": "cart item id", "name": "itemId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/shop/categories": { "get": { "description": "Returns all categories with children.", "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "List product categories", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Creates a new shop category.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Create product category", "parameters": [ { "description": "category payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertProductCategoryRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/shop/categories/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Updates a category by id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Update product category", "parameters": [ { "type": "integer", "description": "category id", "name": "id", "in": "path", "required": true }, { "description": "category payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertProductCategoryRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Deletes a category by id.", "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Delete product category", "parameters": [ { "type": "integer", "description": "category id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/shop/products": { "get": { "description": "Returns all products with categories and tags.", "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "List products", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Creates a new product and assigns category/tag relations.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Create product", "parameters": [ { "description": "product payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertProductRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/shop/products/{id}": { "get": { "description": "Returns product details by id.", "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Get product", "parameters": [ { "type": "integer", "description": "product id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Updates a product and reassigns category/tag relations.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Update product", "parameters": [ { "type": "integer", "description": "product id", "name": "id", "in": "path", "required": true }, { "description": "product payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertProductRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Deletes a product by id.", "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Delete product", "parameters": [ { "type": "integer", "description": "product id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/shop/tags": { "get": { "description": "Returns all product tags.", "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "List product tags", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Creates a new product tag.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Create product tag", "parameters": [ { "description": "tag payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertProductTagRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/shop/tags/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Updates a tag by id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Update product tag", "parameters": [ { "type": "integer", "description": "tag id", "name": "id", "in": "path", "required": true }, { "description": "tag payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.UpsertProductTagRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Deletes a tag by id.", "produces": [ "application/json" ], "tags": [ "Shop" ], "summary": "Delete product tag", "parameters": [ { "type": "integer", "description": "tag id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } } }, "definitions": { "controllers.LoginRequest": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "controllers.RefreshRequest": { "type": "object", "required": [ "refresh_token" ], "properties": { "refresh_token": { "type": "string" } } }, "controllers.RegisterRequest": { "type": "object", "required": [ "confirm_password", "email", "password", "username" ], "properties": { "confirm_password": { "type": "string", "minLength": 8 }, "email": { "type": "string" }, "password": { "type": "string", "minLength": 8 }, "username": { "type": "string", "maxLength": 50, "minLength": 3 } } }, "controllers.UpsertCartItemRequest": { "type": "object", "required": [ "product_id", "quantity" ], "properties": { "product_id": { "type": "integer" }, "quantity": { "type": "integer", "minimum": 1 } } }, "controllers.UpsertCategoryRequest": { "type": "object", "required": [ "slug", "title" ], "properties": { "description": { "type": "string" }, "parent_id": { "type": "integer" }, "slug": { "type": "string", "maxLength": 254 }, "title": { "type": "string", "maxLength": 254 } } }, "controllers.UpsertCorsBlacklistRequest": { "type": "object", "required": [ "origin" ], "properties": { "created_by": { "type": "string", "maxLength": 255 }, "is_active": { "type": "boolean" }, "origin": { "type": "string", "maxLength": 255 }, "reason": { "type": "string", "maxLength": 255 } } }, "controllers.UpsertCorsWhitelistRequest": { "type": "object", "required": [ "origin" ], "properties": { "created_by": { "type": "string", "maxLength": 255 }, "description": { "type": "string", "maxLength": 255 }, "is_active": { "type": "boolean" }, "origin": { "type": "string", "maxLength": 255 } } }, "controllers.UpsertHeroRequest": { "type": "object", "required": [ "color" ], "properties": { "color": { "type": "string", "maxLength": 32 }, "format": { "type": "string", "maxLength": 10 }, "height": { "type": "integer" }, "image": { "type": "string", "maxLength": 254 }, "is_active": { "type": "boolean" }, "quality": { "type": "integer" }, "text1": { "type": "string", "maxLength": 254 }, "text2": { "type": "string", "maxLength": 254 }, "text4": { "type": "string", "maxLength": 254 }, "text5": { "type": "string", "maxLength": 254 }, "title": { "type": "string", "maxLength": 254 }, "width": { "type": "integer" } } }, "controllers.UpsertPostRequest": { "type": "object", "required": [ "images", "images_mid", "images_min", "slug", "title" ], "properties": { "category_ids": { "type": "array", "items": { "type": "integer" } }, "content": { "type": "string" }, "format": { "type": "string", "maxLength": 10 }, "height": { "type": "integer" }, "images": { "type": "string" }, "images_mid": { "type": "string" }, "images_min": { "type": "string" }, "quality": { "type": "integer" }, "slug": { "type": "string", "maxLength": 254 }, "tag_ids": { "type": "array", "items": { "type": "integer" } }, "title": { "type": "string", "maxLength": 254 }, "width": { "type": "integer" } } }, "controllers.UpsertProductCategoryRequest": { "type": "object", "required": [ "slug", "title" ], "properties": { "description": { "type": "string" }, "keywords": { "type": "string" }, "parent_id": { "type": "integer" }, "slug": { "type": "string", "maxLength": 254 }, "title": { "type": "string", "maxLength": 254 } } }, "controllers.UpsertProductRequest": { "type": "object", "required": [ "images", "slug", "title" ], "properties": { "category_ids": { "type": "array", "items": { "type": "integer" } }, "content": { "type": "string" }, "format": { "type": "string", "maxLength": 10 }, "height": { "type": "integer" }, "images": { "type": "string" }, "price": { "type": "number" }, "quality": { "type": "integer" }, "slug": { "type": "string", "maxLength": 254 }, "tag_ids": { "type": "array", "items": { "type": "integer" } }, "title": { "type": "string", "maxLength": 254 }, "width": { "type": "integer" } } }, "controllers.UpsertProductTagRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "maxLength": 254 } } }, "controllers.UpsertRateLimitRequest": { "type": "object", "required": [ "max_requests", "name", "window_seconds" ], "properties": { "description": { "type": "string", "maxLength": 255 }, "is_active": { "type": "boolean" }, "max_requests": { "type": "integer", "minimum": 1 }, "name": { "type": "string", "maxLength": 100 }, "updated_by": { "type": "string", "maxLength": 255 }, "window_seconds": { "type": "integer", "minimum": 1 } } }, "controllers.UpsertSettingRequest": { "type": "object", "required": [ "email", "meta_description", "meta_title", "phone", "title", "url" ], "properties": { "address": { "type": "string" }, "b_format": { "type": "string", "maxLength": 10 }, "b_height": { "type": "integer" }, "b_logo": { "type": "string" }, "b_quality": { "type": "integer" }, "b_width": { "type": "integer" }, "copyright": { "type": "string", "maxLength": 254 }, "email": { "type": "string", "maxLength": 254 }, "facebook": { "type": "string", "maxLength": 254 }, "instagram": { "type": "string", "maxLength": 254 }, "is_active": { "type": "boolean" }, "linkedin": { "type": "string", "maxLength": 254 }, "map_embed": { "type": "string" }, "meta_description": { "type": "string", "maxLength": 254 }, "meta_title": { "type": "string", "maxLength": 254 }, "phone": { "type": "string", "maxLength": 254 }, "pinterest": { "type": "string", "maxLength": 254 }, "slogan": { "type": "string", "maxLength": 254 }, "title": { "type": "string", "maxLength": 254 }, "url": { "type": "string", "maxLength": 254 }, "w_format": { "type": "string", "maxLength": 10 }, "w_height": { "type": "integer" }, "w_logo": { "type": "string" }, "w_quality": { "type": "integer" }, "w_width": { "type": "integer" }, "whatsapp": { "type": "string", "maxLength": 254 }, "x": { "type": "string", "maxLength": 254 } } }, "controllers.UpsertTagRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "maxLength": 254 } } } }, "securityDefinitions": { "BearerAuth": { "description": "Paste the access token. Swagger UI sends it as: Bearer \u003ctoken\u003e", "type": "apiKey", "name": "Authorization", "in": "header" } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0", Host: "", BasePath: "/", Schemes: []string{"http", "https"}, Title: "goaresv3 API", Description: "Authentication API for goaresv3.", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }