// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
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": {
        "/auth/email_registered": {
            "get": {
                "description": "EmailRegistered returns if an email is registered. It is mainly used for client side validation.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "EmailRegistered returns if an email is registered.",
                "parameters": [
                    {
                        "type": "string",
                        "description": "The email registered request.",
                        "name": "email",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email unregistered, with message ` + "`" + `SUCCESS` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "400": {
                        "description": "Validation error",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/response.ValidationError"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "409": {
                        "description": "Email registered, with message ` + "`" + `CONFLICT_EMAIL` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            }
        },
        "/auth/login": {
            "post": {
                "description": "Login into an account using email/username and password. A token will be returned, together with the\nuser's personal data.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Login into an account using email/username and password.",
                "parameters": [
                    {
                        "description": "The login request.",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.LoginRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/response.LoginResponse"
                        }
                    },
                    "400": {
                        "description": "Validation error",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/response.ValidationError"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "403": {
                        "description": "Wrong password, with message ` + "`" + `WRONG_PASSWORD` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "404": {
                        "description": "Wrong username, with message ` + "`" + `WRONG_USERNAME` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            }
        },
        "/auth/password_reset": {
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Do a password reset by email or username. Will check the if the given code is valid, then reset\nthe password, logging out all sessions.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Do a password reset.",
                "parameters": [
                    {
                        "description": "username or email",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.DoResetPasswordRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "email sent",
                        "schema": {
                            "$ref": "#/definitions/response.EmailVerificationResponse"
                        }
                    },
                    "400": {
                        "description": "Validation error",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/response.ValidationError"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "403": {
                        "description": "invalid token, with message ` + "`" + `WRONG_CODE` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "404": {
                        "description": "user not found, with message ` + "`" + `NOT_FOUND` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "408": {
                        "description": "the verification code is used, with message ` + "`" + `CODE_USED` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Request a password reset by email or username. Will check for if the user's email is\nverified, then send an email with a token to reset the password. The token will be valid\nfor 30 minitues.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Request a password reset.",
                "parameters": [
                    {
                        "description": "username or email",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.RequestResetPasswordRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "email sent",
                        "schema": {
                            "$ref": "#/definitions/response.RequestResetPasswordResponse"
                        }
                    },
                    "400": {
                        "description": "Validation error",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/response.ValidationError"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "404": {
                        "description": "user not found, with message ` + "`" + `NOT_FOUND` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "406": {
                        "description": "Email not verified, with message ` + "`" + `EMAIL_NOT_VERIFIED` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            }
        },
        "/auth/register": {
            "post": {
                "description": "Register an account, and login into that account. A token will be returned, together with the\nuser's personal data.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Register an account, and login into that account.",
                "parameters": [
                    {
                        "description": "The register request.",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.RegisterRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/response.RegisterResponse"
                        }
                    },
                    "400": {
                        "description": "Validation error",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/response.ValidationError"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "409": {
                        "description": "Username registered, with message ` + "`" + `WRONG_PASSWORD` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            }
        },
        "/user/email_verification": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Verify a user's email. Will check for if the user's email is\nverified, then send an email with a token to verify The token will be valid\nfor 30 minitues.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Verify a user's email.",
                "parameters": [
                    {
                        "description": "token",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.VerifyEmailRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "email sent",
                        "schema": {
                            "$ref": "#/definitions/response.EmailVerificationResponse"
                        }
                    },
                    "400": {
                        "description": "Validation error",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/response.ValidationError"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "403": {
                        "description": "invalid token, with message ` + "`" + `WRONG_CODE` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "404": {
                        "description": "user not found, with message ` + "`" + `NOT_FOUND` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "408": {
                        "description": "the verification code is used, with message ` + "`" + `CODE_USED` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            }
        },
        "/user/me": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get current user's information.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Get current user's information.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/response.GetMeResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            }
        },
        "/user/resend_email_verification": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Resend a verification email. Will check for if the user's email is already\nverified, then send an email with a token to verify the email. The token will be valid\nfor 30 minitues.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Resend a verification email.",
                "responses": {
                    "200": {
                        "description": "email sent",
                        "schema": {
                            "$ref": "#/definitions/response.ResendEmailVerificationResponse"
                        }
                    },
                    "406": {
                        "description": "Email verified, with message ` + "`" + `EMAIL_VERIFIED` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            }
        },
        "/user/update_email": {
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Change current user's email only if the email is not verified.\nThe new email can not be the same as other users'.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "User"
                ],
                "summary": "Update current user's email if not verified.",
                "parameters": [
                    {
                        "description": "New email",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateEmailRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/response.UpdateEmailResponse"
                        }
                    },
                    "406": {
                        "description": "Email verified, with message ` + "`" + `EMAIL_VERIFIED` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "409": {
                        "description": "New email confilct, with message ` + "`" + `CONFLICT_EMAIL` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            }
        },
        "/user/{id}": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get a specific user's basic information by user id or username.\nIf a user's username happens to be another's id, this API will find the user by ID.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Get specific user's information.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/response.GetUserResponse"
                        }
                    },
                    "404": {
                        "description": "user not found, with message ` + "`" + `NOT_FOUND` + "`" + `",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/response.Response"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "request.DoResetPasswordRequest": {
            "type": "object",
            "required": [
                "password",
                "token",
                "username"
            ],
            "properties": {
                "password": {
                    "type": "string",
                    "maxLength": 30,
                    "minLength": 5
                },
                "token": {
                    "type": "string",
                    "maxLength": 5,
                    "minLength": 5
                },
                "username": {
                    "type": "string",
                    "minLength": 5
                }
            }
        },
        "request.LoginRequest": {
            "type": "object",
            "required": [
                "password",
                "username"
            ],
            "properties": {
                "password": {
                    "description": "The password of the user logging in.",
                    "type": "string",
                    "maxLength": 30,
                    "minLength": 5,
                    "example": "password"
                },
                "remember_me": {
                    "description": "If true, the created token will last longer.",
                    "type": "boolean",
                    "example": false
                },
                "username": {
                    "description": "The username or email of the user logging in.",
                    "type": "string",
                    "maxLength": 30,
                    "minLength": 5,
                    "example": "username"
                }
            }
        },
        "request.RegisterRequest": {
            "type": "object",
            "required": [
                "email",
                "nickname",
                "password",
                "username"
            ],
            "properties": {
                "email": {
                    "type": "string",
                    "maxLength": 320,
                    "minLength": 5
                },
                "nickname": {
                    "type": "string",
                    "maxLength": 30,
                    "minLength": 1
                },
                "password": {
                    "type": "string",
                    "maxLength": 30,
                    "minLength": 5
                },
                "username": {
                    "type": "string",
                    "maxLength": 30,
                    "minLength": 5
                }
            }
        },
        "request.RequestResetPasswordRequest": {
            "type": "object",
            "required": [
                "username"
            ],
            "properties": {
                "username": {
                    "type": "string",
                    "minLength": 5
                }
            }
        },
        "request.UpdateEmailRequest": {
            "type": "object",
            "required": [
                "email"
            ],
            "properties": {
                "email": {
                    "type": "string",
                    "maxLength": 320,
                    "minLength": 5
                }
            }
        },
        "request.VerifyEmailRequest": {
            "type": "object",
            "required": [
                "token"
            ],
            "properties": {
                "token": {
                    "type": "string",
                    "maxLength": 5,
                    "minLength": 5
                }
            }
        },
        "resource.Permission": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "resource.Role": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "permissions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/resource.Permission"
                    }
                },
                "target": {
                    "type": "string"
                },
                "target_id": {
                    "type": "integer"
                }
            }
        },
        "resource.UserForAdmin": {
            "description": "UserForAdmin is a user with additional, credential data, only accessible by people has permission, e.g. admin can access to all user's credential data, and a user can access to his/her credential data.",
            "type": "object",
            "properties": {
                "email": {
                    "description": "Email is the user's email.",
                    "type": "string"
                },
                "id": {
                    "description": "ID is the user's id.",
                    "type": "integer"
                },
                "nickname": {
                    "description": "Nickname is the user's nickname, usually the student name if used in schools.",
                    "type": "string"
                },
                "roles": {
                    "description": "Role is the user's role, and is used to obtain the permissions of a user.",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/resource.Role"
                    }
                },
                "username": {
                    "description": "Username is the user's username, usually the student ID if used in schools.",
                    "type": "string"
                }
            }
        },
        "response.EmailVerificationResponse": {
            "type": "object",
            "properties": {
                "data": {},
                "error": {},
                "message": {
                    "type": "string"
                }
            }
        },
        "response.GetMeResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "email": {
                            "description": "Email is the user's email.",
                            "type": "string"
                        },
                        "id": {
                            "description": "ID is the user's id.",
                            "type": "integer"
                        },
                        "nickname": {
                            "description": "Nickname is the user's nickname, usually the student name if used in schools.",
                            "type": "string"
                        },
                        "roles": {
                            "description": "Role is the user's role, and is used to obtain the permissions of a user.",
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/resource.Role"
                            }
                        },
                        "username": {
                            "description": "Username is the user's username, usually the student ID if used in schools.",
                            "type": "string"
                        }
                    }
                },
                "error": {},
                "message": {
                    "type": "string"
                }
            }
        },
        "response.GetUserResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "email": {
                            "type": "string"
                        },
                        "id": {
                            "type": "integer"
                        },
                        "nickname": {
                            "type": "string"
                        },
                        "username": {
                            "type": "string"
                        }
                    }
                },
                "error": {},
                "message": {
                    "type": "string"
                }
            }
        },
        "response.LoginResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "token": {
                            "type": "string"
                        },
                        "user": {
                            "$ref": "#/definitions/resource.UserForAdmin"
                        }
                    }
                },
                "error": {},
                "message": {
                    "type": "string"
                }
            }
        },
        "response.RegisterResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "token": {
                            "type": "string"
                        },
                        "user": {
                            "$ref": "#/definitions/resource.UserForAdmin"
                        }
                    }
                },
                "error": {},
                "message": {
                    "type": "string"
                }
            }
        },
        "response.RequestResetPasswordResponse": {
            "type": "object",
            "properties": {
                "data": {},
                "error": {},
                "message": {
                    "type": "string"
                }
            }
        },
        "response.ResendEmailVerificationResponse": {
            "type": "object",
            "properties": {
                "data": {},
                "error": {},
                "message": {
                    "type": "string"
                }
            }
        },
        "response.Response": {
            "type": "object",
            "properties": {
                "data": {},
                "error": {},
                "message": {
                    "type": "string"
                }
            }
        },
        "response.UpdateEmailResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "email": {
                            "description": "Email is the user's email.",
                            "type": "string"
                        },
                        "id": {
                            "description": "ID is the user's id.",
                            "type": "integer"
                        },
                        "nickname": {
                            "description": "Nickname is the user's nickname, usually the student name if used in schools.",
                            "type": "string"
                        },
                        "roles": {
                            "description": "Role is the user's role, and is used to obtain the permissions of a user.",
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/resource.Role"
                            }
                        },
                        "username": {
                            "description": "Username is the user's username, usually the student ID if used in schools.",
                            "type": "string"
                        }
                    }
                },
                "error": {},
                "message": {
                    "type": "string"
                }
            }
        },
        "response.ValidationError": {
            "type": "object",
            "properties": {
                "field": {
                    "type": "string"
                },
                "reason": {
                    "type": "string"
                },
                "translation": {
                    "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:          "0.1.0",
	Host:             "",
	BasePath:         "/api",
	Schemes:          []string{},
	Title:            "EduOJ Backend",
	Description:      "The backend module for the EduOJ project.",
	InfoInstanceName: "swagger",
	SwaggerTemplate:  docTemplate,
}

func init() {
	swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
