{ "swagger": "2.0", "info": { "description": "This is a sample server celler server.", "title": "API DOCUMENT ECOMMERCE BACKEND SHOPDEVGO", "termsOfService": "github.com/twinbeard/goLearning", "contact": { "name": "GO LEARNING", "url": "github.com/twinbeard/goLearning", "email": "truongvu.work@gmail.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0.0" }, "host": "localhost:8002", "basePath": "/v1/2024", "paths": { "/user/login": { "post": { "description": "User Login", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account management" ], "summary": "User Login", "parameters": [ { "description": "payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.LoginInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.ResponseData" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.ErrorResponseData" } } } } }, "/user/register": { "post": { "description": "When user is registered, send OTP to user's email", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account management" ], "summary": "User Registration", "parameters": [ { "description": "payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.RegisterInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.ResponseData" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.ErrorResponseData" } } } } }, "/user/two-factor/setup": { "post": { "description": "User Set Up Two Factor Authentication", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account two-factor authentication" ], "summary": "User Set Up Two Factor Authentication", "parameters": [ { "type": "string", "description": "Authorization token", "name": "Authorization", "in": "header", "required": true }, { "description": "payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SetupTwoFactorAuthInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.ResponseData" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.ErrorResponseData" } } } } }, "/user/two-factor/verify": { "post": { "description": "User Verify Two Factor Authentication", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account two-factor authentication" ], "summary": "User Verify Two Factor Authentication", "parameters": [ { "type": "string", "description": "Authorization token", "name": "Authorization", "in": "header", "required": true }, { "description": "payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.TwoFactorVerificationInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.ResponseData" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.ErrorResponseData" } } } } }, "/user/update_pass_register": { "post": { "description": "Update Password From Register", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account management" ], "summary": "Update Password From Register", "parameters": [ { "description": "payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UpdatePasswordRegisterInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.ResponseData" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.ErrorResponseData" } } } } }, "/user/verify_account": { "post": { "description": "Verify OTP Login By User", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account management" ], "summary": "Verify OTP Login By User", "parameters": [ { "description": "payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.VerifyInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.ResponseData" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.ErrorResponseData" } } } } } }, "definitions": { "models.LoginInput": { "type": "object", "properties": { "user_account": { "type": "string" }, "user_password": { "type": "string" } } }, "models.RegisterInput": { "type": "object", "properties": { "verify_key": { "type": "string" }, "verify_purpose": { "type": "string" }, "verify_type": { "type": "integer" } } }, "models.SetupTwoFactorAuthInput": { "type": "object", "properties": { "two_factor_auth_type": { "type": "string" }, "two_factor_email": { "type": "string" }, "user_id": { "type": "integer" } } }, "models.TwoFactorVerificationInput": { "type": "object", "properties": { "two_factor_code_string": { "type": "string" }, "user_id": { "type": "integer" } } }, "models.UpdatePasswordRegisterInput": { "type": "object", "properties": { "user_password": { "type": "string" }, "user_token": { "type": "string" } } }, "models.VerifyInput": { "type": "object", "properties": { "verify_code": { "description": "VerifyCode is verify OPT code", "type": "string" }, "verify_key": { "type": "string" } } }, "response.ErrorResponseData": { "type": "object", "properties": { "code": { "type": "integer" }, "detail": {}, "error": { "type": "string" } } }, "response.ResponseData": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "message": { "type": "string" } } } }, "securityDefinitions": { "BasicAuth": { "type": "basic" } }, "externalDocs": { "description": "OpenAPI", "url": "https://swagger.io/resources/open-api/" } }