From 16165aea34a711027825b3f6512e73a0156f8068 Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Tue, 10 Sep 2024 22:13:24 +0300
Subject: refactor: move backend entry, rename module
---
docs/docs.go | 2160 -----------------------------------------------------
docs/index.html | 26 -
docs/swagger.json | 2136 ----------------------------------------------------
docs/swagger.yaml | 1324 --------------------------------
4 files changed, 5646 deletions(-)
delete mode 100644 docs/docs.go
delete mode 100644 docs/index.html
delete mode 100644 docs/swagger.json
delete mode 100644 docs/swagger.yaml
(limited to 'docs')
diff --git a/docs/docs.go b/docs/docs.go
deleted file mode 100644
index 13f217d..0000000
--- a/docs/docs.go
+++ /dev/null
@@ -1,2160 +0,0 @@
-// Package docs Code generated by swaggo/swag. DO NOT EDIT
-package docs
-
-import "github.com/swaggo/swag"
-
-const docTemplate = `{
- "schemes": {{ marshal .Schemes }},
- "swagger": "2.0",
- "info": {
- "description": "{{escape .Description}}",
- "title": "{{.Title}}",
- "contact": {},
- "license": {
- "name": "GNU General Public License, Version 2",
- "url": "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
- },
- "version": "{{.Version}}"
- },
- "host": "{{.Host}}",
- "basePath": "{{.BasePath}}",
- "paths": {
- "/chapters/{chapterid}": {
- "get": {
- "description": "Get maps from the specified chapter id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "games \u0026 chapters"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Chapter ID",
- "name": "chapterid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ChapterMapsResponse"
- }
- }
- }
- ]
- }
- },
- "400": {
- "description": "Bad Request",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- }
- },
- "/demos": {
- "get": {
- "description": "Get demo with specified demo uuid.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/octet-stream"
- ],
- "tags": [
- "demo"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "Demo UUID",
- "name": "uuid",
- "in": "query",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "Demo File",
- "schema": {
- "type": "file"
- }
- }
- }
- }
- },
- "/games": {
- "get": {
- "description": "Get games from the leaderboards.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "games \u0026 chapters"
- ],
- "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"
- }
- }
- }
- }
- },
- "/games/{gameid}": {
- "get": {
- "description": "Get chapters from the specified game id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "games \u0026 chapters"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Game ID",
- "name": "gameid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ChaptersResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/games/{gameid}/maps": {
- "get": {
- "description": "Get maps from the specified game id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "games \u0026 chapters"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Game ID",
- "name": "gameid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ChaptersResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/login": {
- "get": {
- "description": "Get (redirect) login page for Steam auth.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "login"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.LoginResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/logs/mod": {
- "get": {
- "description": "Get mod logs.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "logs"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.LogsResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/logs/score": {
- "get": {
- "description": "Get score logs of every player.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "logs"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ScoreLogsResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/discussions": {
- "get": {
- "description": "Get map discussions with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.MapDiscussionsResponse"
- }
- }
- }
- ]
- }
- }
- }
- },
- "post": {
- "description": "Create map discussion with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/discussions/{discussionid}": {
- "get": {
- "description": "Get map discussion with specified map and discussion id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Discussion ID",
- "name": "discussionid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.MapDiscussionResponse"
- }
- }
- }
- ]
- }
- }
- }
- },
- "put": {
- "description": "Edit map discussion with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Discussion ID",
- "name": "discussionid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
- }
- }
- }
- ]
- }
- }
- }
- },
- "post": {
- "description": "Create map discussion comment with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Discussion ID",
- "name": "discussionid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.CreateMapDiscussionCommentRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.CreateMapDiscussionCommentRequest"
- }
- }
- }
- ]
- }
- }
- }
- },
- "delete": {
- "description": "Delete map discussion with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Discussion ID",
- "name": "discussionid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- }
- },
- "/maps/{mapid}/image": {
- "put": {
- "description": "Edit map image with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.EditMapImageRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.EditMapImageRequest"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/leaderboards": {
- "get": {
- "description": "Get map leaderboards with specified id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / leaderboards"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Page Number (default: 1)",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Number of Records Per Page (default: 20)",
- "name": "pageSize",
- "in": "query"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.MapLeaderboardsResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/record": {
- "post": {
- "description": "Post record with demo of a specific map.",
- "consumes": [
- "multipart/form-data"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / leaderboards"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "file",
- "description": "Host Demo",
- "name": "host_demo",
- "in": "formData",
- "required": true
- },
- {
- "type": "file",
- "description": "Partner Demo",
- "name": "partner_demo",
- "in": "formData"
- },
- {
- "type": "boolean",
- "description": "Is Partner Orange",
- "name": "is_partner_orange",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "Partner ID",
- "name": "partner_id",
- "in": "formData"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.RecordResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/record/{recordid}": {
- "delete": {
- "description": "Delete record with specified map and record id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / leaderboards"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Record ID",
- "name": "recordid",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- }
- },
- "/maps/{mapid}/summary": {
- "get": {
- "description": "Get map summary with specified id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.MapSummaryResponse"
- }
- }
- }
- ]
- }
- }
- }
- },
- "put": {
- "description": "Edit map summary with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.EditMapSummaryRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.EditMapSummaryRequest"
- }
- }
- }
- ]
- }
- }
- }
- },
- "post": {
- "description": "Create map summary with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.CreateMapSummaryRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.CreateMapSummaryRequest"
- }
- }
- }
- ]
- }
- }
- }
- },
- "delete": {
- "description": "Delete map summary with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.DeleteMapSummaryRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.DeleteMapSummaryRequest"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/profile": {
- "get": {
- "description": "Get profile page of session user.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "users"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ProfileResponse"
- }
- }
- }
- ]
- }
- }
- }
- },
- "put": {
- "description": "Update country code of session user.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "users"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "string",
- "description": "Country Code [XX]",
- "name": "country_code",
- "in": "query",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- },
- "post": {
- "description": "Update profile page of session user.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "users"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ProfileResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/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/handlers.RankingsResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/search": {
- "get": {
- "description": "Get all user and map data matching to the query.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "search"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "Search user or map name.",
- "name": "q",
- "in": "query"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.SearchResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/token": {
- "get": {
- "description": "Gets the token cookie value from the user.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "auth"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.LoginResponse"
- }
- }
- }
- ]
- }
- },
- "404": {
- "description": "Not Found",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- },
- "delete": {
- "description": "Deletes the token cookie from the user.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "auth"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.LoginResponse"
- }
- }
- }
- ]
- }
- },
- "404": {
- "description": "Not Found",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- }
- },
- "/users/{userid}": {
- "get": {
- "description": "Get profile page of another user.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "users"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "User ID",
- "name": "userid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ProfileResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- }
- },
- "definitions": {
- "handlers.ChapterMapsResponse": {
- "type": "object",
- "properties": {
- "chapter": {
- "$ref": "#/definitions/models.Chapter"
- },
- "maps": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.MapSelect"
- }
- }
- }
- },
- "handlers.ChaptersResponse": {
- "type": "object",
- "properties": {
- "chapters": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.Chapter"
- }
- },
- "game": {
- "$ref": "#/definitions/models.Game"
- }
- }
- },
- "handlers.CreateMapDiscussionCommentRequest": {
- "type": "object",
- "required": [
- "comment"
- ],
- "properties": {
- "comment": {
- "type": "string"
- }
- }
- },
- "handlers.CreateMapDiscussionRequest": {
- "type": "object",
- "required": [
- "content",
- "title"
- ],
- "properties": {
- "content": {
- "type": "string"
- },
- "title": {
- "type": "string"
- }
- }
- },
- "handlers.CreateMapSummaryRequest": {
- "type": "object",
- "required": [
- "category_id",
- "description",
- "record_date",
- "score_count",
- "user_name"
- ],
- "properties": {
- "category_id": {
- "type": "integer"
- },
- "description": {
- "type": "string"
- },
- "record_date": {
- "type": "string"
- },
- "score_count": {
- "type": "integer"
- },
- "showcase": {
- "type": "string"
- },
- "user_name": {
- "type": "string"
- }
- }
- },
- "handlers.DeleteMapSummaryRequest": {
- "type": "object",
- "required": [
- "route_id"
- ],
- "properties": {
- "route_id": {
- "type": "integer"
- }
- }
- },
- "handlers.EditMapDiscussionRequest": {
- "type": "object",
- "required": [
- "content",
- "title"
- ],
- "properties": {
- "content": {
- "type": "string"
- },
- "title": {
- "type": "string"
- }
- }
- },
- "handlers.EditMapImageRequest": {
- "type": "object",
- "required": [
- "image"
- ],
- "properties": {
- "image": {
- "type": "string"
- }
- }
- },
- "handlers.EditMapSummaryRequest": {
- "type": "object",
- "required": [
- "description",
- "record_date",
- "route_id",
- "score_count",
- "user_name"
- ],
- "properties": {
- "description": {
- "type": "string"
- },
- "record_date": {
- "type": "string"
- },
- "route_id": {
- "type": "integer"
- },
- "score_count": {
- "type": "integer"
- },
- "showcase": {
- "type": "string"
- },
- "user_name": {
- "type": "string"
- }
- }
- },
- "handlers.LoginResponse": {
- "type": "object",
- "properties": {
- "token": {
- "type": "string"
- }
- }
- },
- "handlers.LogsResponse": {
- "type": "object",
- "properties": {
- "logs": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.LogsResponseDetails"
- }
- }
- }
- },
- "handlers.LogsResponseDetails": {
- "type": "object",
- "properties": {
- "date": {
- "type": "string"
- },
- "detail": {
- "type": "string"
- },
- "message": {
- "type": "string"
- },
- "user": {
- "$ref": "#/definitions/models.UserShort"
- }
- }
- },
- "handlers.MapDiscussion": {
- "type": "object",
- "properties": {
- "comments": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.MapDiscussionComment"
- }
- },
- "content": {
- "type": "string"
- },
- "created_at": {
- "description": "Upvotes int ` + "`" + `json:\"upvotes\"` + "`" + `",
- "type": "string"
- },
- "creator": {
- "$ref": "#/definitions/models.UserShortWithAvatar"
- },
- "id": {
- "type": "integer"
- },
- "title": {
- "type": "string"
- },
- "updated_at": {
- "type": "string"
- }
- }
- },
- "handlers.MapDiscussionComment": {
- "type": "object",
- "properties": {
- "comment": {
- "type": "string"
- },
- "date": {
- "type": "string"
- },
- "user": {
- "$ref": "#/definitions/models.UserShortWithAvatar"
- }
- }
- },
- "handlers.MapDiscussionResponse": {
- "type": "object",
- "properties": {
- "discussion": {
- "$ref": "#/definitions/handlers.MapDiscussion"
- }
- }
- },
- "handlers.MapDiscussionsResponse": {
- "type": "object",
- "properties": {
- "discussions": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.MapDiscussion"
- }
- }
- }
- },
- "handlers.MapLeaderboardsResponse": {
- "type": "object",
- "properties": {
- "map": {
- "$ref": "#/definitions/models.Map"
- },
- "pagination": {
- "$ref": "#/definitions/models.Pagination"
- },
- "records": {}
- }
- },
- "handlers.MapShortWithGame": {
- "type": "object",
- "properties": {
- "chapter": {
- "type": "string"
- },
- "game": {
- "type": "string"
- },
- "id": {
- "type": "integer"
- },
- "map": {
- "type": "string"
- }
- }
- },
- "handlers.MapSummaryResponse": {
- "type": "object",
- "properties": {
- "map": {
- "$ref": "#/definitions/models.Map"
- },
- "summary": {
- "$ref": "#/definitions/models.MapSummary"
- }
- }
- },
- "handlers.ProfileRankings": {
- "type": "object",
- "properties": {
- "cooperative": {
- "$ref": "#/definitions/handlers.ProfileRankingsDetails"
- },
- "overall": {
- "$ref": "#/definitions/handlers.ProfileRankingsDetails"
- },
- "singleplayer": {
- "$ref": "#/definitions/handlers.ProfileRankingsDetails"
- }
- }
- },
- "handlers.ProfileRankingsDetails": {
- "type": "object",
- "properties": {
- "completion_count": {
- "type": "integer"
- },
- "completion_total": {
- "type": "integer"
- },
- "rank": {
- "type": "integer"
- }
- }
- },
- "handlers.ProfileRecords": {
- "type": "object",
- "properties": {
- "category_id": {
- "type": "integer"
- },
- "game_id": {
- "type": "integer"
- },
- "map_id": {
- "type": "integer"
- },
- "map_name": {
- "type": "string"
- },
- "map_wr_count": {
- "type": "integer"
- },
- "placement": {
- "type": "integer"
- },
- "scores": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.ProfileScores"
- }
- }
- }
- },
- "handlers.ProfileResponse": {
- "type": "object",
- "properties": {
- "avatar_link": {
- "type": "string"
- },
- "country_code": {
- "type": "string"
- },
- "links": {
- "$ref": "#/definitions/models.Links"
- },
- "pagination": {
- "$ref": "#/definitions/models.Pagination"
- },
- "profile": {
- "type": "boolean"
- },
- "rankings": {
- "$ref": "#/definitions/handlers.ProfileRankings"
- },
- "records": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.ProfileRecords"
- }
- },
- "steam_id": {
- "type": "string"
- },
- "titles": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.Title"
- }
- },
- "user_name": {
- "type": "string"
- }
- }
- },
- "handlers.ProfileScores": {
- "type": "object",
- "properties": {
- "date": {
- "type": "string"
- },
- "demo_id": {
- "type": "string"
- },
- "record_id": {
- "type": "integer"
- },
- "score_count": {
- "type": "integer"
- },
- "score_time": {
- "type": "integer"
- }
- }
- },
- "handlers.RankingsResponse": {
- "type": "object",
- "properties": {
- "rankings_multiplayer": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.UserRanking"
- }
- },
- "rankings_overall": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.UserRanking"
- }
- },
- "rankings_singleplayer": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.UserRanking"
- }
- }
- }
- },
- "handlers.RecordResponse": {
- "type": "object",
- "properties": {
- "score_count": {
- "type": "integer"
- },
- "score_time": {
- "type": "integer"
- }
- }
- },
- "handlers.ScoreLogsResponse": {
- "type": "object",
- "properties": {
- "scores": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.ScoreLogsResponseDetails"
- }
- }
- }
- },
- "handlers.ScoreLogsResponseDetails": {
- "type": "object",
- "properties": {
- "date": {
- "type": "string"
- },
- "demo_id": {
- "type": "string"
- },
- "game": {
- "$ref": "#/definitions/models.Game"
- },
- "map": {
- "$ref": "#/definitions/models.MapShort"
- },
- "score_count": {
- "type": "integer"
- },
- "score_time": {
- "type": "integer"
- },
- "user": {
- "$ref": "#/definitions/models.UserShort"
- }
- }
- },
- "handlers.SearchResponse": {
- "type": "object",
- "properties": {
- "maps": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.MapShortWithGame"
- }
- },
- "players": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.UserShortWithAvatar"
- }
- }
- }
- },
- "models.Category": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.CategoryPortal": {
- "type": "object",
- "properties": {
- "category": {
- "$ref": "#/definitions/models.Category"
- },
- "portal_count": {
- "type": "integer"
- }
- }
- },
- "models.Chapter": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_disabled": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.Game": {
- "type": "object",
- "properties": {
- "category_portals": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.CategoryPortal"
- }
- },
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_coop": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.Links": {
- "type": "object",
- "properties": {
- "p2sr": {
- "type": "string"
- },
- "steam": {
- "type": "string"
- },
- "twitch": {
- "type": "string"
- },
- "youtube": {
- "type": "string"
- }
- }
- },
- "models.Map": {
- "type": "object",
- "properties": {
- "chapter_name": {
- "type": "string"
- },
- "game_name": {
- "type": "string"
- },
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_coop": {
- "type": "boolean"
- },
- "is_disabled": {
- "type": "boolean"
- },
- "map_name": {
- "type": "string"
- }
- }
- },
- "models.MapHistory": {
- "type": "object",
- "properties": {
- "date": {
- "type": "string"
- },
- "runner_name": {
- "type": "string"
- },
- "score_count": {
- "type": "integer"
- }
- }
- },
- "models.MapRoute": {
- "type": "object",
- "properties": {
- "category": {
- "$ref": "#/definitions/models.Category"
- },
- "completion_count": {
- "type": "integer"
- },
- "description": {
- "type": "string"
- },
- "history": {
- "$ref": "#/definitions/models.MapHistory"
- },
- "rating": {
- "type": "number"
- },
- "route_id": {
- "type": "integer"
- },
- "showcase": {
- "type": "string"
- }
- }
- },
- "models.MapSelect": {
- "type": "object",
- "properties": {
- "category_portals": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.CategoryPortal"
- }
- },
- "difficulty": {
- "type": "integer"
- },
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_disabled": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.MapShort": {
- "type": "object",
- "properties": {
- "difficulty": {
- "type": "integer"
- },
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_disabled": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- },
- "portal_count": {
- "type": "integer"
- }
- }
- },
- "models.MapSummary": {
- "type": "object",
- "properties": {
- "routes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.MapRoute"
- }
- }
- }
- },
- "models.Pagination": {
- "type": "object",
- "properties": {
- "current_page": {
- "type": "integer"
- },
- "page_size": {
- "type": "integer"
- },
- "total_pages": {
- "type": "integer"
- },
- "total_records": {
- "type": "integer"
- }
- }
- },
- "models.Response": {
- "type": "object",
- "properties": {
- "data": {},
- "message": {
- "type": "string"
- },
- "success": {
- "type": "boolean"
- }
- }
- },
- "models.Title": {
- "type": "object",
- "properties": {
- "color": {
- "type": "string"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.UserRanking": {
- "type": "object",
- "properties": {
- "placement": {
- "type": "integer"
- },
- "total_score": {
- "type": "integer"
- },
- "user": {
- "$ref": "#/definitions/models.UserShortWithAvatar"
- }
- }
- },
- "models.UserShort": {
- "type": "object",
- "properties": {
- "steam_id": {
- "type": "string"
- },
- "user_name": {
- "type": "string"
- }
- }
- },
- "models.UserShortWithAvatar": {
- "type": "object",
- "properties": {
- "avatar_link": {
- "type": "string"
- },
- "steam_id": {
- "type": "string"
- },
- "user_name": {
- "type": "string"
- }
- }
- }
- }
-}`
-
-// SwaggerInfo holds exported Swagger Info so clients can modify it
-var SwaggerInfo = &swag.Spec{
- Version: "1.0",
- Host: "lp.ardapektezol.com",
- BasePath: "/api/v1",
- Schemes: []string{},
- Title: "Least Portals Database API",
- Description: "Backend API endpoints for the Least Portals Database.",
- InfoInstanceName: "swagger",
- SwaggerTemplate: docTemplate,
- LeftDelim: "{{",
- RightDelim: "}}",
-}
-
-func init() {
- swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
-}
diff --git a/docs/index.html b/docs/index.html
deleted file mode 100644
index 8d12274..0000000
--- a/docs/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
- SwaggerUI
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/swagger.json b/docs/swagger.json
deleted file mode 100644
index a773ac7..0000000
--- a/docs/swagger.json
+++ /dev/null
@@ -1,2136 +0,0 @@
-{
- "swagger": "2.0",
- "info": {
- "description": "Backend API endpoints for the Least Portals Database.",
- "title": "Least Portals Database API",
- "contact": {},
- "license": {
- "name": "GNU General Public License, Version 2",
- "url": "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
- },
- "version": "1.0"
- },
- "host": "lp.ardapektezol.com",
- "basePath": "/api/v1",
- "paths": {
- "/chapters/{chapterid}": {
- "get": {
- "description": "Get maps from the specified chapter id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "games \u0026 chapters"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Chapter ID",
- "name": "chapterid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ChapterMapsResponse"
- }
- }
- }
- ]
- }
- },
- "400": {
- "description": "Bad Request",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- }
- },
- "/demos": {
- "get": {
- "description": "Get demo with specified demo uuid.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/octet-stream"
- ],
- "tags": [
- "demo"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "Demo UUID",
- "name": "uuid",
- "in": "query",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "Demo File",
- "schema": {
- "type": "file"
- }
- }
- }
- }
- },
- "/games": {
- "get": {
- "description": "Get games from the leaderboards.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "games \u0026 chapters"
- ],
- "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"
- }
- }
- }
- }
- },
- "/games/{gameid}": {
- "get": {
- "description": "Get chapters from the specified game id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "games \u0026 chapters"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Game ID",
- "name": "gameid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ChaptersResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/games/{gameid}/maps": {
- "get": {
- "description": "Get maps from the specified game id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "games \u0026 chapters"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Game ID",
- "name": "gameid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ChaptersResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/login": {
- "get": {
- "description": "Get (redirect) login page for Steam auth.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "login"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.LoginResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/logs/mod": {
- "get": {
- "description": "Get mod logs.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "logs"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.LogsResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/logs/score": {
- "get": {
- "description": "Get score logs of every player.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "logs"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ScoreLogsResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/discussions": {
- "get": {
- "description": "Get map discussions with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.MapDiscussionsResponse"
- }
- }
- }
- ]
- }
- }
- }
- },
- "post": {
- "description": "Create map discussion with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/discussions/{discussionid}": {
- "get": {
- "description": "Get map discussion with specified map and discussion id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Discussion ID",
- "name": "discussionid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.MapDiscussionResponse"
- }
- }
- }
- ]
- }
- }
- }
- },
- "put": {
- "description": "Edit map discussion with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Discussion ID",
- "name": "discussionid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
- }
- }
- }
- ]
- }
- }
- }
- },
- "post": {
- "description": "Create map discussion comment with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Discussion ID",
- "name": "discussionid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.CreateMapDiscussionCommentRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.CreateMapDiscussionCommentRequest"
- }
- }
- }
- ]
- }
- }
- }
- },
- "delete": {
- "description": "Delete map discussion with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / discussions"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Discussion ID",
- "name": "discussionid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- }
- },
- "/maps/{mapid}/image": {
- "put": {
- "description": "Edit map image with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.EditMapImageRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.EditMapImageRequest"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/leaderboards": {
- "get": {
- "description": "Get map leaderboards with specified id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / leaderboards"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Page Number (default: 1)",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Number of Records Per Page (default: 20)",
- "name": "pageSize",
- "in": "query"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.MapLeaderboardsResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/record": {
- "post": {
- "description": "Post record with demo of a specific map.",
- "consumes": [
- "multipart/form-data"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / leaderboards"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "file",
- "description": "Host Demo",
- "name": "host_demo",
- "in": "formData",
- "required": true
- },
- {
- "type": "file",
- "description": "Partner Demo",
- "name": "partner_demo",
- "in": "formData"
- },
- {
- "type": "boolean",
- "description": "Is Partner Orange",
- "name": "is_partner_orange",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "Partner ID",
- "name": "partner_id",
- "in": "formData"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.RecordResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/maps/{mapid}/record/{recordid}": {
- "delete": {
- "description": "Delete record with specified map and record id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / leaderboards"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "Record ID",
- "name": "recordid",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- }
- },
- "/maps/{mapid}/summary": {
- "get": {
- "description": "Get map summary with specified id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.MapSummaryResponse"
- }
- }
- }
- ]
- }
- }
- }
- },
- "put": {
- "description": "Edit map summary with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.EditMapSummaryRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.EditMapSummaryRequest"
- }
- }
- }
- ]
- }
- }
- }
- },
- "post": {
- "description": "Create map summary with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.CreateMapSummaryRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.CreateMapSummaryRequest"
- }
- }
- }
- ]
- }
- }
- }
- },
- "delete": {
- "description": "Delete map summary with specified map id.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "maps / summary"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "integer",
- "description": "Map ID",
- "name": "mapid",
- "in": "path",
- "required": true
- },
- {
- "description": "Body",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handlers.DeleteMapSummaryRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.DeleteMapSummaryRequest"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/profile": {
- "get": {
- "description": "Get profile page of session user.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "users"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ProfileResponse"
- }
- }
- }
- ]
- }
- }
- }
- },
- "put": {
- "description": "Update country code of session user.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "users"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- },
- {
- "type": "string",
- "description": "Country Code [XX]",
- "name": "country_code",
- "in": "query",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- },
- "post": {
- "description": "Update profile page of session user.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "users"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "JWT Token",
- "name": "Authorization",
- "in": "header",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ProfileResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/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/handlers.RankingsResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/search": {
- "get": {
- "description": "Get all user and map data matching to the query.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "search"
- ],
- "parameters": [
- {
- "type": "string",
- "description": "Search user or map name.",
- "name": "q",
- "in": "query"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.SearchResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
- "/token": {
- "get": {
- "description": "Gets the token cookie value from the user.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "auth"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.LoginResponse"
- }
- }
- }
- ]
- }
- },
- "404": {
- "description": "Not Found",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- },
- "delete": {
- "description": "Deletes the token cookie from the user.",
- "produces": [
- "application/json"
- ],
- "tags": [
- "auth"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.LoginResponse"
- }
- }
- }
- ]
- }
- },
- "404": {
- "description": "Not Found",
- "schema": {
- "$ref": "#/definitions/models.Response"
- }
- }
- }
- }
- },
- "/users/{userid}": {
- "get": {
- "description": "Get profile page of another user.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "users"
- ],
- "parameters": [
- {
- "type": "integer",
- "description": "User ID",
- "name": "userid",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/models.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/handlers.ProfileResponse"
- }
- }
- }
- ]
- }
- }
- }
- }
- }
- },
- "definitions": {
- "handlers.ChapterMapsResponse": {
- "type": "object",
- "properties": {
- "chapter": {
- "$ref": "#/definitions/models.Chapter"
- },
- "maps": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.MapSelect"
- }
- }
- }
- },
- "handlers.ChaptersResponse": {
- "type": "object",
- "properties": {
- "chapters": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.Chapter"
- }
- },
- "game": {
- "$ref": "#/definitions/models.Game"
- }
- }
- },
- "handlers.CreateMapDiscussionCommentRequest": {
- "type": "object",
- "required": [
- "comment"
- ],
- "properties": {
- "comment": {
- "type": "string"
- }
- }
- },
- "handlers.CreateMapDiscussionRequest": {
- "type": "object",
- "required": [
- "content",
- "title"
- ],
- "properties": {
- "content": {
- "type": "string"
- },
- "title": {
- "type": "string"
- }
- }
- },
- "handlers.CreateMapSummaryRequest": {
- "type": "object",
- "required": [
- "category_id",
- "description",
- "record_date",
- "score_count",
- "user_name"
- ],
- "properties": {
- "category_id": {
- "type": "integer"
- },
- "description": {
- "type": "string"
- },
- "record_date": {
- "type": "string"
- },
- "score_count": {
- "type": "integer"
- },
- "showcase": {
- "type": "string"
- },
- "user_name": {
- "type": "string"
- }
- }
- },
- "handlers.DeleteMapSummaryRequest": {
- "type": "object",
- "required": [
- "route_id"
- ],
- "properties": {
- "route_id": {
- "type": "integer"
- }
- }
- },
- "handlers.EditMapDiscussionRequest": {
- "type": "object",
- "required": [
- "content",
- "title"
- ],
- "properties": {
- "content": {
- "type": "string"
- },
- "title": {
- "type": "string"
- }
- }
- },
- "handlers.EditMapImageRequest": {
- "type": "object",
- "required": [
- "image"
- ],
- "properties": {
- "image": {
- "type": "string"
- }
- }
- },
- "handlers.EditMapSummaryRequest": {
- "type": "object",
- "required": [
- "description",
- "record_date",
- "route_id",
- "score_count",
- "user_name"
- ],
- "properties": {
- "description": {
- "type": "string"
- },
- "record_date": {
- "type": "string"
- },
- "route_id": {
- "type": "integer"
- },
- "score_count": {
- "type": "integer"
- },
- "showcase": {
- "type": "string"
- },
- "user_name": {
- "type": "string"
- }
- }
- },
- "handlers.LoginResponse": {
- "type": "object",
- "properties": {
- "token": {
- "type": "string"
- }
- }
- },
- "handlers.LogsResponse": {
- "type": "object",
- "properties": {
- "logs": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.LogsResponseDetails"
- }
- }
- }
- },
- "handlers.LogsResponseDetails": {
- "type": "object",
- "properties": {
- "date": {
- "type": "string"
- },
- "detail": {
- "type": "string"
- },
- "message": {
- "type": "string"
- },
- "user": {
- "$ref": "#/definitions/models.UserShort"
- }
- }
- },
- "handlers.MapDiscussion": {
- "type": "object",
- "properties": {
- "comments": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.MapDiscussionComment"
- }
- },
- "content": {
- "type": "string"
- },
- "created_at": {
- "description": "Upvotes int `json:\"upvotes\"`",
- "type": "string"
- },
- "creator": {
- "$ref": "#/definitions/models.UserShortWithAvatar"
- },
- "id": {
- "type": "integer"
- },
- "title": {
- "type": "string"
- },
- "updated_at": {
- "type": "string"
- }
- }
- },
- "handlers.MapDiscussionComment": {
- "type": "object",
- "properties": {
- "comment": {
- "type": "string"
- },
- "date": {
- "type": "string"
- },
- "user": {
- "$ref": "#/definitions/models.UserShortWithAvatar"
- }
- }
- },
- "handlers.MapDiscussionResponse": {
- "type": "object",
- "properties": {
- "discussion": {
- "$ref": "#/definitions/handlers.MapDiscussion"
- }
- }
- },
- "handlers.MapDiscussionsResponse": {
- "type": "object",
- "properties": {
- "discussions": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.MapDiscussion"
- }
- }
- }
- },
- "handlers.MapLeaderboardsResponse": {
- "type": "object",
- "properties": {
- "map": {
- "$ref": "#/definitions/models.Map"
- },
- "pagination": {
- "$ref": "#/definitions/models.Pagination"
- },
- "records": {}
- }
- },
- "handlers.MapShortWithGame": {
- "type": "object",
- "properties": {
- "chapter": {
- "type": "string"
- },
- "game": {
- "type": "string"
- },
- "id": {
- "type": "integer"
- },
- "map": {
- "type": "string"
- }
- }
- },
- "handlers.MapSummaryResponse": {
- "type": "object",
- "properties": {
- "map": {
- "$ref": "#/definitions/models.Map"
- },
- "summary": {
- "$ref": "#/definitions/models.MapSummary"
- }
- }
- },
- "handlers.ProfileRankings": {
- "type": "object",
- "properties": {
- "cooperative": {
- "$ref": "#/definitions/handlers.ProfileRankingsDetails"
- },
- "overall": {
- "$ref": "#/definitions/handlers.ProfileRankingsDetails"
- },
- "singleplayer": {
- "$ref": "#/definitions/handlers.ProfileRankingsDetails"
- }
- }
- },
- "handlers.ProfileRankingsDetails": {
- "type": "object",
- "properties": {
- "completion_count": {
- "type": "integer"
- },
- "completion_total": {
- "type": "integer"
- },
- "rank": {
- "type": "integer"
- }
- }
- },
- "handlers.ProfileRecords": {
- "type": "object",
- "properties": {
- "category_id": {
- "type": "integer"
- },
- "game_id": {
- "type": "integer"
- },
- "map_id": {
- "type": "integer"
- },
- "map_name": {
- "type": "string"
- },
- "map_wr_count": {
- "type": "integer"
- },
- "placement": {
- "type": "integer"
- },
- "scores": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.ProfileScores"
- }
- }
- }
- },
- "handlers.ProfileResponse": {
- "type": "object",
- "properties": {
- "avatar_link": {
- "type": "string"
- },
- "country_code": {
- "type": "string"
- },
- "links": {
- "$ref": "#/definitions/models.Links"
- },
- "pagination": {
- "$ref": "#/definitions/models.Pagination"
- },
- "profile": {
- "type": "boolean"
- },
- "rankings": {
- "$ref": "#/definitions/handlers.ProfileRankings"
- },
- "records": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.ProfileRecords"
- }
- },
- "steam_id": {
- "type": "string"
- },
- "titles": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.Title"
- }
- },
- "user_name": {
- "type": "string"
- }
- }
- },
- "handlers.ProfileScores": {
- "type": "object",
- "properties": {
- "date": {
- "type": "string"
- },
- "demo_id": {
- "type": "string"
- },
- "record_id": {
- "type": "integer"
- },
- "score_count": {
- "type": "integer"
- },
- "score_time": {
- "type": "integer"
- }
- }
- },
- "handlers.RankingsResponse": {
- "type": "object",
- "properties": {
- "rankings_multiplayer": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.UserRanking"
- }
- },
- "rankings_overall": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.UserRanking"
- }
- },
- "rankings_singleplayer": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.UserRanking"
- }
- }
- }
- },
- "handlers.RecordResponse": {
- "type": "object",
- "properties": {
- "score_count": {
- "type": "integer"
- },
- "score_time": {
- "type": "integer"
- }
- }
- },
- "handlers.ScoreLogsResponse": {
- "type": "object",
- "properties": {
- "scores": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.ScoreLogsResponseDetails"
- }
- }
- }
- },
- "handlers.ScoreLogsResponseDetails": {
- "type": "object",
- "properties": {
- "date": {
- "type": "string"
- },
- "demo_id": {
- "type": "string"
- },
- "game": {
- "$ref": "#/definitions/models.Game"
- },
- "map": {
- "$ref": "#/definitions/models.MapShort"
- },
- "score_count": {
- "type": "integer"
- },
- "score_time": {
- "type": "integer"
- },
- "user": {
- "$ref": "#/definitions/models.UserShort"
- }
- }
- },
- "handlers.SearchResponse": {
- "type": "object",
- "properties": {
- "maps": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handlers.MapShortWithGame"
- }
- },
- "players": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.UserShortWithAvatar"
- }
- }
- }
- },
- "models.Category": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.CategoryPortal": {
- "type": "object",
- "properties": {
- "category": {
- "$ref": "#/definitions/models.Category"
- },
- "portal_count": {
- "type": "integer"
- }
- }
- },
- "models.Chapter": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_disabled": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.Game": {
- "type": "object",
- "properties": {
- "category_portals": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.CategoryPortal"
- }
- },
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_coop": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.Links": {
- "type": "object",
- "properties": {
- "p2sr": {
- "type": "string"
- },
- "steam": {
- "type": "string"
- },
- "twitch": {
- "type": "string"
- },
- "youtube": {
- "type": "string"
- }
- }
- },
- "models.Map": {
- "type": "object",
- "properties": {
- "chapter_name": {
- "type": "string"
- },
- "game_name": {
- "type": "string"
- },
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_coop": {
- "type": "boolean"
- },
- "is_disabled": {
- "type": "boolean"
- },
- "map_name": {
- "type": "string"
- }
- }
- },
- "models.MapHistory": {
- "type": "object",
- "properties": {
- "date": {
- "type": "string"
- },
- "runner_name": {
- "type": "string"
- },
- "score_count": {
- "type": "integer"
- }
- }
- },
- "models.MapRoute": {
- "type": "object",
- "properties": {
- "category": {
- "$ref": "#/definitions/models.Category"
- },
- "completion_count": {
- "type": "integer"
- },
- "description": {
- "type": "string"
- },
- "history": {
- "$ref": "#/definitions/models.MapHistory"
- },
- "rating": {
- "type": "number"
- },
- "route_id": {
- "type": "integer"
- },
- "showcase": {
- "type": "string"
- }
- }
- },
- "models.MapSelect": {
- "type": "object",
- "properties": {
- "category_portals": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.CategoryPortal"
- }
- },
- "difficulty": {
- "type": "integer"
- },
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_disabled": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.MapShort": {
- "type": "object",
- "properties": {
- "difficulty": {
- "type": "integer"
- },
- "id": {
- "type": "integer"
- },
- "image": {
- "type": "string"
- },
- "is_disabled": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- },
- "portal_count": {
- "type": "integer"
- }
- }
- },
- "models.MapSummary": {
- "type": "object",
- "properties": {
- "routes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/models.MapRoute"
- }
- }
- }
- },
- "models.Pagination": {
- "type": "object",
- "properties": {
- "current_page": {
- "type": "integer"
- },
- "page_size": {
- "type": "integer"
- },
- "total_pages": {
- "type": "integer"
- },
- "total_records": {
- "type": "integer"
- }
- }
- },
- "models.Response": {
- "type": "object",
- "properties": {
- "data": {},
- "message": {
- "type": "string"
- },
- "success": {
- "type": "boolean"
- }
- }
- },
- "models.Title": {
- "type": "object",
- "properties": {
- "color": {
- "type": "string"
- },
- "name": {
- "type": "string"
- }
- }
- },
- "models.UserRanking": {
- "type": "object",
- "properties": {
- "placement": {
- "type": "integer"
- },
- "total_score": {
- "type": "integer"
- },
- "user": {
- "$ref": "#/definitions/models.UserShortWithAvatar"
- }
- }
- },
- "models.UserShort": {
- "type": "object",
- "properties": {
- "steam_id": {
- "type": "string"
- },
- "user_name": {
- "type": "string"
- }
- }
- },
- "models.UserShortWithAvatar": {
- "type": "object",
- "properties": {
- "avatar_link": {
- "type": "string"
- },
- "steam_id": {
- "type": "string"
- },
- "user_name": {
- "type": "string"
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
deleted file mode 100644
index bdfed28..0000000
--- a/docs/swagger.yaml
+++ /dev/null
@@ -1,1324 +0,0 @@
-basePath: /api/v1
-definitions:
- handlers.ChapterMapsResponse:
- properties:
- chapter:
- $ref: '#/definitions/models.Chapter'
- maps:
- items:
- $ref: '#/definitions/models.MapSelect'
- type: array
- type: object
- handlers.ChaptersResponse:
- properties:
- chapters:
- items:
- $ref: '#/definitions/models.Chapter'
- type: array
- game:
- $ref: '#/definitions/models.Game'
- type: object
- handlers.CreateMapDiscussionCommentRequest:
- properties:
- comment:
- type: string
- required:
- - comment
- type: object
- handlers.CreateMapDiscussionRequest:
- properties:
- content:
- type: string
- title:
- type: string
- required:
- - content
- - title
- type: object
- handlers.CreateMapSummaryRequest:
- properties:
- category_id:
- type: integer
- description:
- type: string
- record_date:
- type: string
- score_count:
- type: integer
- showcase:
- type: string
- user_name:
- type: string
- required:
- - category_id
- - description
- - record_date
- - score_count
- - user_name
- type: object
- handlers.DeleteMapSummaryRequest:
- properties:
- route_id:
- type: integer
- required:
- - route_id
- type: object
- handlers.EditMapDiscussionRequest:
- properties:
- content:
- type: string
- title:
- type: string
- required:
- - content
- - title
- type: object
- handlers.EditMapImageRequest:
- properties:
- image:
- type: string
- required:
- - image
- type: object
- handlers.EditMapSummaryRequest:
- properties:
- description:
- type: string
- record_date:
- type: string
- route_id:
- type: integer
- score_count:
- type: integer
- showcase:
- type: string
- user_name:
- type: string
- required:
- - description
- - record_date
- - route_id
- - score_count
- - user_name
- type: object
- handlers.LoginResponse:
- properties:
- token:
- type: string
- type: object
- handlers.LogsResponse:
- properties:
- logs:
- items:
- $ref: '#/definitions/handlers.LogsResponseDetails'
- type: array
- type: object
- handlers.LogsResponseDetails:
- properties:
- date:
- type: string
- detail:
- type: string
- message:
- type: string
- user:
- $ref: '#/definitions/models.UserShort'
- type: object
- handlers.MapDiscussion:
- properties:
- comments:
- items:
- $ref: '#/definitions/handlers.MapDiscussionComment'
- type: array
- content:
- type: string
- created_at:
- description: Upvotes int `json:"upvotes"`
- type: string
- creator:
- $ref: '#/definitions/models.UserShortWithAvatar'
- id:
- type: integer
- title:
- type: string
- updated_at:
- type: string
- type: object
- handlers.MapDiscussionComment:
- properties:
- comment:
- type: string
- date:
- type: string
- user:
- $ref: '#/definitions/models.UserShortWithAvatar'
- type: object
- handlers.MapDiscussionResponse:
- properties:
- discussion:
- $ref: '#/definitions/handlers.MapDiscussion'
- type: object
- handlers.MapDiscussionsResponse:
- properties:
- discussions:
- items:
- $ref: '#/definitions/handlers.MapDiscussion'
- type: array
- type: object
- handlers.MapLeaderboardsResponse:
- properties:
- map:
- $ref: '#/definitions/models.Map'
- pagination:
- $ref: '#/definitions/models.Pagination'
- records: {}
- type: object
- handlers.MapShortWithGame:
- properties:
- chapter:
- type: string
- game:
- type: string
- id:
- type: integer
- map:
- type: string
- type: object
- handlers.MapSummaryResponse:
- properties:
- map:
- $ref: '#/definitions/models.Map'
- summary:
- $ref: '#/definitions/models.MapSummary'
- type: object
- handlers.ProfileRankings:
- properties:
- cooperative:
- $ref: '#/definitions/handlers.ProfileRankingsDetails'
- overall:
- $ref: '#/definitions/handlers.ProfileRankingsDetails'
- singleplayer:
- $ref: '#/definitions/handlers.ProfileRankingsDetails'
- type: object
- handlers.ProfileRankingsDetails:
- properties:
- completion_count:
- type: integer
- completion_total:
- type: integer
- rank:
- type: integer
- type: object
- handlers.ProfileRecords:
- properties:
- category_id:
- type: integer
- game_id:
- type: integer
- map_id:
- type: integer
- map_name:
- type: string
- map_wr_count:
- type: integer
- placement:
- type: integer
- scores:
- items:
- $ref: '#/definitions/handlers.ProfileScores'
- type: array
- type: object
- handlers.ProfileResponse:
- properties:
- avatar_link:
- type: string
- country_code:
- type: string
- links:
- $ref: '#/definitions/models.Links'
- pagination:
- $ref: '#/definitions/models.Pagination'
- profile:
- type: boolean
- rankings:
- $ref: '#/definitions/handlers.ProfileRankings'
- records:
- items:
- $ref: '#/definitions/handlers.ProfileRecords'
- type: array
- steam_id:
- type: string
- titles:
- items:
- $ref: '#/definitions/models.Title'
- type: array
- user_name:
- type: string
- type: object
- handlers.ProfileScores:
- properties:
- date:
- type: string
- demo_id:
- type: string
- record_id:
- type: integer
- score_count:
- type: integer
- score_time:
- type: integer
- type: object
- handlers.RankingsResponse:
- properties:
- rankings_multiplayer:
- items:
- $ref: '#/definitions/models.UserRanking'
- type: array
- rankings_overall:
- items:
- $ref: '#/definitions/models.UserRanking'
- type: array
- rankings_singleplayer:
- items:
- $ref: '#/definitions/models.UserRanking'
- type: array
- type: object
- handlers.RecordResponse:
- properties:
- score_count:
- type: integer
- score_time:
- type: integer
- type: object
- handlers.ScoreLogsResponse:
- properties:
- scores:
- items:
- $ref: '#/definitions/handlers.ScoreLogsResponseDetails'
- type: array
- type: object
- handlers.ScoreLogsResponseDetails:
- properties:
- date:
- type: string
- demo_id:
- type: string
- game:
- $ref: '#/definitions/models.Game'
- map:
- $ref: '#/definitions/models.MapShort'
- score_count:
- type: integer
- score_time:
- type: integer
- user:
- $ref: '#/definitions/models.UserShort'
- type: object
- handlers.SearchResponse:
- properties:
- maps:
- items:
- $ref: '#/definitions/handlers.MapShortWithGame'
- type: array
- players:
- items:
- $ref: '#/definitions/models.UserShortWithAvatar'
- type: array
- type: object
- models.Category:
- properties:
- id:
- type: integer
- name:
- type: string
- type: object
- models.CategoryPortal:
- properties:
- category:
- $ref: '#/definitions/models.Category'
- portal_count:
- type: integer
- type: object
- models.Chapter:
- properties:
- id:
- type: integer
- image:
- type: string
- is_disabled:
- type: boolean
- name:
- type: string
- type: object
- models.Game:
- properties:
- category_portals:
- items:
- $ref: '#/definitions/models.CategoryPortal'
- type: array
- id:
- type: integer
- image:
- type: string
- is_coop:
- type: boolean
- name:
- type: string
- type: object
- models.Links:
- properties:
- p2sr:
- type: string
- steam:
- type: string
- twitch:
- type: string
- youtube:
- type: string
- type: object
- models.Map:
- properties:
- chapter_name:
- type: string
- game_name:
- type: string
- id:
- type: integer
- image:
- type: string
- is_coop:
- type: boolean
- is_disabled:
- type: boolean
- map_name:
- type: string
- type: object
- models.MapHistory:
- properties:
- date:
- type: string
- runner_name:
- type: string
- score_count:
- type: integer
- type: object
- models.MapRoute:
- properties:
- category:
- $ref: '#/definitions/models.Category'
- completion_count:
- type: integer
- description:
- type: string
- history:
- $ref: '#/definitions/models.MapHistory'
- rating:
- type: number
- route_id:
- type: integer
- showcase:
- type: string
- type: object
- models.MapSelect:
- properties:
- category_portals:
- items:
- $ref: '#/definitions/models.CategoryPortal'
- type: array
- difficulty:
- type: integer
- id:
- type: integer
- image:
- type: string
- is_disabled:
- type: boolean
- name:
- type: string
- type: object
- models.MapShort:
- properties:
- difficulty:
- type: integer
- id:
- type: integer
- image:
- type: string
- is_disabled:
- type: boolean
- name:
- type: string
- portal_count:
- type: integer
- type: object
- models.MapSummary:
- properties:
- routes:
- items:
- $ref: '#/definitions/models.MapRoute'
- type: array
- type: object
- models.Pagination:
- properties:
- current_page:
- type: integer
- page_size:
- type: integer
- total_pages:
- type: integer
- total_records:
- type: integer
- type: object
- models.Response:
- properties:
- data: {}
- message:
- type: string
- success:
- type: boolean
- type: object
- models.Title:
- properties:
- color:
- type: string
- name:
- type: string
- type: object
- models.UserRanking:
- properties:
- placement:
- type: integer
- total_score:
- type: integer
- user:
- $ref: '#/definitions/models.UserShortWithAvatar'
- type: object
- models.UserShort:
- properties:
- steam_id:
- type: string
- user_name:
- type: string
- type: object
- models.UserShortWithAvatar:
- properties:
- avatar_link:
- type: string
- steam_id:
- type: string
- user_name:
- type: string
- type: object
-host: lp.ardapektezol.com
-info:
- contact: {}
- description: Backend API endpoints for the Least Portals Database.
- license:
- name: GNU General Public License, Version 2
- url: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
- title: Least Portals Database API
- version: "1.0"
-paths:
- /chapters/{chapterid}:
- get:
- description: Get maps from the specified chapter id.
- parameters:
- - description: Chapter ID
- in: path
- name: chapterid
- required: true
- type: integer
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.ChapterMapsResponse'
- type: object
- "400":
- description: Bad Request
- schema:
- $ref: '#/definitions/models.Response'
- tags:
- - games & chapters
- /demos:
- get:
- consumes:
- - application/json
- description: Get demo with specified demo uuid.
- parameters:
- - description: Demo UUID
- in: query
- name: uuid
- required: true
- type: string
- produces:
- - application/octet-stream
- responses:
- "200":
- description: Demo File
- schema:
- type: file
- tags:
- - demo
- /games:
- get:
- description: Get games from the leaderboards.
- 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'
- tags:
- - games & chapters
- /games/{gameid}:
- get:
- description: Get chapters from the specified game id.
- parameters:
- - description: Game ID
- in: path
- name: gameid
- required: true
- type: integer
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.ChaptersResponse'
- type: object
- tags:
- - games & chapters
- /games/{gameid}/maps:
- get:
- description: Get maps from the specified game id.
- parameters:
- - description: Game ID
- in: path
- name: gameid
- required: true
- type: integer
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.ChaptersResponse'
- type: object
- tags:
- - games & chapters
- /login:
- get:
- consumes:
- - application/json
- description: Get (redirect) login page for Steam auth.
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.LoginResponse'
- type: object
- tags:
- - login
- /logs/mod:
- get:
- description: Get mod logs.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.LogsResponse'
- type: object
- tags:
- - logs
- /logs/score:
- get:
- description: Get score logs of every player.
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.ScoreLogsResponse'
- type: object
- tags:
- - logs
- /maps/{mapid}/discussions:
- get:
- description: Get map discussions with specified map id.
- parameters:
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.MapDiscussionsResponse'
- type: object
- tags:
- - maps / discussions
- post:
- description: Create map discussion with specified map id.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Body
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/handlers.CreateMapDiscussionRequest'
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.CreateMapDiscussionRequest'
- type: object
- tags:
- - maps / discussions
- /maps/{mapid}/discussions/{discussionid}:
- delete:
- description: Delete map discussion with specified map id.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Discussion ID
- in: path
- name: discussionid
- required: true
- type: integer
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- $ref: '#/definitions/models.Response'
- tags:
- - maps / discussions
- get:
- description: Get map discussion with specified map and discussion id.
- parameters:
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Discussion ID
- in: path
- name: discussionid
- required: true
- type: integer
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.MapDiscussionResponse'
- type: object
- tags:
- - maps / discussions
- post:
- description: Create map discussion comment with specified map id.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Discussion ID
- in: path
- name: discussionid
- required: true
- type: integer
- - description: Body
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/handlers.CreateMapDiscussionCommentRequest'
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.CreateMapDiscussionCommentRequest'
- type: object
- tags:
- - maps / discussions
- put:
- description: Edit map discussion with specified map id.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Discussion ID
- in: path
- name: discussionid
- required: true
- type: integer
- - description: Body
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/handlers.EditMapDiscussionRequest'
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.EditMapDiscussionRequest'
- type: object
- tags:
- - maps / discussions
- /maps/{mapid}/image:
- put:
- description: Edit map image with specified map id.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Body
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/handlers.EditMapImageRequest'
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.EditMapImageRequest'
- type: object
- tags:
- - maps / summary
- /maps/{mapid}/leaderboards:
- get:
- description: Get map leaderboards with specified id.
- parameters:
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: 'Page Number (default: 1)'
- in: query
- name: page
- type: integer
- - description: 'Number of Records Per Page (default: 20)'
- in: query
- name: pageSize
- type: integer
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.MapLeaderboardsResponse'
- type: object
- tags:
- - maps / leaderboards
- /maps/{mapid}/record:
- post:
- consumes:
- - multipart/form-data
- description: Post record with demo of a specific map.
- parameters:
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Host Demo
- in: formData
- name: host_demo
- required: true
- type: file
- - description: Partner Demo
- in: formData
- name: partner_demo
- type: file
- - description: Is Partner Orange
- in: formData
- name: is_partner_orange
- type: boolean
- - description: Partner ID
- in: formData
- name: partner_id
- type: string
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.RecordResponse'
- type: object
- tags:
- - maps / leaderboards
- /maps/{mapid}/record/{recordid}:
- delete:
- description: Delete record with specified map and record id.
- parameters:
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Record ID
- in: path
- name: recordid
- required: true
- type: integer
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- $ref: '#/definitions/models.Response'
- tags:
- - maps / leaderboards
- /maps/{mapid}/summary:
- delete:
- description: Delete map summary with specified map id.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Body
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/handlers.DeleteMapSummaryRequest'
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.DeleteMapSummaryRequest'
- type: object
- tags:
- - maps / summary
- get:
- description: Get map summary with specified id.
- parameters:
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.MapSummaryResponse'
- type: object
- tags:
- - maps / summary
- post:
- description: Create map summary with specified map id.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Body
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/handlers.CreateMapSummaryRequest'
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.CreateMapSummaryRequest'
- type: object
- tags:
- - maps / summary
- put:
- description: Edit map summary with specified map id.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Map ID
- in: path
- name: mapid
- required: true
- type: integer
- - description: Body
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/handlers.EditMapSummaryRequest'
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.EditMapSummaryRequest'
- type: object
- tags:
- - maps / summary
- /profile:
- get:
- consumes:
- - application/json
- description: Get profile page of session user.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.ProfileResponse'
- type: object
- tags:
- - users
- post:
- consumes:
- - application/json
- description: Update profile page of session user.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.ProfileResponse'
- type: object
- tags:
- - users
- put:
- consumes:
- - application/json
- description: Update country code of session user.
- parameters:
- - description: JWT Token
- in: header
- name: Authorization
- required: true
- type: string
- - description: Country Code [XX]
- in: query
- name: country_code
- required: true
- type: string
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- $ref: '#/definitions/models.Response'
- 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/handlers.RankingsResponse'
- type: object
- tags:
- - rankings
- /search:
- get:
- description: Get all user and map data matching to the query.
- parameters:
- - description: Search user or map name.
- in: query
- name: q
- type: string
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.SearchResponse'
- type: object
- tags:
- - search
- /token:
- delete:
- description: Deletes the token cookie from the user.
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.LoginResponse'
- type: object
- "404":
- description: Not Found
- schema:
- $ref: '#/definitions/models.Response'
- tags:
- - auth
- get:
- description: Gets the token cookie value from the user.
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.LoginResponse'
- type: object
- "404":
- description: Not Found
- schema:
- $ref: '#/definitions/models.Response'
- tags:
- - auth
- /users/{userid}:
- get:
- consumes:
- - application/json
- description: Get profile page of another user.
- parameters:
- - description: User ID
- in: path
- name: userid
- required: true
- type: integer
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- allOf:
- - $ref: '#/definitions/models.Response'
- - properties:
- data:
- $ref: '#/definitions/handlers.ProfileResponse'
- type: object
- tags:
- - users
-swagger: "2.0"
--
cgit v1.2.3