/
avpavlow
/
task-service-api
Обзор
Документация
Войти
/
avpavlow
/
task-service-api
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docs/docs.go
503 строки
19 KB
aleksey
doc: Добавить описание d README о swagger; fix: Поправить аннотации swagger
23 авг 2025, 22:36
Не верифицирован
23 авг 2025, 22:36
c5ef94d
Код
Авторство
О чём код?
// 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": { "/login": { "post": { "description": "Аутентификация пользователя и получение JWT токена", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Авторизация пользователя", "parameters": [ { "description": "Данные для входа", "name": "credentials", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.LoginRequest" } } ], "responses": { "200": { "description": "JWT токен и данные пользователя", "schema": { "$ref": "#/definitions/server.LoginResponse" } }, "400": { "description": "Некорректный JSON", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Неверные учетные данные", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/tasks": { "get": { "description": "Получение, создание, обновление и удаление задач", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "Управление задачами", "parameters": [ { "description": "Данные задачи", "name": "task", "in": "body", "schema": { "$ref": "#/definitions/models.Task" } } ], "responses": { "200": { "description": "Список задач или обновленная задача", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Task" } } }, "201": { "description": "Созданная задача", "schema": { "$ref": "#/definitions/models.Task" } }, "204": { "description": "Задача удалена", "schema": { "type": "string" } }, "400": { "description": "Некорректный запрос", "schema": { "type": "string" } }, "401": { "description": "Неавторизован", "schema": { "type": "string" } }, "404": { "description": "Задача не найдена", "schema": { "type": "string" } }, "500": { "description": "Внутренняя ошибка сервера", "schema": { "type": "string" } } } }, "post": { "description": "Получение, создание, обновление и удаление задач", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "Управление задачами", "parameters": [ { "description": "Данные задачи", "name": "task", "in": "body", "schema": { "$ref": "#/definitions/models.Task" } } ], "responses": { "200": { "description": "Список задач или обновленная задача", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Task" } } }, "201": { "description": "Созданная задача", "schema": { "$ref": "#/definitions/models.Task" } }, "204": { "description": "Задача удалена", "schema": { "type": "string" } }, "400": { "description": "Некорректный запрос", "schema": { "type": "string" } }, "401": { "description": "Неавторизован", "schema": { "type": "string" } }, "404": { "description": "Задача не найдена", "schema": { "type": "string" } }, "500": { "description": "Внутренняя ошибка сервера", "schema": { "type": "string" } } } } }, "/tasks/{id}": { "put": { "description": "Получение, создание, обновление и удаление задач", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "Управление задачами", "parameters": [ { "type": "integer", "example": 1, "description": "ID задачи", "name": "id", "in": "path" }, { "description": "Данные задачи", "name": "task", "in": "body", "schema": { "$ref": "#/definitions/models.Task" } } ], "responses": { "200": { "description": "Список задач или обновленная задача", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Task" } } }, "201": { "description": "Созданная задача", "schema": { "$ref": "#/definitions/models.Task" } }, "204": { "description": "Задача удалена", "schema": { "type": "string" } }, "400": { "description": "Некорректный запрос", "schema": { "type": "string" } }, "401": { "description": "Неавторизован", "schema": { "type": "string" } }, "404": { "description": "Задача не найдена", "schema": { "type": "string" } }, "500": { "description": "Внутренняя ошибка сервера", "schema": { "type": "string" } } } }, "delete": { "description": "Получение, создание, обновление и удаление задач", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tasks" ], "summary": "Управление задачами", "parameters": [ { "type": "integer", "example": 1, "description": "ID задачи", "name": "id", "in": "path" }, { "description": "Данные задачи", "name": "task", "in": "body", "schema": { "$ref": "#/definitions/models.Task" } } ], "responses": { "200": { "description": "Список задач или обновленная задача", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Task" } } }, "201": { "description": "Созданная задача", "schema": { "$ref": "#/definitions/models.Task" } }, "204": { "description": "Задача удалена", "schema": { "type": "string" } }, "400": { "description": "Некорректный запрос", "schema": { "type": "string" } }, "401": { "description": "Неавторизован", "schema": { "type": "string" } }, "404": { "description": "Задача не найдена", "schema": { "type": "string" } }, "500": { "description": "Внутренняя ошибка сервера", "schema": { "type": "string" } } } } } }, "definitions": { "models.Task": { "type": "object", "required": [ "status", "title", "user_id" ], "properties": { "created_at": { "description": "Дата создания задачи в формате RFC3339\nexample: \"2025-08-22T17:00:00Z\"", "type": "string" }, "deleted_at": { "description": "Дата soft-удаления задачи в формате RFC3339\nexample: \"2025-08-22T17:00:00Z\"", "type": "string" }, "id": { "description": "ID задачи\nexample: 1", "type": "integer" }, "status": { "description": "Статус задачи\nexample: \"pending\"\nдопустимые значения: pending, in_progress, done", "type": "string", "enum": [ "pending", "in_progress", "done", "todo", "open", "new" ] }, "title": { "description": "Заголовок задачи\nexample: \"Сделать домашку\"\nmin length: 1", "type": "string", "minLength": 1 }, "updated_at": { "description": "Дата обновления задачи в формате RFC3339\nexample: \"2025-08-22T17:00:00Z\"", "type": "string" }, "user_id": { "description": "ID пользователя, которому принадлежит задача\nexample: 42", "type": "integer" } } }, "models.User": { "type": "object", "required": [ "email", "password_hash", "username" ], "properties": { "created_at": { "description": "Дата создания пользователя в формате RFC3339\nexample: \"2025-08-22T17:00:00Z\"", "type": "string" }, "email": { "description": "Электронная почта пользователя\nexample: \"user@example.com\"\nformat: email", "type": "string" }, "id": { "description": "ID пользователя\nexample: 1", "type": "integer" }, "password_hash": { "description": "Хэш пароля пользователя\nexample: \"$2a$10$E0NRl...\"\nmin length: 6", "type": "string", "minLength": 6 }, "username": { "description": "Логин пользователя\nexample: \"user123\"\nmin length: 3\nmax length: 20", "type": "string", "maxLength": 20, "minLength": 3 } } }, "server.LoginRequest": { "type": "object", "required": [ "password", "username" ], "properties": { "password": { "description": "Пароль пользователя\nexample: pass123", "type": "string" }, "username": { "description": "Логин пользователя\nexample: user1", "type": "string" } } }, "server.LoginResponse": { "type": "object", "properties": { "token": { "description": "JWT токен\nexample: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "type": "string" }, "user": { "description": "Данные пользователя", "allOf": [ { "$ref": "#/definitions/models.User" } ] } } } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0", Host: "localhost:8080", BasePath: "/", Schemes: []string{}, Title: "REST API Example", Description: "REST API для пользователей и задач", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }