{ "swagger": "2.0", "info": { "description": "This is the API Gateway service API documentation", "title": "API Gateway Service", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "url": "http://www.swagger.io/support", "email": "nukie.nxk@gmail.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, "host": "127.0.0.1:3000", "basePath": "/api/v1", "paths": { "/account/": { "get": { "description": "Forward get all account request to account service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Forward get all account request to account service", "responses": {} }, "put": { "security": [ { "Bearer": [] } ], "description": "Forward change pin request to account service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Forward change pin request to account service", "parameters": [ { "description": "Change pin information", "name": "account", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.ChangePin" } } ], "responses": { "200": { "description": "Pin changed successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Forward create account request to account service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Forward create account request to account service", "parameters": [ { "description": "Account information", "name": "account", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.CreateAccount" } } ], "responses": { "201": { "description": "Account created successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Forward delete account request to account service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Forward delete account request to account service", "parameters": [ { "description": "Delete account information", "name": "account", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.DeleteAccount" } } ], "responses": { "200": { "description": "Account deleted successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/account/getAccountsByUserID": { "get": { "description": "Forward get accounts by user ID request to account service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Forward get accounts by user ID request to account service", "parameters": [ { "type": "string", "description": "User ID", "name": "user_id", "in": "query", "required": true } ], "responses": { "200": { "description": "List of accounts", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } }, "404": { "description": "Accounts not found", "schema": { "type": "string" } } } } }, "/account/topup": { "put": { "security": [ { "Bearer": [] } ], "description": "Forward top up request to account service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Forward top up request to account service", "parameters": [ { "description": "Top up information", "name": "account", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.TopUp" } } ], "responses": { "200": { "description": "Top up successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/account/verify": { "post": { "security": [ { "Bearer": [] } ], "description": "Forward verify account request to account service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Forward verify account request to account service", "parameters": [ { "description": "Account verify information", "name": "account", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.AccountVerify" } } ], "responses": { "200": { "description": "Account verified successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/account/{id}": { "get": { "description": "Forward get account by ID request to account service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Forward get account by ID request to account service", "parameters": [ { "type": "string", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Account", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/auth/login": { "post": { "description": "Forward login request to user service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Forward login request to user service", "parameters": [ { "description": "User information", "name": "user", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Login" } } ], "responses": { "200": { "description": "User logged in successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/auth/signup": { "post": { "description": "Forward signup request to user service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Forward signup request to user service", "parameters": [ { "description": "User information", "name": "user", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.SignUp" } } ], "responses": { "201": { "description": "User created successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/auth/token": { "get": { "description": "Get token from header", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Get token", "responses": { "200": { "description": "Token", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/payment/": { "get": { "description": "Forward get all payment request to payment service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payment" ], "summary": "Forward get all payment request to payment service", "responses": {} }, "post": { "security": [ { "Bearer": [] } ], "description": "Forward create payment request to payment service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payment" ], "summary": "Forward create payment request to payment service", "parameters": [ { "description": "Payment information", "name": "payment", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.CreatePayment" } } ], "responses": { "201": { "description": "Payment created successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/payment/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Forward get payment by ID request to payment service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payment" ], "summary": "Forward get payment by ID request to payment service", "parameters": [ { "type": "string", "description": "Payment ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Payment information", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/transaction/": { "get": { "description": "Forward get all transaction request to transaction service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transaction" ], "summary": "Forward get all transaction request to transaction service", "responses": {} }, "post": { "security": [ { "Bearer": [] } ], "description": "Forward create transaction request to transaction service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transaction" ], "summary": "Forward create transaction request to transaction service", "parameters": [ { "description": "Transaction information", "name": "transaction", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.CreateTransaction" } } ], "responses": { "201": { "description": "Transaction created successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/transaction/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Forward get transaction by ID request to transaction service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transaction" ], "summary": "Forward get transaction by ID request to transaction service", "parameters": [ { "type": "string", "description": "Transaction ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Transaction information", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/users/all": { "get": { "description": "Forward get all users request to user service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Forward get all users request to user service", "responses": { "200": { "description": "Users", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/users/all/{id}": { "get": { "description": "Forward get user by ID request to user service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Forward get user by ID request to user service", "parameters": [ { "type": "string", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "User", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } }, "/users/me": { "get": { "security": [ { "Bearer": [] } ], "description": "Forward get me request to user service", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Forward get me request to user service", "responses": { "200": { "description": "User", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } } } } } }, "definitions": { "model.AccountVerify": { "type": "object", "properties": { "id": { "type": "string" }, "pin": { "type": "string" } } }, "model.ChangePin": { "type": "object", "properties": { "id": { "type": "string" }, "newPin": { "type": "string" }, "oldPin": { "type": "string" } } }, "model.CreateAccount": { "type": "object", "properties": { "balance": { "type": "number" }, "pin": { "type": "string" }, "type": { "type": "string" } } }, "model.CreatePayment": { "type": "object", "properties": { "amount": { "type": "number" }, "referenceCode": { "type": "string" }, "sourceAccountID": { "type": "string" } } }, "model.CreateTransaction": { "type": "object", "properties": { "amount": { "type": "number" }, "destinationAccountID": { "type": "string" }, "sourceAccountID": { "type": "string" } } }, "model.DeleteAccount": { "type": "object", "properties": { "id": { "type": "string" }, "pin": { "type": "string" } } }, "model.Login": { "type": "object", "properties": { "id": { "type": "string", "example": "111" }, "password": { "type": "string", "example": "password" } } }, "model.SignUp": { "type": "object", "properties": { "address": { "type": "string", "example": "Bangkok" }, "birth_date": { "type": "string", "example": "2004-01-02" }, "id": { "type": "string", "example": "111" }, "name": { "type": "string", "example": "John Doe" }, "password": { "type": "string", "example": "password" } } }, "model.TopUp": { "type": "object", "properties": { "amount": { "type": "number" }, "id": { "type": "string" } } } } }