2035 lines
66 KiB
Go
2035 lines
66 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": {
|
|
"/api/v1/admin": {
|
|
"get": {
|
|
"description": "Get all Admins",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Get all Admins",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Page number",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page size",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.AdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Create Admin",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Create Admin",
|
|
"parameters": [
|
|
{
|
|
"description": "Create admin",
|
|
"name": "manger",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CreateAdminReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/admin/{id}": {
|
|
"get": {
|
|
"description": "Get a single admin by id",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Get admin by id",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.AdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"description": "Update Admin",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Update Admin",
|
|
"parameters": [
|
|
{
|
|
"description": "Update Admin",
|
|
"name": "admin",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateAdminReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/logout": {
|
|
"post": {
|
|
"description": "Logout customer",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Logout customer",
|
|
"parameters": [
|
|
{
|
|
"description": "Logout customer",
|
|
"name": "logout",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.logoutReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/refresh": {
|
|
"post": {
|
|
"description": "Refresh token",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Refresh token",
|
|
"parameters": [
|
|
{
|
|
"description": "tokens",
|
|
"name": "refresh",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.refreshToken"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.loginCustomerRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/logs": {
|
|
"get": {
|
|
"description": "Fetches application logs from MongoDB with pagination, level filtering, and search",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Logs"
|
|
],
|
|
"summary": "Retrieve application logs with filtering and pagination",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Filter logs by level (debug, info, warn, error, dpanic, panic, fatal)",
|
|
"name": "level",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Search term to match against message or fields",
|
|
"name": "search",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 1,
|
|
"description": "Page number for pagination (default: 1)",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 50,
|
|
"description": "Number of items per page (default: 50, max: 100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Paginated list of application logs",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.LogResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/managers/{id}": {
|
|
"put": {
|
|
"description": "Update Managers",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"manager"
|
|
],
|
|
"summary": "Update Managers",
|
|
"parameters": [
|
|
{
|
|
"description": "Update Managers",
|
|
"name": "Managers",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateManagerReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/super-login": {
|
|
"post": {
|
|
"description": "Login super-admin",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Login super-admin",
|
|
"parameters": [
|
|
{
|
|
"description": "Login super-admin",
|
|
"name": "login",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.loginAdminReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.LoginAdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/t-approver/{id}": {
|
|
"get": {
|
|
"description": "Get a single admin by id",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Get admin by id",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.AdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"description": "Update Admin",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Update Admin",
|
|
"parameters": [
|
|
{
|
|
"description": "Update Admin",
|
|
"name": "admin",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateAdminReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/tenant": {
|
|
"get": {
|
|
"description": "Check if phone number or email exist",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Check if phone number or email exist",
|
|
"parameters": [
|
|
{
|
|
"description": "Check phone number or email exist",
|
|
"name": "checkPhoneEmailExist",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CheckPhoneEmailExistReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CheckPhoneEmailExistRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/delete/{id}": {
|
|
"delete": {
|
|
"description": "Delete a user by their ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Delete user by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/resetPassword": {
|
|
"post": {
|
|
"description": "Reset password",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Reset password",
|
|
"parameters": [
|
|
{
|
|
"description": "Reset password",
|
|
"name": "resetPassword",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.ResetPasswordReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/search": {
|
|
"post": {
|
|
"description": "Search for user using name or phone",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Search for user using name or phone",
|
|
"parameters": [
|
|
{
|
|
"description": "Search for using his name or phone",
|
|
"name": "searchUserByNameOrPhone",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.SearchUserByNameOrPhoneReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.UserProfileRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/sendResetCode": {
|
|
"post": {
|
|
"description": "Send reset code",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Send reset code",
|
|
"parameters": [
|
|
{
|
|
"description": "Send reset code",
|
|
"name": "resetCode",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.ResetCodeReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/single/{id}": {
|
|
"get": {
|
|
"description": "Get a single user by id",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Get user by id",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.UserProfileRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/suspend": {
|
|
"post": {
|
|
"description": "Suspend or unsuspend a user",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Suspend or unsuspend a user",
|
|
"parameters": [
|
|
{
|
|
"description": "Suspend or unsuspend a user",
|
|
"name": "updateUserSuspend",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.UpdateUserSuspendReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.UpdateUserSuspendRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/admin-login": {
|
|
"post": {
|
|
"description": "Login customer",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Login customer",
|
|
"parameters": [
|
|
{
|
|
"description": "Login admin",
|
|
"name": "login",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.loginAdminReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.LoginAdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/customer-login": {
|
|
"post": {
|
|
"description": "Login customer",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Login customer",
|
|
"parameters": [
|
|
{
|
|
"description": "Login customer",
|
|
"name": "login",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.loginCustomerReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.loginCustomerRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/admin-profile": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "Get user profile",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Get user profile",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.AdminProfileRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/checkPhoneEmailExist": {
|
|
"post": {
|
|
"description": "Check if phone number or email exist",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Check if phone number or email exist",
|
|
"parameters": [
|
|
{
|
|
"description": "Check phone number or email exist",
|
|
"name": "checkPhoneEmailExist",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CheckPhoneEmailExistReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CheckPhoneEmailExistRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/customer-profile": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "Get user profile",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Get user profile",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CustomerProfileRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/register": {
|
|
"post": {
|
|
"description": "Register user",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Register user",
|
|
"parameters": [
|
|
{
|
|
"description": "Register user",
|
|
"name": "registerUser",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.RegisterUserReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/resetPassword": {
|
|
"post": {
|
|
"description": "Reset tenant password",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Reset tenant password",
|
|
"parameters": [
|
|
{
|
|
"description": "Reset password",
|
|
"name": "resetPassword",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.ResetPasswordReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/search": {
|
|
"post": {
|
|
"description": "Search for user using name or phone",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Search for user using name or phone",
|
|
"parameters": [
|
|
{
|
|
"description": "Search for using his name or phone",
|
|
"name": "searchUserByNameOrPhone",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.SearchUserByNameOrPhoneReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.UserProfileRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/sendRegisterCode": {
|
|
"post": {
|
|
"description": "Send register code",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Send register code",
|
|
"parameters": [
|
|
{
|
|
"description": "Send register code",
|
|
"name": "registerCode",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.RegisterCodeReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/sendResetCode": {
|
|
"post": {
|
|
"description": "Send reset code",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Send reset code",
|
|
"parameters": [
|
|
{
|
|
"description": "Send reset code",
|
|
"name": "resetCode",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.ResetCodeReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"domain.ErrorResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.LogEntry": {
|
|
"type": "object",
|
|
"properties": {
|
|
"caller": {
|
|
"type": "string"
|
|
},
|
|
"env": {
|
|
"type": "string"
|
|
},
|
|
"fields": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
},
|
|
"level": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"service": {
|
|
"type": "string"
|
|
},
|
|
"stacktrace": {
|
|
"type": "string"
|
|
},
|
|
"timestamp": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.LogResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.LogEntry"
|
|
}
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"pagination": {
|
|
"$ref": "#/definitions/domain.Pagination"
|
|
}
|
|
}
|
|
},
|
|
"domain.Pagination": {
|
|
"type": "object",
|
|
"properties": {
|
|
"current_page": {
|
|
"type": "integer"
|
|
},
|
|
"limit": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
},
|
|
"total_pages": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.Role": {
|
|
"type": "string",
|
|
"enum": [
|
|
"super_admin",
|
|
"admin",
|
|
"student",
|
|
"instructor",
|
|
"support"
|
|
],
|
|
"x-enum-varnames": [
|
|
"RoleSuperAdmin",
|
|
"RoleAdmin",
|
|
"RoleStudent",
|
|
"RoleInstructor",
|
|
"RoleSupport"
|
|
]
|
|
},
|
|
"handlers.AdminProfileRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"email_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_login": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
},
|
|
"phone_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"role": {
|
|
"$ref": "#/definitions/domain.Role"
|
|
},
|
|
"suspended": {
|
|
"type": "boolean"
|
|
},
|
|
"suspended_at": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.AdminRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"email_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_login": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
},
|
|
"phone_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"role": {
|
|
"$ref": "#/definitions/domain.Role"
|
|
},
|
|
"suspended": {
|
|
"type": "boolean"
|
|
},
|
|
"suspended_at": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.CheckPhoneEmailExistReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.CheckPhoneEmailExistRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email_exist": {
|
|
"type": "boolean"
|
|
},
|
|
"phone_number_exist": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handlers.CreateAdminReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_id": {
|
|
"type": "integer",
|
|
"example": 1
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"first_name": {
|
|
"type": "string",
|
|
"example": "John"
|
|
},
|
|
"last_name": {
|
|
"type": "string",
|
|
"example": "Doe"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"example": "password123"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.CustomerProfileRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"email_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_login": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
},
|
|
"phone_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"referral_code": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"$ref": "#/definitions/domain.Role"
|
|
},
|
|
"suspended": {
|
|
"type": "boolean"
|
|
},
|
|
"suspended_at": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.LoginAdminRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.RegisterCodeReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.RegisterUserReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"first_name": {
|
|
"type": "string",
|
|
"example": "John"
|
|
},
|
|
"last_name": {
|
|
"type": "string",
|
|
"example": "Doe"
|
|
},
|
|
"otp": {
|
|
"type": "string",
|
|
"example": "123456"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"example": "password123"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
},
|
|
"referral_code": {
|
|
"type": "string",
|
|
"example": "ABC123"
|
|
}
|
|
}
|
|
},
|
|
"handlers.ResetCodeReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.ResetPasswordReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"otp",
|
|
"password"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"otp": {
|
|
"type": "string",
|
|
"example": "123456"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"minLength": 8,
|
|
"example": "newpassword123"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.SearchUserByNameOrPhoneReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"query": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"$ref": "#/definitions/domain.Role"
|
|
}
|
|
}
|
|
},
|
|
"handlers.UpdateUserSuspendReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"user_id"
|
|
],
|
|
"properties": {
|
|
"suspended": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"user_id": {
|
|
"type": "integer",
|
|
"example": 123
|
|
}
|
|
}
|
|
},
|
|
"handlers.UpdateUserSuspendRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"suspended": {
|
|
"type": "boolean"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handlers.UserProfileRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"email_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_login": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
},
|
|
"phone_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"referral_code": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"$ref": "#/definitions/domain.Role"
|
|
},
|
|
"suspended": {
|
|
"type": "boolean"
|
|
},
|
|
"suspended_at": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.loginAdminReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"password"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"example": "password123"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.loginCustomerReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"password"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"example": "password123"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.loginCustomerRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.logoutReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"refresh_token"
|
|
],
|
|
"properties": {
|
|
"refresh_token": {
|
|
"type": "string",
|
|
"example": "\u003crefresh-token\u003e"
|
|
}
|
|
}
|
|
},
|
|
"handlers.refreshToken": {
|
|
"type": "object",
|
|
"required": [
|
|
"access_token",
|
|
"refresh_token"
|
|
],
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string",
|
|
"example": "\u003cjwt-token\u003e"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string",
|
|
"example": "\u003crefresh-token\u003e"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateAdminReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_id": {
|
|
"type": "integer",
|
|
"example": 1
|
|
},
|
|
"first_name": {
|
|
"type": "string",
|
|
"example": "John"
|
|
},
|
|
"last_name": {
|
|
"type": "string",
|
|
"example": "Doe"
|
|
},
|
|
"suspended": {
|
|
"type": "boolean",
|
|
"example": false
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateManagerReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_id": {
|
|
"type": "integer",
|
|
"example": 1
|
|
},
|
|
"first_name": {
|
|
"type": "string",
|
|
"example": "John"
|
|
},
|
|
"last_name": {
|
|
"type": "string",
|
|
"example": "Doe"
|
|
},
|
|
"suspended": {
|
|
"type": "boolean",
|
|
"example": false
|
|
}
|
|
}
|
|
},
|
|
"response.APIResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"metadata": {},
|
|
"page": {
|
|
"type": "integer"
|
|
},
|
|
"status": {
|
|
"$ref": "#/definitions/response.Status"
|
|
},
|
|
"timestamp": {
|
|
"type": "string"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"response.Status": {
|
|
"type": "string",
|
|
"enum": [
|
|
"error",
|
|
"success"
|
|
],
|
|
"x-enum-varnames": [
|
|
"Error",
|
|
"Success"
|
|
]
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"Bearer": {
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
}
|
|
}`
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = &swag.Spec{
|
|
Version: "1.0.1",
|
|
Host: "",
|
|
BasePath: "",
|
|
Schemes: []string{},
|
|
Title: "Yimaru API",
|
|
Description: "This is server for Yimaru.",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate,
|
|
LeftDelim: "{{",
|
|
RightDelim: "}}",
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
}
|