{ "swagger": "2.0", "info": { "description": "This is an auto-generated API Docs.", "title": "API", "contact": { "name": "Dedi Hartono", "email": "dedihartono801@mail.com" }, "version": "1.0" }, "paths": { "/admin": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Get Profile Admin", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Admin" } } } } }, "/admin/create": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Create Admin", "parameters": [ { "description": "body raw", "name": "raw", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Admin" } } } } }, "/admin/login": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Login admin", "parameters": [ { "description": "body raw", "name": "raw", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Admin" } } } } }, "/books": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "books" ], "summary": "List book", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/entity.Book" } } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "books" ], "summary": "Create book", "parameters": [ { "description": "body raw", "name": "raw", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Book" } } } } }, "/books/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "books" ], "summary": "Find book", "parameters": [ { "type": "string", "description": "ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Book" } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "books" ], "summary": "Update book", "parameters": [ { "type": "string", "description": "ID", "name": "id", "in": "path", "required": true }, { "description": "body raw", "name": "raw", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Book" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "books" ], "summary": "Delete book", "parameters": [ { "type": "string", "description": "ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" } } } }, "/checkout": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "checkout" ], "summary": "Checkout Items", "parameters": [ { "description": "body raw", "name": "raw", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/entity.Transaction" } } } } }, "/product": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "product" ], "summary": "List Product", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.ProductDto" } } } } }, "/sku": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "skus" ], "summary": "List sku", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/entity.Sku" } } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "skus" ], "summary": "Create sku", "parameters": [ { "description": "body raw", "name": "raw", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Sku" } } } } }, "/users": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "List user", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/entity.User" } } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Create user", "parameters": [ { "description": "body raw", "name": "raw", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.User" } } } } }, "/users/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Find user", "parameters": [ { "type": "string", "description": "ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.User" } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Update user", "parameters": [ { "type": "string", "description": "ID", "name": "id", "in": "path", "required": true }, { "description": "body raw", "name": "raw", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.User" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Delete user", "parameters": [ { "type": "string", "description": "ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" } } } } }, "definitions": { "dto.ProductDto": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "stock": { "type": "string" } } }, "entity.Admin": { "type": "object", "required": [ "email", "name", "password" ], "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "password": { "type": "string" }, "updated_at": { "type": "string" } } }, "entity.Book": { "type": "object", "required": [ "author", "title" ], "properties": { "author": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "string" }, "title": { "type": "string" }, "updatedAt": { "type": "string" } } }, "entity.Sku": { "type": "object", "required": [ "name", "price", "stock" ], "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "price": { "type": "integer" }, "stock": { "type": "integer" }, "updated_at": { "type": "string" } } }, "entity.Transaction": { "type": "object", "required": [ "admin_id", "total_quantity", "total_transaction" ], "properties": { "admin_id": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "total_quantity": { "type": "integer" }, "total_transaction": { "type": "integer" }, "updated_at": { "type": "string" } } }, "entity.User": { "type": "object", "required": [ "email", "name" ], "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "updated_at": { "type": "string" } } } }, "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }