online-order/docs/docs.go
2023-10-30 03:03:40 +03:30

290 lines
9.0 KiB
Go

// 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",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/products": {
"get": {
"description": "get Products",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Products"
],
"summary": "List Products",
"parameters": [
{
"type": "string",
"format": "email",
"description": "name search by q",
"name": "q",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/entity.ProductDisplay"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
}
}
}
},
"/products/{id}": {
"get": {
"description": "get string by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Products"
],
"summary": "Show an product",
"parameters": [
{
"type": "integer",
"description": "product ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/entity.ProductDisplay"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
}
}
},
"put": {
"description": "update Product by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Products"
],
"summary": "Update an product",
"parameters": [
{
"type": "integer",
"description": "product ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
}
}
},
"delete": {
"description": "Delete Product by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Products"
],
"summary": "Delete an product",
"parameters": [
{
"type": "integer",
"description": "product ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/httputil.HTTPError"
}
}
}
}
}
},
"definitions": {
"entity.ProductDisplay": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"original_price": {
"type": "number"
},
"price": {
"type": "number"
},
"quantity": {
"type": "integer"
},
"status": {
"type": "boolean"
},
"updated_at": {
"type": "string"
}
}
},
"httputil.HTTPError": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 400
},
"message": {
"type": "string",
"example": "status bad request"
}
}
}
},
"securityDefinitions": {
"BasicAuth": {
"type": "basic"
}
},
"externalDocs": {
"description": "OpenAPI",
"url": "https://swagger.io/resources/open-api/"
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:9000",
BasePath: "/api/v1",
Schemes: []string{},
Title: "Swagger Example API",
Description: "This is a sample server celler server.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}