From 7f8277d89c8d60a91fded6d4095de9e789c61838 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Mon, 24 Apr 2023 18:05:38 +0300 Subject: doc: map summary and leaderboard endpoints (#38) --- docs/docs.go | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 170 insertions(+), 11 deletions(-) (limited to 'docs/docs.go') diff --git a/docs/docs.go b/docs/docs.go index b708f2b..022814a 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -21,6 +21,46 @@ const docTemplate = `{ "basePath": "{{.BasePath}}", "paths": { "/demo": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "rankings" + ], + "summary": "Get rankings of every player.", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/models.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/models.RankingsResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.Response" + } + } + } + } + }, + "/demos": { "get": { "consumes": [ "application/json" @@ -97,7 +137,7 @@ const docTemplate = `{ } } }, - "/maps/{id}": { + "/maps/{id}/leaderboards": { "get": { "consumes": [ "application/json" @@ -108,7 +148,7 @@ const docTemplate = `{ "tags": [ "maps" ], - "summary": "Get map page with specified id.", + "summary": "Get map leaderboards with specified id.", "parameters": [ { "type": "integer", @@ -130,7 +170,19 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/models.Map" + "allOf": [ + { + "$ref": "#/definitions/models.Map" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/models.MapRecords" + } + } + } + ] } } } @@ -239,6 +291,67 @@ const docTemplate = `{ } } }, + "/maps/{id}/summary": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "maps" + ], + "summary": "Get map summary with specified id.", + "parameters": [ + { + "type": "integer", + "description": "Map ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/models.Response" + }, + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/definitions/models.Map" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/models.MapSummary" + } + } + } + ] + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.Response" + } + } + } + } + }, "/profile": { "get": { "consumes": [ @@ -407,7 +520,7 @@ const docTemplate = `{ } } }, - "/user/{id}": { + "/users/{id}": { "get": { "consumes": [ "application/json" @@ -475,24 +588,70 @@ const docTemplate = `{ "models.Map": { "type": "object", "properties": { + "chapter_name": { + "type": "string" + }, + "data": {}, + "game_name": { + "type": "string" + }, "id": { "type": "integer" }, - "is_coop": { - "type": "boolean" - }, - "name": { + "map_name": { "type": "string" + } + } + }, + "models.MapCategoryScores": { + "type": "object", + "properties": { + "any": { + "type": "integer" + }, + "cm": { + "type": "integer" }, - "records": {}, - "wr_score": { + "inbounds_sla": { "type": "integer" }, - "wr_time": { + "no_sla": { "type": "integer" } } }, + "models.MapRecords": { + "type": "object", + "properties": { + "records": {} + } + }, + "models.MapSummary": { + "type": "object", + "properties": { + "category_scores": { + "$ref": "#/definitions/models.MapCategoryScores" + }, + "description": { + "type": "string" + }, + "first_completion": { + "type": "string" + }, + "rating": { + "type": "number" + }, + "routers": { + "type": "array", + "items": { + "type": "string" + } + }, + "showcase": { + "type": "string" + } + } + }, "models.ProfileResponse": { "type": "object", "properties": { -- cgit v1.2.3