From 79c8ebac2198bae0b208d79224a960c866b6b810 Mon Sep 17 00:00:00 2001 From: Lavysh Alexander Date: Thu, 26 Oct 2023 17:05:03 +0300 Subject: [PATCH] updated api docs --- cmd/api/docs/docs.go | 89 +++++++++++++++++++++++++++++++++++++-- cmd/api/docs/swagger.json | 86 +++++++++++++++++++++++++++++++++++++ cmd/api/docs/swagger.yaml | 62 +++++++++++++++++++++++++++ 3 files changed, 234 insertions(+), 3 deletions(-) diff --git a/cmd/api/docs/docs.go b/cmd/api/docs/docs.go index 226b7492..1ac07ce9 100644 --- a/cmd/api/docs/docs.go +++ b/cmd/api/docs/docs.go @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: 2023 PK Lab AG -// SPDX-License-Identifier: MIT - // Package docs Code generated by swaggo/swag. DO NOT EDIT package docs @@ -153,6 +150,78 @@ const docTemplate = `{ } } }, + "/v1/address/{hash}/messages": { + "get": { + "description": "Get address messages", + "produces": [ + "application/json" + ], + "tags": [ + "address" + ], + "summary": "Get address messages", + "operationId": "address-messages", + "parameters": [ + { + "maxLength": 48, + "minLength": 48, + "type": "string", + "description": "Hash", + "name": "hash", + "in": "path", + "required": true + }, + { + "maximum": 100, + "minimum": 1, + "type": "integer", + "description": "Count of requested entities", + "name": "limit", + "in": "query" + }, + { + "minimum": 1, + "type": "integer", + "description": "Offset", + "name": "offset", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "Sort order", + "name": "sort", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/responses.Message" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handler.Error" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handler.Error" + } + } + } + } + }, "/v1/address/{hash}/txs": { "get": { "description": "Get address transactions", @@ -165,14 +234,25 @@ const docTemplate = `{ "summary": "Get address transactions", "operationId": "address-transactions", "parameters": [ + { + "maxLength": 48, + "minLength": 48, + "type": "string", + "description": "Hash", + "name": "hash", + "in": "path", + "required": true + }, { "maximum": 100, + "minimum": 1, "type": "integer", "description": "Count of requested entities", "name": "limit", "in": "query" }, { + "minimum": 1, "type": "integer", "description": "Offset", "name": "offset", @@ -237,18 +317,21 @@ const docTemplate = `{ "in": "query" }, { + "minimum": 1, "type": "integer", "description": "Time from in unix timestamp", "name": "from", "in": "query" }, { + "minimum": 1, "type": "integer", "description": "Time to in unix timestamp", "name": "to", "in": "query" }, { + "minimum": 1, "type": "integer", "description": "Block number", "name": "height", diff --git a/cmd/api/docs/swagger.json b/cmd/api/docs/swagger.json index 6d4652d9..1419ea8e 100644 --- a/cmd/api/docs/swagger.json +++ b/cmd/api/docs/swagger.json @@ -144,6 +144,78 @@ } } }, + "/v1/address/{hash}/messages": { + "get": { + "description": "Get address messages", + "produces": [ + "application/json" + ], + "tags": [ + "address" + ], + "summary": "Get address messages", + "operationId": "address-messages", + "parameters": [ + { + "maxLength": 48, + "minLength": 48, + "type": "string", + "description": "Hash", + "name": "hash", + "in": "path", + "required": true + }, + { + "maximum": 100, + "minimum": 1, + "type": "integer", + "description": "Count of requested entities", + "name": "limit", + "in": "query" + }, + { + "minimum": 1, + "type": "integer", + "description": "Offset", + "name": "offset", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "Sort order", + "name": "sort", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/responses.Message" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handler.Error" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handler.Error" + } + } + } + } + }, "/v1/address/{hash}/txs": { "get": { "description": "Get address transactions", @@ -156,14 +228,25 @@ "summary": "Get address transactions", "operationId": "address-transactions", "parameters": [ + { + "maxLength": 48, + "minLength": 48, + "type": "string", + "description": "Hash", + "name": "hash", + "in": "path", + "required": true + }, { "maximum": 100, + "minimum": 1, "type": "integer", "description": "Count of requested entities", "name": "limit", "in": "query" }, { + "minimum": 1, "type": "integer", "description": "Offset", "name": "offset", @@ -228,18 +311,21 @@ "in": "query" }, { + "minimum": 1, "type": "integer", "description": "Time from in unix timestamp", "name": "from", "in": "query" }, { + "minimum": 1, "type": "integer", "description": "Time to in unix timestamp", "name": "to", "in": "query" }, { + "minimum": 1, "type": "integer", "description": "Block number", "name": "height", diff --git a/cmd/api/docs/swagger.yaml b/cmd/api/docs/swagger.yaml index 4a43f04b..92eef154 100644 --- a/cmd/api/docs/swagger.yaml +++ b/cmd/api/docs/swagger.yaml @@ -712,18 +712,77 @@ paths: summary: Get address info tags: - address + /v1/address/{hash}/messages: + get: + description: Get address messages + operationId: address-messages + parameters: + - description: Hash + in: path + maxLength: 48 + minLength: 48 + name: hash + required: true + type: string + - description: Count of requested entities + in: query + maximum: 100 + minimum: 1 + name: limit + type: integer + - description: Offset + in: query + minimum: 1 + name: offset + type: integer + - description: Sort order + enum: + - asc + - desc + in: query + name: sort + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/responses.Message' + type: array + "400": + description: Bad Request + schema: + $ref: '#/definitions/handler.Error' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/handler.Error' + summary: Get address messages + tags: + - address /v1/address/{hash}/txs: get: description: Get address transactions operationId: address-transactions parameters: + - description: Hash + in: path + maxLength: 48 + minLength: 48 + name: hash + required: true + type: string - description: Count of requested entities in: query maximum: 100 + minimum: 1 name: limit type: integer - description: Offset in: query + minimum: 1 name: offset type: integer - description: Sort order @@ -777,14 +836,17 @@ paths: type: string - description: Time from in unix timestamp in: query + minimum: 1 name: from type: integer - description: Time to in unix timestamp in: query + minimum: 1 name: to type: integer - description: Block number in: query + minimum: 1 name: height type: integer produces: