// 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}}", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "email": "support@beyhan.com" }, "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" }, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/api/v1/admin/categories": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get list of all categories including inactive ones", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "categories" ], "summary": "Get all categories (Admin)", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Category" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new category", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "categories" ], "summary": "Create a new category (Admin)", "parameters": [ { "description": "Category object", "name": "category", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Category" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.Category" } } } } }, "/api/v1/admin/categories/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a single category by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "categories" ], "summary": "Get category by ID (Admin)", "parameters": [ { "type": "integer", "description": "Category ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Category" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing category", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "categories" ], "summary": "Update a category (Admin)", "parameters": [ { "type": "integer", "description": "Category ID", "name": "id", "in": "path", "required": true }, { "description": "Category object", "name": "category", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Category" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Category" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a category by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "categories" ], "summary": "Delete a category (Admin)", "parameters": [ { "type": "integer", "description": "Category ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/categories/{id}/views": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get view count and details for a specific category", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "category-views" ], "summary": "Get view stats for a category (Admin)", "parameters": [ { "type": "integer", "description": "Category ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/v1/admin/category-views": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get paginated list of all category views", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "category-views" ], "summary": "Get all category views (Admin)", "parameters": [ { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "Items per page", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/v1/admin/comments": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get paginated list of all comments", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "comments" ], "summary": "Get all comments (Admin)", "parameters": [ { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "Items per page", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/v1/admin/comments/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a single comment by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "comments" ], "summary": "Get comment by ID (Admin)", "parameters": [ { "type": "integer", "description": "Comment ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Comment" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing comment", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "comments" ], "summary": "Update a comment (Admin)", "parameters": [ { "type": "integer", "description": "Comment ID", "name": "id", "in": "path", "required": true }, { "description": "Comment object", "name": "comment", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Comment" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Comment" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a comment by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "comments" ], "summary": "Delete a comment (Admin)", "parameters": [ { "type": "integer", "description": "Comment ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/cors/blacklist": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all CORS blacklist origins", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Get all CORS blacklist entries (Admin)", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.CorsBlacklist" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Add a new origin to CORS blacklist", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Create CORS blacklist entry (Admin)", "parameters": [ { "description": "Blacklist object", "name": "blacklist", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.CorsBlacklist" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.CorsBlacklist" } } } } }, "/api/v1/admin/cors/blacklist/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing CORS blacklist entry", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Update CORS blacklist entry (Admin)", "parameters": [ { "type": "integer", "description": "Blacklist ID", "name": "id", "in": "path", "required": true }, { "description": "Blacklist object", "name": "blacklist", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.CorsBlacklist" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a CORS blacklist entry", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Delete CORS blacklist entry (Admin)", "parameters": [ { "type": "integer", "description": "Blacklist ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/cors/cache/invalidate": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Clear the CORS cache to force reload from database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Invalidate CORS cache (Admin)", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/cors/whitelist": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all CORS whitelist origins", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Get all CORS whitelist entries (Admin)", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.CorsWhitelist" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Add a new origin to CORS whitelist", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Create CORS whitelist entry (Admin)", "parameters": [ { "description": "Whitelist object", "name": "whitelist", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.CorsWhitelist" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.CorsWhitelist" } } } } }, "/api/v1/admin/cors/whitelist/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing CORS whitelist entry", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Update CORS whitelist entry (Admin)", "parameters": [ { "type": "integer", "description": "Whitelist ID", "name": "id", "in": "path", "required": true }, { "description": "Whitelist object", "name": "whitelist", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.CorsWhitelist" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a CORS whitelist entry", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Delete CORS whitelist entry (Admin)", "parameters": [ { "type": "integer", "description": "Whitelist ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/permissions": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get list of all permissions", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "permissions" ], "summary": "Get all permissions (Admin)", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Permission" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new permission", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "permissions" ], "summary": "Create a new permission (Admin)", "parameters": [ { "description": "Permission object", "name": "permission", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Permission" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.Permission" } } } } }, "/api/v1/admin/posts": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get paginated list of all posts including inactive", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "posts" ], "summary": "Get all posts (Admin)", "parameters": [ { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "Items per page", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new post", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "posts" ], "summary": "Create a new post (Admin)", "parameters": [ { "description": "Post object", "name": "post", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Post" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.Post" } } } } }, "/api/v1/admin/posts/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a single post by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "posts" ], "summary": "Get post by ID (Admin)", "parameters": [ { "type": "integer", "description": "Post ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Post" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing post", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "posts" ], "summary": "Update a post (Admin)", "parameters": [ { "type": "integer", "description": "Post ID", "name": "id", "in": "path", "required": true }, { "description": "Post object", "name": "post", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Post" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Post" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a post by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "posts" ], "summary": "Delete a post (Admin)", "parameters": [ { "type": "integer", "description": "Post ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/rate-limits": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all rate limit configurations", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Get all rate limit settings (Admin)", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.RateLimitSetting" } } } } } }, "/api/v1/admin/rate-limits/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing rate limit configuration", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "settings" ], "summary": "Update rate limit setting (Admin)", "parameters": [ { "type": "integer", "description": "Rate Limit ID", "name": "id", "in": "path", "required": true }, { "description": "Rate limit object", "name": "setting", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.RateLimitSetting" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/roles": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get list of all roles with permissions", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "roles" ], "summary": "Get all roles (Admin)", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Role" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new role", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "roles" ], "summary": "Create a new role (Admin)", "parameters": [ { "description": "Role object", "name": "role", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Role" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.Role" } } } } }, "/api/v1/admin/roles/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a single role by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "roles" ], "summary": "Get role by ID (Admin)", "parameters": [ { "type": "integer", "description": "Role ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Role" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing role", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "roles" ], "summary": "Update a role (Admin)", "parameters": [ { "type": "integer", "description": "Role ID", "name": "id", "in": "path", "required": true }, { "description": "Role object", "name": "role", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Role" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Role" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a role by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "roles" ], "summary": "Delete a role (Admin)", "parameters": [ { "type": "integer", "description": "Role ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/tags": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get list of all tags including inactive ones", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "tags" ], "summary": "Get all tags (Admin)", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Tag" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new tag", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "tags" ], "summary": "Create a new tag (Admin)", "parameters": [ { "description": "Tag object", "name": "tag", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Tag" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.Tag" } } } } }, "/api/v1/admin/tags/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a single tag by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "tags" ], "summary": "Get tag by ID (Admin)", "parameters": [ { "type": "integer", "description": "Tag ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Tag" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing tag", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "tags" ], "summary": "Update a tag (Admin)", "parameters": [ { "type": "integer", "description": "Tag ID", "name": "id", "in": "path", "required": true }, { "description": "Tag object", "name": "tag", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Tag" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Tag" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a tag by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "tags" ], "summary": "Delete a tag (Admin)", "parameters": [ { "type": "integer", "description": "Tag ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/users": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get paginated list of all users", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "users" ], "summary": "Get all users (Admin)", "parameters": [ { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "Items per page", "name": "limit", "in": "query" }, { "type": "boolean", "description": "Include soft-deleted users", "name": "include_deleted", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "users" ], "summary": "Create a new user (Admin)", "parameters": [ { "description": "User object", "name": "user", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.User" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.User" } } } } }, "/api/v1/admin/users/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a single user by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "users" ], "summary": "Get user by ID (Admin)", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "users" ], "summary": "Update a user (Admin)", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true }, { "description": "User object", "name": "user", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.User" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Soft delete a user by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "users" ], "summary": "Delete a user (Admin)", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/users/{id}/restore": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Restore a soft-deleted user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "users" ], "summary": "Restore a deleted user (Admin)", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/users/{id}/roles": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Assign a role to a user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "users" ], "summary": "Assign role to user (Admin)", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true }, { "description": "Role ID", "name": "role_id", "in": "body", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/admin/users/{id}/roles/{role_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Remove a role from a user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "users" ], "summary": "Remove role from user (Admin)", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "Role ID", "name": "role_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/auth/github": { "get": { "description": "Redirect to GitHub OAuth", "produces": [ "application/json" ], "tags": [ "auth", "oauth" ], "summary": "GitHub OAuth login", "responses": {} } }, "/api/v1/auth/github/callback": { "get": { "description": "Handle GitHub OAuth callback", "produces": [ "application/json" ], "tags": [ "auth", "oauth" ], "summary": "GitHub OAuth callback", "parameters": [ { "type": "string", "description": "Authorization code", "name": "code", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "token": { "type": "string" }, "user": { "$ref": "#/definitions/models.User" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/api/v1/auth/google": { "get": { "description": "Redirect to Google OAuth", "produces": [ "application/json" ], "tags": [ "auth", "oauth" ], "summary": "Google OAuth login", "responses": {} } }, "/api/v1/auth/google/callback": { "get": { "description": "Handle Google OAuth callback", "produces": [ "application/json" ], "tags": [ "auth", "oauth" ], "summary": "Google OAuth callback", "parameters": [ { "type": "string", "description": "Authorization code", "name": "code", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "token": { "type": "string" }, "user": { "$ref": "#/definitions/models.User" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/api/v1/auth/login": { "post": { "description": "Login with email and password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Login user", "parameters": [ { "description": "Login credentials", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "token": { "type": "string" }, "user": { "$ref": "#/definitions/models.User" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/api/v1/auth/logout": { "post": { "description": "Logout (client-side token removal)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Logout user", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } }, "/api/v1/auth/me": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get current authenticated user information", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Get current user", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/api/v1/auth/register": { "post": { "description": "Create a new user account with email and password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Register a new user", "parameters": [ { "description": "Registration data", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" }, "username": { "type": "string" } } } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "properties": { "token": { "type": "string" }, "user": { "$ref": "#/definitions/models.User" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/api/v1/categories": { "get": { "description": "Get list of all active categories (public endpoint)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "categories" ], "summary": "Get all active categories", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Category" } } } } } }, "/api/v1/categories/{id}/view": { "post": { "description": "Record a view event for a category (public endpoint)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "category-views" ], "summary": "Track a category view", "parameters": [ { "type": "integer", "description": "Category ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/categories/{slug}": { "get": { "description": "Get a single category by its slug (public endpoint)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "categories" ], "summary": "Get category by slug", "parameters": [ { "type": "string", "description": "Category Slug", "name": "slug", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Category" } } } } }, "/api/v1/posts": { "get": { "description": "Get paginated list of active posts (public endpoint)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Get all active posts", "parameters": [ { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "Items per page", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/v1/posts/{id}/comments": { "get": { "description": "Get all active comments for a specific post (public endpoint)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "comments" ], "summary": "Get comments for a post", "parameters": [ { "type": "integer", "description": "Post ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Comment" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new comment (requires authentication)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "comments" ], "summary": "Create a comment on a post", "parameters": [ { "type": "integer", "description": "Post ID", "name": "id", "in": "path", "required": true }, { "description": "Comment object", "name": "comment", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.Comment" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.Comment" } } } } }, "/api/v1/posts/{slug}": { "get": { "description": "Get a single post by its slug (public endpoint)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Get post by slug", "parameters": [ { "type": "string", "description": "Post Slug", "name": "slug", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Post" } } } } }, "/api/v1/tags": { "get": { "description": "Get list of all active tags (public endpoint)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tags" ], "summary": "Get all active tags", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Tag" } } } } } }, "/api/v1/tags/{slug}": { "get": { "description": "Get a single tag by its slug (public endpoint)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tags" ], "summary": "Get tag by slug", "parameters": [ { "type": "string", "description": "Tag Slug", "name": "slug", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Tag" } } } } }, "/api/v1/user/social-accounts": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all social accounts for the authenticated user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "social-accounts" ], "summary": "Get user's social accounts", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.SocialAccount" } } } } } }, "/api/v1/user/social-accounts/{id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a social account for the authenticated user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "social-accounts" ], "summary": "Delete a social account", "parameters": [ { "type": "integer", "description": "Social Account ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } } }, "definitions": { "models.Category": { "type": "object", "properties": { "children": { "type": "array", "items": { "$ref": "#/definitions/models.Category" } }, "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "image": { "type": "string" }, "is_active": { "type": "boolean" }, "keywords": { "type": "string" }, "order": { "type": "integer" }, "parent": { "$ref": "#/definitions/models.Category" }, "parent_id": { "type": "integer" }, "slug": { "type": "string" }, "title": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.Comment": { "type": "object", "properties": { "body": { "type": "string" }, "children": { "type": "array", "items": { "$ref": "#/definitions/models.Comment" } }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "parent": { "$ref": "#/definitions/models.Comment" }, "parent_id": { "type": "integer" }, "product": { "$ref": "#/definitions/models.Post" }, "product_id": { "type": "integer" }, "slug": { "type": "string" }, "title": { "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "integer" } } }, "models.CorsBlacklist": { "type": "object", "properties": { "created_at": { "type": "string" }, "created_by": { "type": "string" }, "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "origin": { "type": "string" }, "reason": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.CorsWhitelist": { "type": "object", "properties": { "created_at": { "type": "string" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "origin": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.Permission": { "type": "object", "properties": { "description": { "type": "string" }, "id": { "type": "integer" }, "name": { "description": "user:read, user:write", "type": "string" } } }, "models.Post": { "type": "object", "properties": { "categories": { "type": "array", "items": { "$ref": "#/definitions/models.Category" } }, "children": { "type": "array", "items": { "$ref": "#/definitions/models.Post" } }, "content": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "image": { "type": "string" }, "is_active": { "type": "boolean" }, "is_front": { "type": "boolean" }, "keywords": { "type": "string" }, "parent": { "$ref": "#/definitions/models.Post" }, "parent_id": { "type": "integer" }, "slug": { "type": "string" }, "tags": { "type": "array", "items": { "$ref": "#/definitions/models.Tag" } }, "thumb": { "type": "string" }, "title": { "type": "string" }, "updated_at": { "type": "string" }, "user": { "$ref": "#/definitions/models.User" }, "user_id": { "type": "integer" }, "video": { "type": "string" } } }, "models.RateLimitSetting": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "max_requests": { "description": "Max istek sayısı", "type": "integer" }, "name": { "description": "e.g., \"login\", \"register\", \"api\"", "type": "string" }, "updated_at": { "type": "string" }, "updated_by": { "type": "string" }, "window_seconds": { "description": "Zaman penceresi (saniye)", "type": "integer" } } }, "models.Role": { "type": "object", "properties": { "description": { "type": "string" }, "id": { "type": "integer" }, "name": { "description": "admin, user", "type": "string" }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/models.Permission" } } } }, "models.SocialAccount": { "type": "object", "properties": { "avatar_url": { "description": "Avatar URL from provider", "type": "string" }, "created_at": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "integer" }, "name": { "description": "Full name from provider", "type": "string" }, "provider": { "description": "google, github", "type": "string" }, "provider_id": { "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "integer" } } }, "models.Tag": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "slug": { "type": "string" }, "tag": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.User": { "type": "object", "properties": { "avatar": { "description": "Avatar URL from OAuth or uploaded", "type": "string" }, "created_at": { "type": "string" }, "email": { "type": "string" }, "email_verified": { "description": "Email verification: only required for email/password registration; OAuth users are treated as verified\nChanged to *bool to handle false values correctly with GORM defaults", "type": "boolean" }, "email_verified_at": { "type": "string" }, "id": { "type": "integer" }, "roles": { "type": "array", "items": { "$ref": "#/definitions/models.Role" } }, "social_accounts": { "type": "array", "items": { "$ref": "#/definitions/models.SocialAccount" } }, "updated_at": { "type": "string" }, "username": { "type": "string" } } } }, "securityDefinitions": { "BearerAuth": { "description": "Type \"Bearer\" followed by a space and JWT token.", "type": "apiKey", "name": "Authorization", "in": "header" } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "2.0", Host: "localhost:8080", BasePath: "/", Schemes: []string{}, Title: "Beyhan Backend API", Description: "Modular REST API with Blog, Account, and Settings apps", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }