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 --- .env.example | 12 - backend/.env.example | 12 + backend/api/auth.go | 5 +- backend/api/routes.go | 3 +- backend/docs/docs.go | 2160 +++++++++++++++++++++++++++++++++++++++ backend/docs/swagger.json | 2136 ++++++++++++++++++++++++++++++++++++++ backend/docs/swagger.yaml | 1324 ++++++++++++++++++++++++ backend/go.mod | 79 ++ backend/go.sum | 270 +++++ backend/handlers/discussions.go | 5 +- backend/handlers/home.go | 5 +- backend/handlers/login.go | 5 +- backend/handlers/logs.go | 5 +- backend/handlers/map.go | 5 +- backend/handlers/mod.go | 5 +- backend/handlers/record.go | 7 +- backend/handlers/user.go | 5 +- backend/main.go | 37 + docs/docs.go | 2160 --------------------------------------- docs/index.html | 26 - docs/swagger.json | 2136 -------------------------------------- docs/swagger.yaml | 1324 ------------------------ go.mod | 64 -- go.sum | 298 ------ main.go | 36 - 25 files changed, 6048 insertions(+), 6076 deletions(-) delete mode 100644 .env.example create mode 100644 backend/.env.example create mode 100644 backend/docs/docs.go create mode 100644 backend/docs/swagger.json create mode 100644 backend/docs/swagger.yaml create mode 100644 backend/go.mod create mode 100644 backend/go.sum create mode 100644 backend/main.go delete mode 100644 docs/docs.go delete mode 100644 docs/index.html delete mode 100644 docs/swagger.json delete mode 100644 docs/swagger.yaml delete mode 100644 go.mod delete mode 100644 go.sum delete mode 100644 main.go diff --git a/.env.example b/.env.example deleted file mode 100644 index 774f2a2..0000000 --- a/.env.example +++ /dev/null @@ -1,12 +0,0 @@ -PORT= -SECRET_KEY= -API_KEY= -ENV= -DB_HOST= -DB_PORT= -DB_USER= -DB_PASS= -DB_NAME= -GOOGLE_CLIENT_EMAIL= -GOOGLE_PRIVATE_KEY_BASE64= -GOOGLE_FOLDER_ID= \ No newline at end of file diff --git a/backend/.env.example b/backend/.env.example new file mode 100644 index 0000000..774f2a2 --- /dev/null +++ b/backend/.env.example @@ -0,0 +1,12 @@ +PORT= +SECRET_KEY= +API_KEY= +ENV= +DB_HOST= +DB_PORT= +DB_USER= +DB_PASS= +DB_NAME= +GOOGLE_CLIENT_EMAIL= +GOOGLE_PRIVATE_KEY_BASE64= +GOOGLE_FOLDER_ID= \ No newline at end of file diff --git a/backend/api/auth.go b/backend/api/auth.go index 91ef80c..621a68b 100644 --- a/backend/api/auth.go +++ b/backend/api/auth.go @@ -5,10 +5,11 @@ import ( "os" "time" + "lphub/database" + "lphub/models" + "github.com/gin-gonic/gin" "github.com/golang-jwt/jwt/v4" - "github.com/pektezol/leastportalshub/backend/database" - "github.com/pektezol/leastportalshub/backend/models" ) func CheckAuth(c *gin.Context) { diff --git a/backend/api/routes.go b/backend/api/routes.go index ed1ca90..050a3bd 100644 --- a/backend/api/routes.go +++ b/backend/api/routes.go @@ -1,8 +1,9 @@ package api import ( + "lphub/handlers" + "github.com/gin-gonic/gin" - "github.com/pektezol/leastportalshub/backend/handlers" swaggerfiles "github.com/swaggo/files" ginSwagger "github.com/swaggo/gin-swagger" ) diff --git a/backend/docs/docs.go b/backend/docs/docs.go new file mode 100644 index 0000000..f652a1e --- /dev/null +++ b/backend/docs/docs.go @@ -0,0 +1,2160 @@ +// 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 Affero General Public License, Version 3", + "url": "https://www.gnu.org/licenses/agpl-3.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/backend/docs/swagger.json b/backend/docs/swagger.json new file mode 100644 index 0000000..6de5978 --- /dev/null +++ b/backend/docs/swagger.json @@ -0,0 +1,2136 @@ +{ + "swagger": "2.0", + "info": { + "description": "Backend API endpoints for the Least Portals Database.", + "title": "Least Portals Database API", + "contact": {}, + "license": { + "name": "GNU Affero General Public License, Version 3", + "url": "https://www.gnu.org/licenses/agpl-3.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/backend/docs/swagger.yaml b/backend/docs/swagger.yaml new file mode 100644 index 0000000..853b3b9 --- /dev/null +++ b/backend/docs/swagger.yaml @@ -0,0 +1,1324 @@ +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 Affero General Public License, Version 3 + url: https://www.gnu.org/licenses/agpl-3.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" diff --git a/backend/go.mod b/backend/go.mod new file mode 100644 index 0000000..2dbad6b --- /dev/null +++ b/backend/go.mod @@ -0,0 +1,79 @@ +module lphub + +go 1.23 + +require ( + github.com/gin-gonic/gin v1.10.0 + github.com/joho/godotenv v1.5.1 +) + +require ( + github.com/golang-jwt/jwt/v4 v4.5.0 + github.com/google/uuid v1.6.0 + github.com/pektezol/steam_go v1.1.2 + github.com/swaggo/files v1.0.1 + github.com/swaggo/gin-swagger v1.6.0 + github.com/swaggo/swag v1.16.3 +) + +require ( + cloud.google.com/go/auth v0.9.3 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect + cloud.google.com/go/compute/metadata v0.5.0 // indirect + github.com/KyleBanks/depth v1.2.1 // indirect + github.com/bytedance/sonic v1.12.2 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/gabriel-vasile/mimetype v1.4.5 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/spec v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/google/s2a-go v0.1.8 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect + github.com/googleapis/gax-go/v2 v2.13.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/klauspost/cpuid/v2 v2.2.8 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect + go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel/metric v1.29.0 // indirect + go.opentelemetry.io/otel/trace v1.29.0 // indirect + golang.org/x/arch v0.10.0 // indirect + golang.org/x/tools v0.25.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +require ( + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.22.1 // indirect + github.com/goccy/go-json v0.10.3 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/lib/pq v1.10.9 + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pektezol/bitreader v1.4.3 + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/oauth2 v0.23.0 + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/api v0.196.0 + google.golang.org/protobuf v1.34.2 // indirect +) diff --git a/backend/go.sum b/backend/go.sum new file mode 100644 index 0000000..10504e4 --- /dev/null +++ b/backend/go.sum @@ -0,0 +1,270 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go/auth v0.9.3 h1:VOEUIAADkkLtyfr3BLa3R8Ed/j6w1jTBmARx+wb5w5U= +cloud.google.com/go/auth v0.9.3/go.mod h1:7z6VY+7h3KUdRov5F1i8NDP5ZzWKYmEPO842BgCsmTk= +cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= +cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= +github.com/bytedance/sonic v1.12.2 h1:oaMFuRTpMHYLpCntGca65YWt5ny+wAceDERTkT2L9lg= +github.com/bytedance/sonic v1.12.2/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/gabriel-vasile/mimetype v1.4.5 h1:J7wGKdGu33ocBOhGy0z653k/lFKLFDPJMG8Gql0kxn4= +github.com/gabriel-vasile/mimetype v1.4.5/go.mod h1:ibHel+/kbxn9x2407k1izTA1S81ku1z/DlgOW2QE0M4= +github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= +github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= +github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= +github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= +github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= +github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= +github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= +github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= +github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= +github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pektezol/bitreader v1.4.3 h1:+WjsD6qOAaI6Q1jOOlEJcnaEso8vPMKRZnnaDnZhTSg= +github.com/pektezol/bitreader v1.4.3/go.mod h1:xBQEsQpOf8B5yPrnOTkirZGyVUV6Bqp0ups2RIlTskk= +github.com/pektezol/steam_go v1.1.2 h1:fta6SW+La8NfmCtR/Kn73bAmTBvCgUkkLCplsJGzx7g= +github.com/pektezol/steam_go v1.1.2/go.mod h1:8dk95CLOQKRr0BA8ChnNbTEe0/f2Ibi5O4rmpS9oZCo= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= +github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= +github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+zy8M= +github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo= +github.com/swaggo/swag v1.16.3 h1:PnCYjPCah8FK4I26l2F/KQ4yz3sILcVUN3cTlBFA9Pg= +github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI/gRk= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= +github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= +go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= +go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= +go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= +go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= +go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +golang.org/x/arch v0.10.0 h1:S3huipmSclq3PJMNe76NGwkBR504WFkQ5dhzWzP8ZW8= +golang.org/x/arch v0.10.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.196.0 h1:k/RafYqebaIJBO3+SMnfEGtFVlvp5vSgqTUF54UN/zg= +google.golang.org/api v0.196.0/go.mod h1:g9IL21uGkYgvQ5BZg6BAtoGJQIm8r6EgaAbpNey5wBE= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= diff --git a/backend/handlers/discussions.go b/backend/handlers/discussions.go index 0fc0c11..604eb39 100644 --- a/backend/handlers/discussions.go +++ b/backend/handlers/discussions.go @@ -5,9 +5,10 @@ import ( "strconv" "time" + "lphub/database" + "lphub/models" + "github.com/gin-gonic/gin" - "github.com/pektezol/leastportalshub/backend/database" - "github.com/pektezol/leastportalshub/backend/models" ) type MapDiscussionResponse struct { diff --git a/backend/handlers/home.go b/backend/handlers/home.go index 16ac993..1734d28 100644 --- a/backend/handlers/home.go +++ b/backend/handlers/home.go @@ -6,9 +6,10 @@ import ( "sort" "strings" + "lphub/database" + "lphub/models" + "github.com/gin-gonic/gin" - "github.com/pektezol/leastportalshub/backend/database" - "github.com/pektezol/leastportalshub/backend/models" ) type SearchResponse struct { diff --git a/backend/handlers/login.go b/backend/handlers/login.go index 8794989..565ebdb 100644 --- a/backend/handlers/login.go +++ b/backend/handlers/login.go @@ -8,10 +8,11 @@ import ( "os" "time" + "lphub/database" + "lphub/models" + "github.com/gin-gonic/gin" "github.com/golang-jwt/jwt/v4" - "github.com/pektezol/leastportalshub/backend/database" - "github.com/pektezol/leastportalshub/backend/models" "github.com/pektezol/steam_go" ) diff --git a/backend/handlers/logs.go b/backend/handlers/logs.go index bf9e494..76ddac4 100644 --- a/backend/handlers/logs.go +++ b/backend/handlers/logs.go @@ -5,9 +5,10 @@ import ( "net/http" "time" + "lphub/database" + "lphub/models" + "github.com/gin-gonic/gin" - "github.com/pektezol/leastportalshub/backend/database" - "github.com/pektezol/leastportalshub/backend/models" ) const ( diff --git a/backend/handlers/map.go b/backend/handlers/map.go index 2f38b32..56c3455 100644 --- a/backend/handlers/map.go +++ b/backend/handlers/map.go @@ -5,9 +5,10 @@ import ( "strconv" "time" + "lphub/database" + "lphub/models" + "github.com/gin-gonic/gin" - "github.com/pektezol/leastportalshub/backend/database" - "github.com/pektezol/leastportalshub/backend/models" ) type MapSummaryResponse struct { diff --git a/backend/handlers/mod.go b/backend/handlers/mod.go index dc3d08d..4fdc78a 100644 --- a/backend/handlers/mod.go +++ b/backend/handlers/mod.go @@ -6,9 +6,10 @@ import ( "strconv" "time" + "lphub/database" + "lphub/models" + "github.com/gin-gonic/gin" - "github.com/pektezol/leastportalshub/backend/database" - "github.com/pektezol/leastportalshub/backend/models" ) type CreateMapSummaryRequest struct { diff --git a/backend/handlers/record.go b/backend/handlers/record.go index c620430..fea6b5d 100644 --- a/backend/handlers/record.go +++ b/backend/handlers/record.go @@ -12,11 +12,12 @@ import ( "strconv" "strings" + "lphub/database" + "lphub/models" + "lphub/parser" + "github.com/gin-gonic/gin" "github.com/google/uuid" - "github.com/pektezol/leastportalshub/backend/database" - "github.com/pektezol/leastportalshub/backend/models" - "github.com/pektezol/leastportalshub/backend/parser" "golang.org/x/oauth2/google" "golang.org/x/oauth2/jwt" "google.golang.org/api/drive/v3" diff --git a/backend/handlers/user.go b/backend/handlers/user.go index 8febf3a..45daa31 100644 --- a/backend/handlers/user.go +++ b/backend/handlers/user.go @@ -6,9 +6,10 @@ import ( "regexp" "time" + "lphub/database" + "lphub/models" + "github.com/gin-gonic/gin" - "github.com/pektezol/leastportalshub/backend/database" - "github.com/pektezol/leastportalshub/backend/models" ) type ProfileResponse struct { diff --git a/backend/main.go b/backend/main.go new file mode 100644 index 0000000..202c607 --- /dev/null +++ b/backend/main.go @@ -0,0 +1,37 @@ +package main + +import ( + "fmt" + "log" + "os" + + "lphub/api" + "lphub/database" + _ "lphub/docs" + + "github.com/gin-gonic/gin" + "github.com/joho/godotenv" +) + +// @title Least Portals Database API +// @version 1.0 +// @description Backend API endpoints for the Least Portals Database. + +// @license.name GNU Affero General Public License, Version 3 +// @license.url https://www.gnu.org/licenses/agpl-3.0.html + +// @host lp.ardapektezol.com +// @BasePath /api/v1 +func main() { + err := godotenv.Load() + if err != nil { + log.Fatal("Error loading .env file") + } + if os.Getenv("ENV") == "PROD" { + gin.SetMode(gin.ReleaseMode) + } + router := gin.Default() + database.ConnectDB() + api.InitRoutes(router) + router.Run(fmt.Sprintf(":%s", os.Getenv("PORT"))) +} 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 @@ - - -
- - - -