From 0a2c6021e36be31aaffe8ace232179e2211b3140 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 2 May 2023 23:25:48 +0300 Subject: feat: game, chapter, map endpoints for records page --- docs/docs.go | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 222 insertions(+), 6 deletions(-) (limited to 'docs/docs.go') diff --git a/docs/docs.go b/docs/docs.go index 22d4362..788ca3d 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -20,6 +20,55 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { + "/chapters/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "chapters" + ], + "summary": "Get chapters from the specified game id.", + "parameters": [ + { + "type": "integer", + "description": "Game ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/models.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Chapter" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.Response" + } + } + } + } + }, "/demo": { "get": { "produces": [ @@ -94,6 +143,46 @@ const docTemplate = `{ } } }, + "/games": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "games" + ], + "summary": "Get games from the leaderboards.", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/models.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Game" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.Response" + } + } + } + } + }, "/login": { "get": { "consumes": [ @@ -134,11 +223,57 @@ const docTemplate = `{ } } }, - "/maps/{id}/leaderboards": { + "/maps/{id}": { "get": { - "consumes": [ + "produces": [ "application/json" ], + "tags": [ + "maps" + ], + "summary": "Get maps from the specified chapter id.", + "parameters": [ + { + "type": "integer", + "description": "Chapter ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/models.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/models.MapShort" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.Response" + } + } + } + } + }, + "/maps/{id}/leaderboards": { + "get": { "produces": [ "application/json" ], @@ -290,9 +425,6 @@ const docTemplate = `{ }, "/maps/{id}/summary": { "get": { - "consumes": [ - "application/json" - ], "produces": [ "application/json" ], @@ -530,7 +662,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/models.Response" + "allOf": [ + { + "$ref": "#/definitions/models.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/models.SearchResponse" + } + } + } + ] } }, "400": { @@ -599,6 +743,31 @@ const docTemplate = `{ } }, "definitions": { + "models.Chapter": { + "type": "object", + "properties": { + "game_id": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "models.Game": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "models.LoginResponse": { "type": "object", "properties": { @@ -662,6 +831,20 @@ const docTemplate = `{ "records": {} } }, + "models.MapShort": { + "type": "object", + "properties": { + "chapter_id": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "models.MapSummary": { "type": "object", "properties": { @@ -784,6 +967,39 @@ const docTemplate = `{ "records": {} } }, + "models.SearchResponse": { + "type": "object", + "properties": { + "maps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + }, + "players": { + "type": "array", + "items": { + "type": "object", + "properties": { + "steam_id": { + "type": "string" + }, + "user_name": { + "type": "string" + } + } + } + } + } + }, "models.UserRanking": { "type": "object", "properties": { -- cgit v1.2.3