Backend/docs/docs.go
2025-09-22 22:12:49 +04:00

26 lines
8.3 KiB
Go

// Code generated by swaggo/swag. DO NOT EDIT.
package docs
import "github.com/swaggo/swag/v2"
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":{"/images/{path}":{"get":{"description":"get image by path","produces":["image/png","image/jpeg"],"summary":"Get an image by path","parameters":[{"type":"string","description":"Path to image","name":"path","in":"query","required":true}],"responses":{"200":{"description":"OK"}}}},"/post":{"get":{"description":"Return first 5 posts","produces":["application/json"],"tags":["post"],"summary":"Get all posts","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/responses.GetListPostResponseItem"}}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}},"post":{"description":"Create new post in blog","consumes":["application/json"],"produces":["application/json"],"tags":["post"],"summary":"Create new post","parameters":[{"description":"Post data","name":"request","in":"body","required":true,"schema":{"$ref":"#/definitions/requests.CreatePostRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/responses.PostResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}}},"/post/offset/{offset}":{"get":{"description":"return 5 posts after first offset posts","produces":["application/json"],"tags":["post"],"summary":"Get posts after offset","parameters":[{"type":"integer","description":"Offset of posts","name":"offset","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/responses.GetListPostResponseItem"}}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}}},"/post/{id}":{"get":{"description":"get post by id","produces":["application/json"],"tags":["post"],"summary":"Get post by id","parameters":[{"type":"string","description":"Id of post","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/responses.PostResponse"}}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}},"put":{"description":"update post content","produces":["application/json"],"tags":["post"],"summary":"Update post content","parameters":[{"type":"string","description":"Id of post","name":"id","in":"path","required":true},{"description":"Post data","name":"request","in":"body","required":true,"schema":{"$ref":"#/definitions/requests.PutPostRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/responses.PostResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}},"delete":{"description":"Delete post by id","produces":["application/json"],"tags":["post"],"summary":"Delete post","parameters":[{"type":"string","description":"Id of post","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}}},"/user/":{"get":{"description":"Return all registered users","produces":["application/json"],"tags":["user"],"summary":"Get all users","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/responses.UserResponse"}}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}},"post":{"description":"Creates new user in system","consumes":["application/json"],"produces":["application/json"],"tags":["user"],"summary":"Create new user","parameters":[{"description":"User data","name":"request","in":"body","required":true,"schema":{"$ref":"#/definitions/requests.CreateUserRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/responses.UserResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}}},"/user/name/{name}":{"get":{"description":"Find user by username","consumes":["application/json"],"produces":["application/json"],"tags":["user"],"summary":"Find user by username","parameters":[{"type":"string","description":"User name","name":"name","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/responses.UserResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}}},"/user/{id}":{"get":{"description":"Find user by id","consumes":["application/json"],"produces":["application/json"],"tags":["user"],"summary":"Find user by id","parameters":[{"type":"string","description":"user id","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/responses.UserResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}},"put":{"description":"Change the user's name and password","consumes":["application/json"],"produces":["application/json"],"tags":["user"],"summary":"Change user","parameters":[{"type":"string","description":"User id","name":"id","in":"path","required":true},{"description":"User data","name":"request","in":"body","required":true,"schema":{"$ref":"#/definitions/requests.PutUserRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/responses.UserResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}},"delete":{"description":"Delete user","produces":["application/json"],"tags":["user"],"summary":"Delete user","parameters":[{"type":"string","description":"User id","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/responses.ErrorResponse"}}}}}},"definitions":{"requests.CreatePostRequest":{"type":"object","required":["content","description","title","userId"],"properties":{"content":{"type":"string","minLength":36},"description":{"type":"string","maxLength":255,"minLength":8},"title":{"type":"string","maxLength":255,"minLength":8},"userId":{"type":"string"}}},"requests.CreateUserRequest":{"type":"object","required":["password","username"],"properties":{"password":{"type":"string","maxLength":32,"minLength":6},"username":{"type":"string","maxLength":32,"minLength":3}}},"requests.PutPostRequest":{"type":"object","properties":{"content":{"type":"string"},"description":{"type":"string"},"title":{"type":"string"}}},"requests.PutUserRequest":{"type":"object","required":["password","username"],"properties":{"password":{"type":"string","maxLength":32,"minLength":6},"username":{"type":"string","maxLength":32,"minLength":3}}},"responses.ErrorResponse":{"type":"object","properties":{"error_code":{"type":"integer"},"message":{"type":"string"}}},"responses.GetListPostResponseItem":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"title":{"type":"string"}}},"responses.PostResponse":{"type":"object","properties":{"content":{"type":"string"},"createdAt":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"title":{"type":"string"},"updatedAt":{"type":"string"},"userId":{"type":"string"}}},"responses.UserResponse":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string"}}}},"securityDefinitions":{"BasicAuth":{"type":"basic"}}}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:8080",
BasePath: "/api/v1",
Schemes: []string{},
Title: "58team blog backend",
Description: "58team blog's backend",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}