From 937160bfda2c8edc5ff5dd73899b517bb0ceb515 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Wed, 3 May 2023 16:05:30 +0300 Subject: fix: sql typos, routing change --- docs/docs.go | 67 ++++++++++++++++++++++++++++++++----------------------- docs/swagger.json | 67 ++++++++++++++++++++++++++++++++----------------------- docs/swagger.yaml | 53 ++++++++++++++++++++++++------------------- 3 files changed, 108 insertions(+), 79 deletions(-) (limited to 'docs') diff --git a/docs/docs.go b/docs/docs.go index 164db20..cd129f0 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -26,13 +26,13 @@ const docTemplate = `{ "application/json" ], "tags": [ - "chapters" + "games \u0026 chapters" ], - "summary": "Get chapters from the specified game id.", + "summary": "Get maps from the specified chapter id.", "parameters": [ { "type": "integer", - "description": "Game ID", + "description": "Chapter ID", "name": "id", "in": "path", "required": true @@ -50,7 +50,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/models.ChaptersResponse" + "$ref": "#/definitions/models.ChapterMapsResponse" } } } @@ -146,7 +146,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "games" + "games \u0026 chapters" ], "summary": "Get games from the leaderboards.", "responses": { @@ -180,18 +180,24 @@ const docTemplate = `{ } } }, - "/login": { + "/games/{id}": { "get": { - "consumes": [ - "application/json" - ], "produces": [ "application/json" ], "tags": [ - "login" + "games \u0026 chapters" + ], + "summary": "Get chapters from the specified game id.", + "parameters": [ + { + "type": "integer", + "description": "Game ID", + "name": "id", + "in": "path", + "required": true + } ], - "summary": "Get (redirect) login page for Steam auth.", "responses": { "200": { "description": "OK", @@ -204,7 +210,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/models.LoginResponse" + "$ref": "#/definitions/models.ChaptersResponse" } } } @@ -220,24 +226,18 @@ const docTemplate = `{ } } }, - "/maps/{id}": { + "/login": { "get": { + "consumes": [ + "application/json" + ], "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 - } + "login" ], + "summary": "Get (redirect) login page for Steam auth.", "responses": { "200": { "description": "OK", @@ -250,10 +250,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "type": "array", - "items": { - "$ref": "#/definitions/models.MapShort" - } + "$ref": "#/definitions/models.LoginResponse" } } } @@ -751,6 +748,20 @@ const docTemplate = `{ } } }, + "models.ChapterMapsResponse": { + "type": "object", + "properties": { + "chapter": { + "$ref": "#/definitions/models.Chapter" + }, + "maps": { + "type": "array", + "items": { + "$ref": "#/definitions/models.MapShort" + } + } + } + }, "models.ChaptersResponse": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 653d52f..442745f 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -19,13 +19,13 @@ "application/json" ], "tags": [ - "chapters" + "games \u0026 chapters" ], - "summary": "Get chapters from the specified game id.", + "summary": "Get maps from the specified chapter id.", "parameters": [ { "type": "integer", - "description": "Game ID", + "description": "Chapter ID", "name": "id", "in": "path", "required": true @@ -43,7 +43,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/models.ChaptersResponse" + "$ref": "#/definitions/models.ChapterMapsResponse" } } } @@ -139,7 +139,7 @@ "application/json" ], "tags": [ - "games" + "games \u0026 chapters" ], "summary": "Get games from the leaderboards.", "responses": { @@ -173,18 +173,24 @@ } } }, - "/login": { + "/games/{id}": { "get": { - "consumes": [ - "application/json" - ], "produces": [ "application/json" ], "tags": [ - "login" + "games \u0026 chapters" + ], + "summary": "Get chapters from the specified game id.", + "parameters": [ + { + "type": "integer", + "description": "Game ID", + "name": "id", + "in": "path", + "required": true + } ], - "summary": "Get (redirect) login page for Steam auth.", "responses": { "200": { "description": "OK", @@ -197,7 +203,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/models.LoginResponse" + "$ref": "#/definitions/models.ChaptersResponse" } } } @@ -213,24 +219,18 @@ } } }, - "/maps/{id}": { + "/login": { "get": { + "consumes": [ + "application/json" + ], "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 - } + "login" ], + "summary": "Get (redirect) login page for Steam auth.", "responses": { "200": { "description": "OK", @@ -243,10 +243,7 @@ "type": "object", "properties": { "data": { - "type": "array", - "items": { - "$ref": "#/definitions/models.MapShort" - } + "$ref": "#/definitions/models.LoginResponse" } } } @@ -744,6 +741,20 @@ } } }, + "models.ChapterMapsResponse": { + "type": "object", + "properties": { + "chapter": { + "$ref": "#/definitions/models.Chapter" + }, + "maps": { + "type": "array", + "items": { + "$ref": "#/definitions/models.MapShort" + } + } + } + }, "models.ChaptersResponse": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 88f2d7f..fa1a26d 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -7,6 +7,15 @@ definitions: name: type: string type: object + models.ChapterMapsResponse: + properties: + chapter: + $ref: '#/definitions/models.Chapter' + maps: + items: + $ref: '#/definitions/models.MapShort' + type: array + type: object models.ChaptersResponse: properties: chapters: @@ -195,7 +204,7 @@ paths: /chapters/{id}: get: parameters: - - description: Game ID + - description: Chapter ID in: path name: id required: true @@ -210,15 +219,15 @@ paths: - $ref: '#/definitions/models.Response' - properties: data: - $ref: '#/definitions/models.ChaptersResponse' + $ref: '#/definitions/models.ChapterMapsResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get chapters from the specified game id. + summary: Get maps from the specified chapter id. tags: - - chapters + - games & chapters /demo: get: produces: @@ -286,11 +295,15 @@ paths: $ref: '#/definitions/models.Response' summary: Get games from the leaderboards. tags: - - games - /login: + - games & chapters + /games/{id}: get: - consumes: - - application/json + parameters: + - description: Game ID + in: path + name: id + required: true + type: integer produces: - application/json responses: @@ -301,23 +314,19 @@ paths: - $ref: '#/definitions/models.Response' - properties: data: - $ref: '#/definitions/models.LoginResponse' + $ref: '#/definitions/models.ChaptersResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get (redirect) login page for Steam auth. + summary: Get chapters from the specified game id. tags: - - login - /maps/{id}: + - games & chapters + /login: get: - parameters: - - description: Chapter ID - in: path - name: id - required: true - type: integer + consumes: + - application/json produces: - application/json responses: @@ -328,17 +337,15 @@ paths: - $ref: '#/definitions/models.Response' - properties: data: - items: - $ref: '#/definitions/models.MapShort' - type: array + $ref: '#/definitions/models.LoginResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get maps from the specified chapter id. + summary: Get (redirect) login page for Steam auth. tags: - - maps + - login /maps/{id}/leaderboards: get: parameters: -- cgit v1.2.3