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/swagger.yaml | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 133 insertions(+), 5 deletions(-) (limited to 'docs/swagger.yaml') diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f719008..8b66ec8 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,5 +1,21 @@ basePath: /v1 definitions: + models.Chapter: + properties: + game_id: + type: integer + id: + type: integer + name: + type: string + type: object + models.Game: + properties: + id: + type: integer + name: + type: string + type: object models.LoginResponse: properties: token: @@ -41,6 +57,15 @@ definitions: properties: records: {} type: object + models.MapShort: + properties: + chapter_id: + type: integer + id: + type: integer + name: + type: string + type: object models.MapSummary: properties: category_scores: @@ -122,6 +147,27 @@ definitions: type: integer records: {} type: object + models.SearchResponse: + properties: + maps: + items: + properties: + id: + type: integer + name: + type: string + type: object + type: array + players: + items: + properties: + steam_id: + type: string + user_name: + type: string + type: object + type: array + type: object models.UserRanking: properties: total_score: @@ -141,6 +187,35 @@ info: title: Least Portals Database API version: "1.0" paths: + /chapters/{id}: + get: + parameters: + - description: Game ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/models.Response' + - properties: + data: + items: + $ref: '#/definitions/models.Chapter' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.Response' + summary: Get chapters from the specified game id. + tags: + - chapters /demo: get: produces: @@ -186,6 +261,29 @@ paths: summary: Get demo with specified demo uuid. tags: - demo + /games: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/models.Response' + - properties: + data: + items: + $ref: '#/definitions/models.Game' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.Response' + summary: Get games from the leaderboards. + tags: + - games /login: get: consumes: @@ -209,10 +307,37 @@ paths: summary: Get (redirect) login page for Steam auth. tags: - login - /maps/{id}/leaderboards: + /maps/{id}: get: - consumes: + parameters: + - description: Chapter ID + in: path + name: id + required: true + type: integer + produces: - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/models.Response' + - properties: + data: + items: + $ref: '#/definitions/models.MapShort' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.Response' + summary: Get maps from the specified chapter id. + tags: + - maps + /maps/{id}/leaderboards: + get: parameters: - description: Map ID in: path @@ -305,8 +430,6 @@ paths: - maps /maps/{id}/summary: get: - consumes: - - application/json parameters: - description: Map ID in: path @@ -447,7 +570,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/models.Response' + allOf: + - $ref: '#/definitions/models.Response' + - properties: + data: + $ref: '#/definitions/models.SearchResponse' + type: object "400": description: Bad Request schema: -- cgit v1.2.3