From c071eeca829a18941fc29f4e4eb8b8f93a65b5c4 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Mon, 3 Jul 2023 23:16:42 +0300 Subject: docs: refactor docs Former-commit-id: 3f3833af352d8758ca509a4fe3badedd5250b1ba --- docs/docs.go | 112 +++++++++++++++++++++++++++--------------------------- docs/swagger.json | 112 +++++++++++++++++++++++++++--------------------------- docs/swagger.yaml | 80 +++++++++++++++++++------------------- 3 files changed, 152 insertions(+), 152 deletions(-) (limited to 'docs') diff --git a/docs/docs.go b/docs/docs.go index bb14382..57984f4 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -22,13 +22,13 @@ const docTemplate = `{ "paths": { "/chapters/{id}": { "get": { + "description": "Get maps from the specified chapter id.", "produces": [ "application/json" ], "tags": [ "games \u0026 chapters" ], - "summary": "Get maps from the specified chapter id.", "parameters": [ { "type": "integer", @@ -66,45 +66,9 @@ const docTemplate = `{ } } }, - "/demo": { - "get": { - "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": { + "description": "Get demo with specified demo uuid.", "consumes": [ "application/json" ], @@ -114,10 +78,9 @@ const docTemplate = `{ "tags": [ "demo" ], - "summary": "Get demo with specified demo uuid.", "parameters": [ { - "type": "integer", + "type": "string", "description": "Demo UUID", "name": "uuid", "in": "query", @@ -142,13 +105,13 @@ const docTemplate = `{ }, "/games": { "get": { + "description": "Get games from the leaderboards.", "produces": [ "application/json" ], "tags": [ "games \u0026 chapters" ], - "summary": "Get games from the leaderboards.", "responses": { "200": { "description": "OK", @@ -182,13 +145,13 @@ const docTemplate = `{ }, "/games/{id}": { "get": { + "description": "Get chapters from the specified game id.", "produces": [ "application/json" ], "tags": [ "games \u0026 chapters" ], - "summary": "Get chapters from the specified game id.", "parameters": [ { "type": "integer", @@ -228,6 +191,7 @@ const docTemplate = `{ }, "/login": { "get": { + "description": "Get (redirect) login page for Steam auth.", "consumes": [ "application/json" ], @@ -237,7 +201,6 @@ const docTemplate = `{ "tags": [ "login" ], - "summary": "Get (redirect) login page for Steam auth.", "responses": { "200": { "description": "OK", @@ -268,13 +231,13 @@ const docTemplate = `{ }, "/maps/{id}/leaderboards": { "get": { + "description": "Get map leaderboards with specified id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Get map leaderboards with specified id.", "parameters": [ { "type": "integer", @@ -326,6 +289,7 @@ const docTemplate = `{ }, "/maps/{id}/record": { "post": { + "description": "Post record with demo of a specific map.", "consumes": [ "multipart/form-data" ], @@ -335,7 +299,6 @@ const docTemplate = `{ "tags": [ "maps" ], - "summary": "Post record with demo of a specific map.", "parameters": [ { "type": "integer", @@ -401,13 +364,13 @@ const docTemplate = `{ }, "/maps/{id}/summary": { "get": { + "description": "Get map summary with specified id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Get map summary with specified id.", "parameters": [ { "type": "integer", @@ -445,13 +408,13 @@ const docTemplate = `{ } }, "put": { + "description": "Edit map summary with specified map id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Edit map summary with specified map id.", "parameters": [ { "type": "string", @@ -505,13 +468,13 @@ const docTemplate = `{ } }, "post": { + "description": "Create map summary with specified map id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Create map summary with specified map id.", "parameters": [ { "type": "string", @@ -565,13 +528,13 @@ const docTemplate = `{ } }, "delete": { + "description": "Delete map summary with specified map id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Delete map summary with specified map id.", "parameters": [ { "type": "string", @@ -627,6 +590,7 @@ const docTemplate = `{ }, "/profile": { "get": { + "description": "Get profile page of session user.", "consumes": [ "application/json" ], @@ -636,7 +600,6 @@ const docTemplate = `{ "tags": [ "users" ], - "summary": "Get profile page of session user.", "parameters": [ { "type": "string", @@ -680,6 +643,7 @@ const docTemplate = `{ } }, "put": { + "description": "Update country code of session user.", "consumes": [ "application/json" ], @@ -689,7 +653,6 @@ const docTemplate = `{ "tags": [ "users" ], - "summary": "Update country code of session user.", "parameters": [ { "type": "string", @@ -728,6 +691,7 @@ const docTemplate = `{ } }, "post": { + "description": "Update profile page of session user.", "consumes": [ "application/json" ], @@ -737,7 +701,6 @@ const docTemplate = `{ "tags": [ "users" ], - "summary": "Update profile page of session user.", "parameters": [ { "type": "string", @@ -781,15 +744,52 @@ const docTemplate = `{ } } }, + "/rankings": { + "get": { + "description": "Get rankings of every player.", + "produces": [ + "application/json" + ], + "tags": [ + "rankings" + ], + "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" + } + } + } + } + }, "/search": { "get": { + "description": "Get all user and map data matching to the query.", "produces": [ "application/json" ], "tags": [ "search" ], - "summary": "Get all user and map data matching to the query.", "parameters": [ { "type": "string", @@ -828,13 +828,13 @@ const docTemplate = `{ }, "/token": { "get": { + "description": "Gets the token cookie value from the user.", "produces": [ "application/json" ], "tags": [ "auth" ], - "summary": "Gets the token cookie value from the user.", "responses": { "200": { "description": "OK", @@ -863,13 +863,13 @@ const docTemplate = `{ } }, "delete": { + "description": "Deletes the token cookie from the user.", "produces": [ "application/json" ], "tags": [ "auth" ], - "summary": "Deletes the token cookie from the user.", "responses": { "200": { "description": "OK", @@ -900,6 +900,7 @@ const docTemplate = `{ }, "/users/{id}": { "get": { + "description": "Get profile page of another user.", "consumes": [ "application/json" ], @@ -909,7 +910,6 @@ const docTemplate = `{ "tags": [ "users" ], - "summary": "Get profile page of another user.", "parameters": [ { "type": "integer", diff --git a/docs/swagger.json b/docs/swagger.json index 3530d2c..ef422ab 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -15,13 +15,13 @@ "paths": { "/chapters/{id}": { "get": { + "description": "Get maps from the specified chapter id.", "produces": [ "application/json" ], "tags": [ "games \u0026 chapters" ], - "summary": "Get maps from the specified chapter id.", "parameters": [ { "type": "integer", @@ -59,45 +59,9 @@ } } }, - "/demo": { - "get": { - "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": { + "description": "Get demo with specified demo uuid.", "consumes": [ "application/json" ], @@ -107,10 +71,9 @@ "tags": [ "demo" ], - "summary": "Get demo with specified demo uuid.", "parameters": [ { - "type": "integer", + "type": "string", "description": "Demo UUID", "name": "uuid", "in": "query", @@ -135,13 +98,13 @@ }, "/games": { "get": { + "description": "Get games from the leaderboards.", "produces": [ "application/json" ], "tags": [ "games \u0026 chapters" ], - "summary": "Get games from the leaderboards.", "responses": { "200": { "description": "OK", @@ -175,13 +138,13 @@ }, "/games/{id}": { "get": { + "description": "Get chapters from the specified game id.", "produces": [ "application/json" ], "tags": [ "games \u0026 chapters" ], - "summary": "Get chapters from the specified game id.", "parameters": [ { "type": "integer", @@ -221,6 +184,7 @@ }, "/login": { "get": { + "description": "Get (redirect) login page for Steam auth.", "consumes": [ "application/json" ], @@ -230,7 +194,6 @@ "tags": [ "login" ], - "summary": "Get (redirect) login page for Steam auth.", "responses": { "200": { "description": "OK", @@ -261,13 +224,13 @@ }, "/maps/{id}/leaderboards": { "get": { + "description": "Get map leaderboards with specified id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Get map leaderboards with specified id.", "parameters": [ { "type": "integer", @@ -319,6 +282,7 @@ }, "/maps/{id}/record": { "post": { + "description": "Post record with demo of a specific map.", "consumes": [ "multipart/form-data" ], @@ -328,7 +292,6 @@ "tags": [ "maps" ], - "summary": "Post record with demo of a specific map.", "parameters": [ { "type": "integer", @@ -394,13 +357,13 @@ }, "/maps/{id}/summary": { "get": { + "description": "Get map summary with specified id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Get map summary with specified id.", "parameters": [ { "type": "integer", @@ -438,13 +401,13 @@ } }, "put": { + "description": "Edit map summary with specified map id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Edit map summary with specified map id.", "parameters": [ { "type": "string", @@ -498,13 +461,13 @@ } }, "post": { + "description": "Create map summary with specified map id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Create map summary with specified map id.", "parameters": [ { "type": "string", @@ -558,13 +521,13 @@ } }, "delete": { + "description": "Delete map summary with specified map id.", "produces": [ "application/json" ], "tags": [ "maps" ], - "summary": "Delete map summary with specified map id.", "parameters": [ { "type": "string", @@ -620,6 +583,7 @@ }, "/profile": { "get": { + "description": "Get profile page of session user.", "consumes": [ "application/json" ], @@ -629,7 +593,6 @@ "tags": [ "users" ], - "summary": "Get profile page of session user.", "parameters": [ { "type": "string", @@ -673,6 +636,7 @@ } }, "put": { + "description": "Update country code of session user.", "consumes": [ "application/json" ], @@ -682,7 +646,6 @@ "tags": [ "users" ], - "summary": "Update country code of session user.", "parameters": [ { "type": "string", @@ -721,6 +684,7 @@ } }, "post": { + "description": "Update profile page of session user.", "consumes": [ "application/json" ], @@ -730,7 +694,6 @@ "tags": [ "users" ], - "summary": "Update profile page of session user.", "parameters": [ { "type": "string", @@ -774,15 +737,52 @@ } } }, + "/rankings": { + "get": { + "description": "Get rankings of every player.", + "produces": [ + "application/json" + ], + "tags": [ + "rankings" + ], + "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" + } + } + } + } + }, "/search": { "get": { + "description": "Get all user and map data matching to the query.", "produces": [ "application/json" ], "tags": [ "search" ], - "summary": "Get all user and map data matching to the query.", "parameters": [ { "type": "string", @@ -821,13 +821,13 @@ }, "/token": { "get": { + "description": "Gets the token cookie value from the user.", "produces": [ "application/json" ], "tags": [ "auth" ], - "summary": "Gets the token cookie value from the user.", "responses": { "200": { "description": "OK", @@ -856,13 +856,13 @@ } }, "delete": { + "description": "Deletes the token cookie from the user.", "produces": [ "application/json" ], "tags": [ "auth" ], - "summary": "Deletes the token cookie from the user.", "responses": { "200": { "description": "OK", @@ -893,6 +893,7 @@ }, "/users/{id}": { "get": { + "description": "Get profile page of another user.", "consumes": [ "application/json" ], @@ -902,7 +903,6 @@ "tags": [ "users" ], - "summary": "Get profile page of another user.", "parameters": [ { "type": "integer", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index d4420e2..2fed413 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -242,6 +242,7 @@ info: paths: /chapters/{id}: get: + description: Get maps from the specified chapter id. parameters: - description: Chapter ID in: path @@ -264,40 +265,19 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get maps from the specified chapter id. tags: - games & chapters - /demo: - get: - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/models.Response' - - properties: - data: - $ref: '#/definitions/models.RankingsResponse' - type: object - "400": - description: Bad Request - schema: - $ref: '#/definitions/models.Response' - summary: Get rankings of every player. - tags: - - rankings /demos: get: consumes: - application/json + description: Get demo with specified demo uuid. parameters: - description: Demo UUID in: query name: uuid required: true - type: integer + type: string produces: - application/octet-stream responses: @@ -309,11 +289,11 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get demo with specified demo uuid. tags: - demo /games: get: + description: Get games from the leaderboards. produces: - application/json responses: @@ -332,11 +312,11 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get games from the leaderboards. tags: - games & chapters /games/{id}: get: + description: Get chapters from the specified game id. parameters: - description: Game ID in: path @@ -359,13 +339,13 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get chapters from the specified game id. tags: - games & chapters /login: get: consumes: - application/json + description: Get (redirect) login page for Steam auth. produces: - application/json responses: @@ -382,11 +362,11 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get (redirect) login page for Steam auth. tags: - login /maps/{id}/leaderboards: get: + description: Get map leaderboards with specified id. parameters: - description: Map ID in: path @@ -414,13 +394,13 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get map leaderboards with specified id. tags: - maps /maps/{id}/record: post: consumes: - multipart/form-data + description: Post record with demo of a specific map. parameters: - description: Map ID in: path @@ -464,11 +444,11 @@ paths: description: Unauthorized schema: $ref: '#/definitions/models.Response' - summary: Post record with demo of a specific map. tags: - maps /maps/{id}/summary: delete: + description: Delete map summary with specified map id. parameters: - description: JWT Token in: header @@ -502,10 +482,10 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Delete map summary with specified map id. tags: - maps get: + description: Get map summary with specified id. parameters: - description: Map ID in: path @@ -528,10 +508,10 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get map summary with specified id. tags: - maps post: + description: Create map summary with specified map id. parameters: - description: JWT Token in: header @@ -565,10 +545,10 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Create map summary with specified map id. tags: - maps put: + description: Edit map summary with specified map id. parameters: - description: JWT Token in: header @@ -602,13 +582,13 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Edit map summary with specified map id. tags: - maps /profile: get: consumes: - application/json + description: Get profile page of session user. parameters: - description: JWT Token in: header @@ -635,12 +615,12 @@ paths: description: Unauthorized schema: $ref: '#/definitions/models.Response' - summary: Get profile page of session user. tags: - users post: consumes: - application/json + description: Update profile page of session user. parameters: - description: JWT Token in: header @@ -667,12 +647,12 @@ paths: description: Unauthorized schema: $ref: '#/definitions/models.Response' - summary: Update profile page of session user. tags: - users put: consumes: - application/json + description: Update country code of session user. parameters: - description: JWT Token in: header @@ -699,11 +679,32 @@ paths: description: Unauthorized schema: $ref: '#/definitions/models.Response' - summary: Update country code of session user. tags: - users + /rankings: + get: + description: Get rankings of every player. + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/models.Response' + - properties: + data: + $ref: '#/definitions/models.RankingsResponse' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.Response' + tags: + - rankings /search: get: + description: Get all user and map data matching to the query. parameters: - description: Search user or map name. in: query @@ -725,11 +726,11 @@ paths: description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get all user and map data matching to the query. tags: - search /token: delete: + description: Deletes the token cookie from the user. produces: - application/json responses: @@ -746,10 +747,10 @@ paths: description: Not Found schema: $ref: '#/definitions/models.Response' - summary: Deletes the token cookie from the user. tags: - auth get: + description: Gets the token cookie value from the user. produces: - application/json responses: @@ -766,13 +767,13 @@ paths: description: Not Found schema: $ref: '#/definitions/models.Response' - summary: Gets the token cookie value from the user. tags: - auth /users/{id}: get: consumes: - application/json + description: Get profile page of another user. parameters: - description: User ID in: path @@ -799,7 +800,6 @@ paths: description: Not Found schema: $ref: '#/definitions/models.Response' - summary: Get profile page of another user. tags: - users swagger: "2.0" -- cgit v1.2.3