/
avpavlow
/
wallet-api
Обзор
Документация
Войти
/
avpavlow
/
wallet-api
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/docs.go
242 строки
8 KB
aleksey
feat: Добавить swagger-документацию
26 мар 2026, 14:39
26 мар 2026, 14:39
67b881d
Код
Авторство
О чём код?
// 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": { "/accounts": { "post": { "description": "Создает банковский счет для пользователя с начальным балансом", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "accounts" ], "summary": "Создать новый счет", "parameters": [ { "description": "Данные для создания счета", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_avpavlov-cloud_wallet-api_internal_model.CreateAccountRequest" } } ], "responses": { "201": { "description": "Успешное создание", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Ошибка валидации", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Внутренняя ошибка сервера", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/accounts/{id}": { "get": { "description": "Возвращает данные счета и историю последних 5 транзакций", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "accounts" ], "summary": "Получить информацию о счете", "parameters": [ { "type": "integer", "description": "ID счета", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Данные счета и история", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Счет не найден", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Ошибка базы данных", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/transfer": { "post": { "description": "Выполняет перевод денег между двумя счетами в рамках одной транзакции", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transfers" ], "summary": "Перевод денежных средств", "parameters": [ { "description": "Данные перевода", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_avpavlov-cloud_wallet-api_internal_model.TransferRequest" } } ], "responses": { "200": { "description": "Успешный перевод", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Недостаточно средств или неверные ID", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Ошибка транзакции", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } } }, "definitions": { "github_com_avpavlov-cloud_wallet-api_internal_model.CreateAccountRequest": { "type": "object", "required": [ "balance", "currency", "owner_name" ], "properties": { "balance": { "type": "number", "minimum": 0 }, "currency": { "type": "string", "enum": [ "USD", "EUR", "RUB" ] }, "owner_name": { "type": "string" } } }, "github_com_avpavlov-cloud_wallet-api_internal_model.TransferRequest": { "type": "object", "required": [ "amount", "from_account_id", "to_account_id" ], "properties": { "amount": { "type": "number" }, "from_account_id": { "type": "integer" }, "to_account_id": { "type": "integer" } } } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "", Host: "", BasePath: "", Schemes: []string{}, Title: "", Description: "", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }