From ba09abbe6a8d0c1f3a54c8c7426eda7b930e1447 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 25 Aug 2023 23:41:13 +0300 Subject: docs: profile improvement swagger (#51) Former-commit-id: ff35be478c4f29c611c40fa34ca5d134e970cc16 --- docs/docs.go | 137 +++++++++++++++++++++++++++++++++++++++++++++++------- docs/swagger.json | 137 +++++++++++++++++++++++++++++++++++++++++++++++------- docs/swagger.yaml | 93 ++++++++++++++++++++++++++++++------ 3 files changed, 317 insertions(+), 50 deletions(-) (limited to 'docs') diff --git a/docs/docs.go b/docs/docs.go index df01379..d0c78ac 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1158,6 +1158,68 @@ const docTemplate = `{ } } }, + "controllers.ProfileRankings": { + "type": "object", + "properties": { + "cooperative": { + "$ref": "#/definitions/controllers.ProfileRankingsDetails" + }, + "overall": { + "$ref": "#/definitions/controllers.ProfileRankingsDetails" + }, + "singleplayer": { + "$ref": "#/definitions/controllers.ProfileRankingsDetails" + } + } + }, + "controllers.ProfileRankingsDetails": { + "type": "object", + "properties": { + "completion_count": { + "type": "integer" + }, + "completion_total": { + "type": "integer" + }, + "rank": { + "type": "integer" + } + } + }, + "controllers.ProfileRecords": { + "type": "object", + "properties": { + "portal2_cooperative": { + "type": "array", + "items": { + "$ref": "#/definitions/controllers.ProfileRecordsDetails" + } + }, + "portal2_singleplayer": { + "type": "array", + "items": { + "$ref": "#/definitions/controllers.ProfileRecordsDetails" + } + } + } + }, + "controllers.ProfileRecordsDetails": { + "type": "object", + "properties": { + "map_id": { + "type": "integer" + }, + "map_name": { + "type": "string" + }, + "scores": { + "type": "array", + "items": { + "$ref": "#/definitions/controllers.ProfileScores" + } + } + } + }, "controllers.ProfileResponse": { "type": "object", "properties": { @@ -1167,26 +1229,46 @@ const docTemplate = `{ "country_code": { "type": "string" }, + "links": { + "$ref": "#/definitions/models.Links" + }, "profile": { "type": "boolean" }, - "scores_mp": { - "type": "array", - "items": { - "$ref": "#/definitions/controllers.ScoreResponse" - } + "rankings": { + "$ref": "#/definitions/controllers.ProfileRankings" + }, + "records": { + "$ref": "#/definitions/controllers.ProfileRecords" }, - "scores_sp": { + "steam_id": { + "type": "string" + }, + "titles": { "type": "array", "items": { - "$ref": "#/definitions/controllers.ScoreResponse" + "$ref": "#/definitions/models.Title" } }, - "steam_id": { + "user_name": { + "type": "string" + } + } + }, + "controllers.ProfileScores": { + "type": "object", + "properties": { + "date": { "type": "string" }, - "user_name": { + "demo_id": { "type": "string" + }, + "score_count": { + "type": "integer" + }, + "score_time": { + "type": "integer" } } }, @@ -1218,15 +1300,6 @@ const docTemplate = `{ } } }, - "controllers.ScoreResponse": { - "type": "object", - "properties": { - "map_id": { - "type": "integer" - }, - "records": {} - } - }, "controllers.SearchResponse": { "type": "object", "properties": { @@ -1280,6 +1353,23 @@ const docTemplate = `{ } } }, + "models.Links": { + "type": "object", + "properties": { + "p2sr": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "twitch": { + "type": "string" + }, + "youtube": { + "type": "string" + } + } + }, "models.Map": { "type": "object", "properties": { @@ -1380,6 +1470,17 @@ const docTemplate = `{ } } }, + "models.Title": { + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, "models.UserRanking": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 0f3dade..cf37a5a 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1151,6 +1151,68 @@ } } }, + "controllers.ProfileRankings": { + "type": "object", + "properties": { + "cooperative": { + "$ref": "#/definitions/controllers.ProfileRankingsDetails" + }, + "overall": { + "$ref": "#/definitions/controllers.ProfileRankingsDetails" + }, + "singleplayer": { + "$ref": "#/definitions/controllers.ProfileRankingsDetails" + } + } + }, + "controllers.ProfileRankingsDetails": { + "type": "object", + "properties": { + "completion_count": { + "type": "integer" + }, + "completion_total": { + "type": "integer" + }, + "rank": { + "type": "integer" + } + } + }, + "controllers.ProfileRecords": { + "type": "object", + "properties": { + "portal2_cooperative": { + "type": "array", + "items": { + "$ref": "#/definitions/controllers.ProfileRecordsDetails" + } + }, + "portal2_singleplayer": { + "type": "array", + "items": { + "$ref": "#/definitions/controllers.ProfileRecordsDetails" + } + } + } + }, + "controllers.ProfileRecordsDetails": { + "type": "object", + "properties": { + "map_id": { + "type": "integer" + }, + "map_name": { + "type": "string" + }, + "scores": { + "type": "array", + "items": { + "$ref": "#/definitions/controllers.ProfileScores" + } + } + } + }, "controllers.ProfileResponse": { "type": "object", "properties": { @@ -1160,26 +1222,46 @@ "country_code": { "type": "string" }, + "links": { + "$ref": "#/definitions/models.Links" + }, "profile": { "type": "boolean" }, - "scores_mp": { - "type": "array", - "items": { - "$ref": "#/definitions/controllers.ScoreResponse" - } + "rankings": { + "$ref": "#/definitions/controllers.ProfileRankings" + }, + "records": { + "$ref": "#/definitions/controllers.ProfileRecords" }, - "scores_sp": { + "steam_id": { + "type": "string" + }, + "titles": { "type": "array", "items": { - "$ref": "#/definitions/controllers.ScoreResponse" + "$ref": "#/definitions/models.Title" } }, - "steam_id": { + "user_name": { + "type": "string" + } + } + }, + "controllers.ProfileScores": { + "type": "object", + "properties": { + "date": { "type": "string" }, - "user_name": { + "demo_id": { "type": "string" + }, + "score_count": { + "type": "integer" + }, + "score_time": { + "type": "integer" } } }, @@ -1211,15 +1293,6 @@ } } }, - "controllers.ScoreResponse": { - "type": "object", - "properties": { - "map_id": { - "type": "integer" - }, - "records": {} - } - }, "controllers.SearchResponse": { "type": "object", "properties": { @@ -1273,6 +1346,23 @@ } } }, + "models.Links": { + "type": "object", + "properties": { + "p2sr": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "twitch": { + "type": "string" + }, + "youtube": { + "type": "string" + } + } + }, "models.Map": { "type": "object", "properties": { @@ -1373,6 +1463,17 @@ } } }, + "models.Title": { + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, "models.UserRanking": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f50fecb..0dd514d 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -86,27 +86,80 @@ definitions: summary: $ref: '#/definitions/models.MapSummary' type: object + controllers.ProfileRankings: + properties: + cooperative: + $ref: '#/definitions/controllers.ProfileRankingsDetails' + overall: + $ref: '#/definitions/controllers.ProfileRankingsDetails' + singleplayer: + $ref: '#/definitions/controllers.ProfileRankingsDetails' + type: object + controllers.ProfileRankingsDetails: + properties: + completion_count: + type: integer + completion_total: + type: integer + rank: + type: integer + type: object + controllers.ProfileRecords: + properties: + portal2_cooperative: + items: + $ref: '#/definitions/controllers.ProfileRecordsDetails' + type: array + portal2_singleplayer: + items: + $ref: '#/definitions/controllers.ProfileRecordsDetails' + type: array + type: object + controllers.ProfileRecordsDetails: + properties: + map_id: + type: integer + map_name: + type: string + scores: + items: + $ref: '#/definitions/controllers.ProfileScores' + type: array + type: object controllers.ProfileResponse: properties: avatar_link: type: string country_code: type: string + links: + $ref: '#/definitions/models.Links' profile: type: boolean - scores_mp: - items: - $ref: '#/definitions/controllers.ScoreResponse' - type: array - scores_sp: - items: - $ref: '#/definitions/controllers.ScoreResponse' - type: array + rankings: + $ref: '#/definitions/controllers.ProfileRankings' + records: + $ref: '#/definitions/controllers.ProfileRecords' steam_id: type: string + titles: + items: + $ref: '#/definitions/models.Title' + type: array user_name: type: string type: object + controllers.ProfileScores: + properties: + date: + type: string + demo_id: + type: string + score_count: + type: integer + score_time: + type: integer + type: object controllers.RankingsResponse: properties: rankings_mp: @@ -125,12 +178,6 @@ definitions: score_time: type: integer type: object - controllers.ScoreResponse: - properties: - map_id: - type: integer - records: {} - type: object controllers.SearchResponse: properties: maps: @@ -165,6 +212,17 @@ definitions: name: type: string type: object + models.Links: + properties: + p2sr: + type: string + stream: + type: string + twitch: + type: string + youtube: + type: string + type: object models.Map: properties: chapter_name: @@ -230,6 +288,13 @@ definitions: success: type: boolean type: object + models.Title: + properties: + color: + type: string + name: + type: string + type: object models.UserRanking: properties: total_score: -- cgit v1.2.3