diff options
Diffstat (limited to 'backend/docs')
| -rw-r--r-- | backend/docs/docs.go | 148 | ||||
| -rw-r--r-- | backend/docs/swagger.json | 148 | ||||
| -rw-r--r-- | backend/docs/swagger.yaml | 87 |
3 files changed, 272 insertions, 111 deletions
diff --git a/backend/docs/docs.go b/backend/docs/docs.go index 44d53e1..7ce9a8b 100644 --- a/backend/docs/docs.go +++ b/backend/docs/docs.go | |||
| @@ -250,37 +250,6 @@ const docTemplate = `{ | |||
| 250 | } | 250 | } |
| 251 | } | 251 | } |
| 252 | }, | 252 | }, |
| 253 | "/logs/score": { | ||
| 254 | "get": { | ||
| 255 | "description": "Get score logs of every player.", | ||
| 256 | "produces": [ | ||
| 257 | "application/json" | ||
| 258 | ], | ||
| 259 | "tags": [ | ||
| 260 | "logs" | ||
| 261 | ], | ||
| 262 | "responses": { | ||
| 263 | "200": { | ||
| 264 | "description": "OK", | ||
| 265 | "schema": { | ||
| 266 | "allOf": [ | ||
| 267 | { | ||
| 268 | "$ref": "#/definitions/models.Response" | ||
| 269 | }, | ||
| 270 | { | ||
| 271 | "type": "object", | ||
| 272 | "properties": { | ||
| 273 | "data": { | ||
| 274 | "$ref": "#/definitions/handlers.ScoreLogsResponse" | ||
| 275 | } | ||
| 276 | } | ||
| 277 | } | ||
| 278 | ] | ||
| 279 | } | ||
| 280 | } | ||
| 281 | } | ||
| 282 | } | ||
| 283 | }, | ||
| 284 | "/maps/{mapid}/discussions": { | 253 | "/maps/{mapid}/discussions": { |
| 285 | "get": { | 254 | "get": { |
| 286 | "description": "Get map discussions with specified map id.", | 255 | "description": "Get map discussions with specified map id.", |
| @@ -1220,6 +1189,68 @@ const docTemplate = `{ | |||
| 1220 | } | 1189 | } |
| 1221 | } | 1190 | } |
| 1222 | }, | 1191 | }, |
| 1192 | "/stats/scores": { | ||
| 1193 | "get": { | ||
| 1194 | "description": "Get score logs of every player.", | ||
| 1195 | "produces": [ | ||
| 1196 | "application/json" | ||
| 1197 | ], | ||
| 1198 | "tags": [ | ||
| 1199 | "stats" | ||
| 1200 | ], | ||
| 1201 | "responses": { | ||
| 1202 | "200": { | ||
| 1203 | "description": "OK", | ||
| 1204 | "schema": { | ||
| 1205 | "allOf": [ | ||
| 1206 | { | ||
| 1207 | "$ref": "#/definitions/models.Response" | ||
| 1208 | }, | ||
| 1209 | { | ||
| 1210 | "type": "object", | ||
| 1211 | "properties": { | ||
| 1212 | "data": { | ||
| 1213 | "$ref": "#/definitions/handlers.ScoresResponse" | ||
| 1214 | } | ||
| 1215 | } | ||
| 1216 | } | ||
| 1217 | ] | ||
| 1218 | } | ||
| 1219 | } | ||
| 1220 | } | ||
| 1221 | } | ||
| 1222 | }, | ||
| 1223 | "/stats/timeline": { | ||
| 1224 | "get": { | ||
| 1225 | "description": "Get the history of portal count world records over time.", | ||
| 1226 | "produces": [ | ||
| 1227 | "application/json" | ||
| 1228 | ], | ||
| 1229 | "tags": [ | ||
| 1230 | "stats" | ||
| 1231 | ], | ||
| 1232 | "responses": { | ||
| 1233 | "200": { | ||
| 1234 | "description": "OK", | ||
| 1235 | "schema": { | ||
| 1236 | "allOf": [ | ||
| 1237 | { | ||
| 1238 | "$ref": "#/definitions/models.Response" | ||
| 1239 | }, | ||
| 1240 | { | ||
| 1241 | "type": "object", | ||
| 1242 | "properties": { | ||
| 1243 | "data": { | ||
| 1244 | "$ref": "#/definitions/handlers.TimelineResponse" | ||
| 1245 | } | ||
| 1246 | } | ||
| 1247 | } | ||
| 1248 | ] | ||
| 1249 | } | ||
| 1250 | } | ||
| 1251 | } | ||
| 1252 | } | ||
| 1253 | }, | ||
| 1223 | "/token": { | 1254 | "/token": { |
| 1224 | "get": { | 1255 | "get": { |
| 1225 | "description": "Gets the token cookie value from the user.", | 1256 | "description": "Gets the token cookie value from the user.", |
| @@ -1774,18 +1805,7 @@ const docTemplate = `{ | |||
| 1774 | } | 1805 | } |
| 1775 | } | 1806 | } |
| 1776 | }, | 1807 | }, |
| 1777 | "handlers.ScoreLogsResponse": { | 1808 | "handlers.ScoresDetails": { |
| 1778 | "type": "object", | ||
| 1779 | "properties": { | ||
| 1780 | "scores": { | ||
| 1781 | "type": "array", | ||
| 1782 | "items": { | ||
| 1783 | "$ref": "#/definitions/handlers.ScoreLogsResponseDetails" | ||
| 1784 | } | ||
| 1785 | } | ||
| 1786 | } | ||
| 1787 | }, | ||
| 1788 | "handlers.ScoreLogsResponseDetails": { | ||
| 1789 | "type": "object", | 1809 | "type": "object", |
| 1790 | "properties": { | 1810 | "properties": { |
| 1791 | "date": { | 1811 | "date": { |
| @@ -1811,6 +1831,17 @@ const docTemplate = `{ | |||
| 1811 | } | 1831 | } |
| 1812 | } | 1832 | } |
| 1813 | }, | 1833 | }, |
| 1834 | "handlers.ScoresResponse": { | ||
| 1835 | "type": "object", | ||
| 1836 | "properties": { | ||
| 1837 | "scores": { | ||
| 1838 | "type": "array", | ||
| 1839 | "items": { | ||
| 1840 | "$ref": "#/definitions/handlers.ScoresDetails" | ||
| 1841 | } | ||
| 1842 | } | ||
| 1843 | } | ||
| 1844 | }, | ||
| 1814 | "handlers.SearchResponse": { | 1845 | "handlers.SearchResponse": { |
| 1815 | "type": "object", | 1846 | "type": "object", |
| 1816 | "properties": { | 1847 | "properties": { |
| @@ -1860,6 +1891,34 @@ const docTemplate = `{ | |||
| 1860 | } | 1891 | } |
| 1861 | } | 1892 | } |
| 1862 | }, | 1893 | }, |
| 1894 | "handlers.TimelinePoint": { | ||
| 1895 | "type": "object", | ||
| 1896 | "properties": { | ||
| 1897 | "count": { | ||
| 1898 | "type": "integer" | ||
| 1899 | }, | ||
| 1900 | "date": { | ||
| 1901 | "type": "string" | ||
| 1902 | } | ||
| 1903 | } | ||
| 1904 | }, | ||
| 1905 | "handlers.TimelineResponse": { | ||
| 1906 | "type": "object", | ||
| 1907 | "properties": { | ||
| 1908 | "timeline_multiplayer": { | ||
| 1909 | "type": "array", | ||
| 1910 | "items": { | ||
| 1911 | "$ref": "#/definitions/handlers.TimelinePoint" | ||
| 1912 | } | ||
| 1913 | }, | ||
| 1914 | "timeline_singleplayer": { | ||
| 1915 | "type": "array", | ||
| 1916 | "items": { | ||
| 1917 | "$ref": "#/definitions/handlers.TimelinePoint" | ||
| 1918 | } | ||
| 1919 | } | ||
| 1920 | } | ||
| 1921 | }, | ||
| 1863 | "models.Category": { | 1922 | "models.Category": { |
| 1864 | "type": "object", | 1923 | "type": "object", |
| 1865 | "properties": { | 1924 | "properties": { |
| @@ -1945,6 +2004,9 @@ const docTemplate = `{ | |||
| 1945 | "chapter_name": { | 2004 | "chapter_name": { |
| 1946 | "type": "string" | 2005 | "type": "string" |
| 1947 | }, | 2006 | }, |
| 2007 | "difficulty": { | ||
| 2008 | "type": "integer" | ||
| 2009 | }, | ||
| 1948 | "game_name": { | 2010 | "game_name": { |
| 1949 | "type": "string" | 2011 | "type": "string" |
| 1950 | }, | 2012 | }, |
diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json index 6c10cfc..981d017 100644 --- a/backend/docs/swagger.json +++ b/backend/docs/swagger.json | |||
| @@ -244,37 +244,6 @@ | |||
| 244 | } | 244 | } |
| 245 | } | 245 | } |
| 246 | }, | 246 | }, |
| 247 | "/logs/score": { | ||
| 248 | "get": { | ||
| 249 | "description": "Get score logs of every player.", | ||
| 250 | "produces": [ | ||
| 251 | "application/json" | ||
| 252 | ], | ||
| 253 | "tags": [ | ||
| 254 | "logs" | ||
| 255 | ], | ||
| 256 | "responses": { | ||
| 257 | "200": { | ||
| 258 | "description": "OK", | ||
| 259 | "schema": { | ||
| 260 | "allOf": [ | ||
| 261 | { | ||
| 262 | "$ref": "#/definitions/models.Response" | ||
| 263 | }, | ||
| 264 | { | ||
| 265 | "type": "object", | ||
| 266 | "properties": { | ||
| 267 | "data": { | ||
| 268 | "$ref": "#/definitions/handlers.ScoreLogsResponse" | ||
| 269 | } | ||
| 270 | } | ||
| 271 | } | ||
| 272 | ] | ||
| 273 | } | ||
| 274 | } | ||
| 275 | } | ||
| 276 | } | ||
| 277 | }, | ||
| 278 | "/maps/{mapid}/discussions": { | 247 | "/maps/{mapid}/discussions": { |
| 279 | "get": { | 248 | "get": { |
| 280 | "description": "Get map discussions with specified map id.", | 249 | "description": "Get map discussions with specified map id.", |
| @@ -1214,6 +1183,68 @@ | |||
| 1214 | } | 1183 | } |
| 1215 | } | 1184 | } |
| 1216 | }, | 1185 | }, |
| 1186 | "/stats/scores": { | ||
| 1187 | "get": { | ||
| 1188 | "description": "Get score logs of every player.", | ||
| 1189 | "produces": [ | ||
| 1190 | "application/json" | ||
| 1191 | ], | ||
| 1192 | "tags": [ | ||
| 1193 | "stats" | ||
| 1194 | ], | ||
| 1195 | "responses": { | ||
| 1196 | "200": { | ||
| 1197 | "description": "OK", | ||
| 1198 | "schema": { | ||
| 1199 | "allOf": [ | ||
| 1200 | { | ||
| 1201 | "$ref": "#/definitions/models.Response" | ||
| 1202 | }, | ||
| 1203 | { | ||
| 1204 | "type": "object", | ||
| 1205 | "properties": { | ||
| 1206 | "data": { | ||
| 1207 | "$ref": "#/definitions/handlers.ScoresResponse" | ||
| 1208 | } | ||
| 1209 | } | ||
| 1210 | } | ||
| 1211 | ] | ||
| 1212 | } | ||
| 1213 | } | ||
| 1214 | } | ||
| 1215 | } | ||
| 1216 | }, | ||
| 1217 | "/stats/timeline": { | ||
| 1218 | "get": { | ||
| 1219 | "description": "Get the history of portal count world records over time.", | ||
| 1220 | "produces": [ | ||
| 1221 | "application/json" | ||
| 1222 | ], | ||
| 1223 | "tags": [ | ||
| 1224 | "stats" | ||
| 1225 | ], | ||
| 1226 | "responses": { | ||
| 1227 | "200": { | ||
| 1228 | "description": "OK", | ||
| 1229 | "schema": { | ||
| 1230 | "allOf": [ | ||
| 1231 | { | ||
| 1232 | "$ref": "#/definitions/models.Response" | ||
| 1233 | }, | ||
| 1234 | { | ||
| 1235 | "type": "object", | ||
| 1236 | "properties": { | ||
| 1237 | "data": { | ||
| 1238 | "$ref": "#/definitions/handlers.TimelineResponse" | ||
| 1239 | } | ||
| 1240 | } | ||
| 1241 | } | ||
| 1242 | ] | ||
| 1243 | } | ||
| 1244 | } | ||
| 1245 | } | ||
| 1246 | } | ||
| 1247 | }, | ||
| 1217 | "/token": { | 1248 | "/token": { |
| 1218 | "get": { | 1249 | "get": { |
| 1219 | "description": "Gets the token cookie value from the user.", | 1250 | "description": "Gets the token cookie value from the user.", |
| @@ -1768,18 +1799,7 @@ | |||
| 1768 | } | 1799 | } |
| 1769 | } | 1800 | } |
| 1770 | }, | 1801 | }, |
| 1771 | "handlers.ScoreLogsResponse": { | 1802 | "handlers.ScoresDetails": { |
| 1772 | "type": "object", | ||
| 1773 | "properties": { | ||
| 1774 | "scores": { | ||
| 1775 | "type": "array", | ||
| 1776 | "items": { | ||
| 1777 | "$ref": "#/definitions/handlers.ScoreLogsResponseDetails" | ||
| 1778 | } | ||
| 1779 | } | ||
| 1780 | } | ||
| 1781 | }, | ||
| 1782 | "handlers.ScoreLogsResponseDetails": { | ||
| 1783 | "type": "object", | 1803 | "type": "object", |
| 1784 | "properties": { | 1804 | "properties": { |
| 1785 | "date": { | 1805 | "date": { |
| @@ -1805,6 +1825,17 @@ | |||
| 1805 | } | 1825 | } |
| 1806 | } | 1826 | } |
| 1807 | }, | 1827 | }, |
| 1828 | "handlers.ScoresResponse": { | ||
| 1829 | "type": "object", | ||
| 1830 | "properties": { | ||
| 1831 | "scores": { | ||
| 1832 | "type": "array", | ||
| 1833 | "items": { | ||
| 1834 | "$ref": "#/definitions/handlers.ScoresDetails" | ||
| 1835 | } | ||
| 1836 | } | ||
| 1837 | } | ||
| 1838 | }, | ||
| 1808 | "handlers.SearchResponse": { | 1839 | "handlers.SearchResponse": { |
| 1809 | "type": "object", | 1840 | "type": "object", |
| 1810 | "properties": { | 1841 | "properties": { |
| @@ -1854,6 +1885,34 @@ | |||
| 1854 | } | 1885 | } |
| 1855 | } | 1886 | } |
| 1856 | }, | 1887 | }, |
| 1888 | "handlers.TimelinePoint": { | ||
| 1889 | "type": "object", | ||
| 1890 | "properties": { | ||
| 1891 | "count": { | ||
| 1892 | "type": "integer" | ||
| 1893 | }, | ||
| 1894 | "date": { | ||
| 1895 | "type": "string" | ||
| 1896 | } | ||
| 1897 | } | ||
| 1898 | }, | ||
| 1899 | "handlers.TimelineResponse": { | ||
| 1900 | "type": "object", | ||
| 1901 | "properties": { | ||
| 1902 | "timeline_multiplayer": { | ||
| 1903 | "type": "array", | ||
| 1904 | "items": { | ||
| 1905 | "$ref": "#/definitions/handlers.TimelinePoint" | ||
| 1906 | } | ||
| 1907 | }, | ||
| 1908 | "timeline_singleplayer": { | ||
| 1909 | "type": "array", | ||
| 1910 | "items": { | ||
| 1911 | "$ref": "#/definitions/handlers.TimelinePoint" | ||
| 1912 | } | ||
| 1913 | } | ||
| 1914 | } | ||
| 1915 | }, | ||
| 1857 | "models.Category": { | 1916 | "models.Category": { |
| 1858 | "type": "object", | 1917 | "type": "object", |
| 1859 | "properties": { | 1918 | "properties": { |
| @@ -1939,6 +1998,9 @@ | |||
| 1939 | "chapter_name": { | 1998 | "chapter_name": { |
| 1940 | "type": "string" | 1999 | "type": "string" |
| 1941 | }, | 2000 | }, |
| 2001 | "difficulty": { | ||
| 2002 | "type": "integer" | ||
| 2003 | }, | ||
| 1942 | "game_name": { | 2004 | "game_name": { |
| 1943 | "type": "string" | 2005 | "type": "string" |
| 1944 | }, | 2006 | }, |
diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml index 8f33b94..0b3258c 100644 --- a/backend/docs/swagger.yaml +++ b/backend/docs/swagger.yaml | |||
| @@ -287,14 +287,7 @@ definitions: | |||
| 287 | score_time: | 287 | score_time: |
| 288 | type: integer | 288 | type: integer |
| 289 | type: object | 289 | type: object |
| 290 | handlers.ScoreLogsResponse: | 290 | handlers.ScoresDetails: |
| 291 | properties: | ||
| 292 | scores: | ||
| 293 | items: | ||
| 294 | $ref: '#/definitions/handlers.ScoreLogsResponseDetails' | ||
| 295 | type: array | ||
| 296 | type: object | ||
| 297 | handlers.ScoreLogsResponseDetails: | ||
| 298 | properties: | 291 | properties: |
| 299 | date: | 292 | date: |
| 300 | type: string | 293 | type: string |
| @@ -311,6 +304,13 @@ definitions: | |||
| 311 | user: | 304 | user: |
| 312 | $ref: '#/definitions/models.UserShort' | 305 | $ref: '#/definitions/models.UserShort' |
| 313 | type: object | 306 | type: object |
| 307 | handlers.ScoresResponse: | ||
| 308 | properties: | ||
| 309 | scores: | ||
| 310 | items: | ||
| 311 | $ref: '#/definitions/handlers.ScoresDetails' | ||
| 312 | type: array | ||
| 313 | type: object | ||
| 314 | handlers.SearchResponse: | 314 | handlers.SearchResponse: |
| 315 | properties: | 315 | properties: |
| 316 | maps: | 316 | maps: |
| @@ -343,6 +343,24 @@ definitions: | |||
| 343 | user_name: | 343 | user_name: |
| 344 | type: string | 344 | type: string |
| 345 | type: object | 345 | type: object |
| 346 | handlers.TimelinePoint: | ||
| 347 | properties: | ||
| 348 | count: | ||
| 349 | type: integer | ||
| 350 | date: | ||
| 351 | type: string | ||
| 352 | type: object | ||
| 353 | handlers.TimelineResponse: | ||
| 354 | properties: | ||
| 355 | timeline_multiplayer: | ||
| 356 | items: | ||
| 357 | $ref: '#/definitions/handlers.TimelinePoint' | ||
| 358 | type: array | ||
| 359 | timeline_singleplayer: | ||
| 360 | items: | ||
| 361 | $ref: '#/definitions/handlers.TimelinePoint' | ||
| 362 | type: array | ||
| 363 | type: object | ||
| 346 | models.Category: | 364 | models.Category: |
| 347 | properties: | 365 | properties: |
| 348 | id: | 366 | id: |
| @@ -398,6 +416,8 @@ definitions: | |||
| 398 | properties: | 416 | properties: |
| 399 | chapter_name: | 417 | chapter_name: |
| 400 | type: string | 418 | type: string |
| 419 | difficulty: | ||
| 420 | type: integer | ||
| 401 | game_name: | 421 | game_name: |
| 402 | type: string | 422 | type: string |
| 403 | id: | 423 | id: |
| @@ -672,23 +692,6 @@ paths: | |||
| 672 | type: object | 692 | type: object |
| 673 | tags: | 693 | tags: |
| 674 | - login | 694 | - login |
| 675 | /logs/score: | ||
| 676 | get: | ||
| 677 | description: Get score logs of every player. | ||
| 678 | produces: | ||
| 679 | - application/json | ||
| 680 | responses: | ||
| 681 | "200": | ||
| 682 | description: OK | ||
| 683 | schema: | ||
| 684 | allOf: | ||
| 685 | - $ref: '#/definitions/models.Response' | ||
| 686 | - properties: | ||
| 687 | data: | ||
| 688 | $ref: '#/definitions/handlers.ScoreLogsResponse' | ||
| 689 | type: object | ||
| 690 | tags: | ||
| 691 | - logs | ||
| 692 | /maps/{mapid}/discussions: | 695 | /maps/{mapid}/discussions: |
| 693 | get: | 696 | get: |
| 694 | description: Get map discussions with specified map id. | 697 | description: Get map discussions with specified map id. |
| @@ -1259,6 +1262,40 @@ paths: | |||
| 1259 | type: object | 1262 | type: object |
| 1260 | tags: | 1263 | tags: |
| 1261 | - search | 1264 | - search |
| 1265 | /stats/scores: | ||
| 1266 | get: | ||
| 1267 | description: Get score logs of every player. | ||
| 1268 | produces: | ||
| 1269 | - application/json | ||
| 1270 | responses: | ||
| 1271 | "200": | ||
| 1272 | description: OK | ||
| 1273 | schema: | ||
| 1274 | allOf: | ||
| 1275 | - $ref: '#/definitions/models.Response' | ||
| 1276 | - properties: | ||
| 1277 | data: | ||
| 1278 | $ref: '#/definitions/handlers.ScoresResponse' | ||
| 1279 | type: object | ||
| 1280 | tags: | ||
| 1281 | - stats | ||
| 1282 | /stats/timeline: | ||
| 1283 | get: | ||
| 1284 | description: Get the history of portal count world records over time. | ||
| 1285 | produces: | ||
| 1286 | - application/json | ||
| 1287 | responses: | ||
| 1288 | "200": | ||
| 1289 | description: OK | ||
| 1290 | schema: | ||
| 1291 | allOf: | ||
| 1292 | - $ref: '#/definitions/models.Response' | ||
| 1293 | - properties: | ||
| 1294 | data: | ||
| 1295 | $ref: '#/definitions/handlers.TimelineResponse' | ||
| 1296 | type: object | ||
| 1297 | tags: | ||
| 1298 | - stats | ||
| 1262 | /token: | 1299 | /token: |
| 1263 | delete: | 1300 | delete: |
| 1264 | description: Deletes the token cookie from the user. | 1301 | description: Deletes the token cookie from the user. |