/
Njrctr
/
restapi-todo
Обзор
Документация
Войти
/
Njrctr
/
restapi-todo
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
backend/docs/docs.go
918 строк
30 KB
Noah Black
Add frontend Python on flet lib
17 дек 2024, 11:29
17 дек 2024, 11:29
cfaa9f9
Код
Авторство
О чём код?
// 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/items/{item_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "get item by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "items" ], "summary": "Get Item By Id", "operationId": "get-item-by-id", "parameters": [ { "type": "integer", "description": "Item Id", "name": "item_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.TodoItem" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "update todo item", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "items" ], "summary": "Update todo item", "operationId": "update-item", "parameters": [ { "type": "integer", "description": "Item Id", "name": "item_id", "in": "path", "required": true }, { "description": "item info", "name": "input", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.TodoItemCreateUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "integer" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "delete item", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "items" ], "summary": "Delete Item", "operationId": "delete-item", "parameters": [ { "type": "integer", "description": "Item Id", "name": "item_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } } }, "/api/lists": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "get all lists", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Get All Lists", "operationId": "get-all-lists", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.getAllListsResponce" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "create todo list", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Create todo list", "operationId": "create-list", "parameters": [ { "description": "list info", "name": "input", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.TodoListCreateUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "integer" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } } }, "/api/lists/{list_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "get list by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Get List By Id", "operationId": "get-list-by-id", "parameters": [ { "type": "integer", "description": "List Id", "name": "list_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.TodoList" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "update todo list", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Update todo List", "operationId": "update-list", "parameters": [ { "type": "integer", "description": "List Id", "name": "list_id", "in": "path", "required": true }, { "description": "list info", "name": "input", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.TodoListCreateUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "integer" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "delete list", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Delete List", "operationId": "delete-list", "parameters": [ { "type": "integer", "description": "List Id", "name": "list_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } } }, "/api/lists/{list_id}/items": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "get all items", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "items" ], "summary": "Get All Items", "operationId": "get-all-items", "parameters": [ { "type": "integer", "description": "List Id", "name": "list_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.getAllItemsResponce" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "create todo item", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "items" ], "summary": "Create todo item", "operationId": "create-item", "parameters": [ { "type": "integer", "description": "List Id", "name": "list_id", "in": "path", "required": true }, { "description": "item info", "name": "input", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.TodoItemCreateUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "integer" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } } }, "/auth/sign-in": { "post": { "description": "login", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "SignIn", "operationId": "login", "parameters": [ { "description": "credentials", "name": "input", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.signInInput" } } ], "responses": { "200": { "description": "token", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } } }, "/auth/sign-up": { "post": { "description": "create account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "SignUp", "operationId": "create-account", "parameters": [ { "description": "account info", "name": "input", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.User" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "integer" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/handler.errorResponse" } } } } } }, "definitions": { "handler.errorResponse": { "type": "object", "properties": { "message": { "type": "string" } } }, "handler.getAllItemsResponce": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.TodoItem" } } } }, "handler.getAllListsResponce": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.TodoList" } } } }, "handler.signInInput": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "models.TodoItem": { "type": "object", "required": [ "title" ], "properties": { "description": { "type": "string" }, "done": { "type": "boolean" }, "id": { "type": "integer" }, "title": { "type": "string" } } }, "models.TodoItemCreateUpdate": { "type": "object", "properties": { "description": { "type": "string" }, "done": { "type": "boolean" }, "title": { "type": "string" } } }, "models.TodoList": { "type": "object", "required": [ "title" ], "properties": { "description": { "type": "string" }, "id": { "type": "integer" }, "title": { "type": "string" } } }, "models.TodoListCreateUpdate": { "type": "object", "properties": { "description": { "type": "string" }, "title": { "type": "string" } } }, "models.User": { "type": "object", "required": [ "email", "password", "username" ], "properties": { "email": { "type": "string" }, "password": { "type": "string" }, "username": { "type": "string" } } } }, "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0", Host: "localhost:8080", BasePath: "/", Schemes: []string{}, Title: "Todo App API", Description: "API Server for TodoApp Application", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }