aboutsummaryrefslogtreecommitdiff
path: root/docs/docs.go
diff options
context:
space:
mode:
Diffstat (limited to 'docs/docs.go')
-rw-r--r--docs/docs.go527
1 files changed, 376 insertions, 151 deletions
diff --git a/docs/docs.go b/docs/docs.go
index 1db1bba..9712377 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -20,7 +20,7 @@ const docTemplate = `{
20 "host": "{{.Host}}", 20 "host": "{{.Host}}",
21 "basePath": "{{.BasePath}}", 21 "basePath": "{{.BasePath}}",
22 "paths": { 22 "paths": {
23 "/chapters/{id}": { 23 "/chapters/{chapterid}": {
24 "get": { 24 "get": {
25 "description": "Get maps from the specified chapter id.", 25 "description": "Get maps from the specified chapter id.",
26 "produces": [ 26 "produces": [
@@ -33,7 +33,7 @@ const docTemplate = `{
33 { 33 {
34 "type": "integer", 34 "type": "integer",
35 "description": "Chapter ID", 35 "description": "Chapter ID",
36 "name": "id", 36 "name": "chapterid",
37 "in": "path", 37 "in": "path",
38 "required": true 38 "required": true
39 } 39 }
@@ -93,12 +93,6 @@ const docTemplate = `{
93 "schema": { 93 "schema": {
94 "type": "file" 94 "type": "file"
95 } 95 }
96 },
97 "400": {
98 "description": "Bad Request",
99 "schema": {
100 "$ref": "#/definitions/models.Response"
101 }
102 } 96 }
103 } 97 }
104 } 98 }
@@ -143,7 +137,7 @@ const docTemplate = `{
143 } 137 }
144 } 138 }
145 }, 139 },
146 "/games/{id}": { 140 "/games/{gameid}": {
147 "get": { 141 "get": {
148 "description": "Get chapters from the specified game id.", 142 "description": "Get chapters from the specified game id.",
149 "produces": [ 143 "produces": [
@@ -156,7 +150,7 @@ const docTemplate = `{
156 { 150 {
157 "type": "integer", 151 "type": "integer",
158 "description": "Game ID", 152 "description": "Game ID",
159 "name": "id", 153 "name": "gameid",
160 "in": "path", 154 "in": "path",
161 "required": true 155 "required": true
162 } 156 }
@@ -179,12 +173,6 @@ const docTemplate = `{
179 } 173 }
180 ] 174 ]
181 } 175 }
182 },
183 "400": {
184 "description": "Bad Request",
185 "schema": {
186 "$ref": "#/definitions/models.Response"
187 }
188 } 176 }
189 } 177 }
190 } 178 }
@@ -219,12 +207,6 @@ const docTemplate = `{
219 } 207 }
220 ] 208 ]
221 } 209 }
222 },
223 "400": {
224 "description": "Bad Request",
225 "schema": {
226 "$ref": "#/definitions/models.Response"
227 }
228 } 210 }
229 } 211 }
230 } 212 }
@@ -265,12 +247,6 @@ const docTemplate = `{
265 } 247 }
266 ] 248 ]
267 } 249 }
268 },
269 "400": {
270 "description": "Bad Request",
271 "schema": {
272 "$ref": "#/definitions/models.Response"
273 }
274 } 250 }
275 } 251 }
276 } 252 }
@@ -302,19 +278,159 @@ const docTemplate = `{
302 } 278 }
303 ] 279 ]
304 } 280 }
281 }
282 }
283 }
284 },
285 "/maps/{mapid}/discussions": {
286 "get": {
287 "description": "Get map discussions with specified map id.",
288 "produces": [
289 "application/json"
290 ],
291 "tags": [
292 "maps"
293 ],
294 "parameters": [
295 {
296 "type": "integer",
297 "description": "Map ID",
298 "name": "mapid",
299 "in": "path",
300 "required": true
301 }
302 ],
303 "responses": {
304 "200": {
305 "description": "OK",
306 "schema": {
307 "allOf": [
308 {
309 "$ref": "#/definitions/models.Response"
310 },
311 {
312 "type": "object",
313 "properties": {
314 "data": {
315 "$ref": "#/definitions/handlers.MapDiscussionsResponse"
316 }
317 }
318 }
319 ]
320 }
321 }
322 }
323 },
324 "post": {
325 "description": "Create map discussion with specified map id.",
326 "produces": [
327 "application/json"
328 ],
329 "tags": [
330 "maps"
331 ],
332 "parameters": [
333 {
334 "type": "string",
335 "description": "JWT Token",
336 "name": "Authorization",
337 "in": "header",
338 "required": true
305 }, 339 },
306 "400": { 340 {
307 "description": "Bad Request", 341 "type": "integer",
342 "description": "Map ID",
343 "name": "mapid",
344 "in": "path",
345 "required": true
346 },
347 {
348 "type": "integer",
349 "description": "Discussion ID",
350 "name": "discussionid",
351 "in": "path",
352 "required": true
353 },
354 {
355 "description": "Body",
356 "name": "request",
357 "in": "body",
358 "required": true,
308 "schema": { 359 "schema": {
309 "$ref": "#/definitions/models.Response" 360 "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
361 }
362 }
363 ],
364 "responses": {
365 "200": {
366 "description": "OK",
367 "schema": {
368 "allOf": [
369 {
370 "$ref": "#/definitions/models.Response"
371 },
372 {
373 "type": "object",
374 "properties": {
375 "data": {
376 "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
377 }
378 }
379 }
380 ]
310 } 381 }
311 } 382 }
312 } 383 }
313 } 384 }
314 }, 385 },
315 "/maps/{id}/image": { 386 "/maps/{mapid}/discussions/{discussionid}": {
387 "get": {
388 "description": "Get map discussion with specified map and discussion id.",
389 "produces": [
390 "application/json"
391 ],
392 "tags": [
393 "maps"
394 ],
395 "parameters": [
396 {
397 "type": "integer",
398 "description": "Map ID",
399 "name": "mapid",
400 "in": "path",
401 "required": true
402 },
403 {
404 "type": "integer",
405 "description": "Discussion ID",
406 "name": "discussionid",
407 "in": "path",
408 "required": true
409 }
410 ],
411 "responses": {
412 "200": {
413 "description": "OK",
414 "schema": {
415 "allOf": [
416 {
417 "$ref": "#/definitions/models.Response"
418 },
419 {
420 "type": "object",
421 "properties": {
422 "data": {
423 "$ref": "#/definitions/handlers.MapDiscussionResponse"
424 }
425 }
426 }
427 ]
428 }
429 }
430 }
431 },
316 "put": { 432 "put": {
317 "description": "Edit map image with specified map id.", 433 "description": "Edit map discussion with specified map id.",
318 "produces": [ 434 "produces": [
319 "application/json" 435 "application/json"
320 ], 436 ],
@@ -332,7 +448,14 @@ const docTemplate = `{
332 { 448 {
333 "type": "integer", 449 "type": "integer",
334 "description": "Map ID", 450 "description": "Map ID",
335 "name": "id", 451 "name": "mapid",
452 "in": "path",
453 "required": true
454 },
455 {
456 "type": "integer",
457 "description": "Discussion ID",
458 "name": "discussionid",
336 "in": "path", 459 "in": "path",
337 "required": true 460 "required": true
338 }, 461 },
@@ -342,7 +465,7 @@ const docTemplate = `{
342 "in": "body", 465 "in": "body",
343 "required": true, 466 "required": true,
344 "schema": { 467 "schema": {
345 "$ref": "#/definitions/handlers.EditMapImageRequest" 468 "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
346 } 469 }
347 } 470 }
348 ], 471 ],
@@ -358,15 +481,49 @@ const docTemplate = `{
358 "type": "object", 481 "type": "object",
359 "properties": { 482 "properties": {
360 "data": { 483 "data": {
361 "$ref": "#/definitions/handlers.EditMapImageRequest" 484 "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
362 } 485 }
363 } 486 }
364 } 487 }
365 ] 488 ]
366 } 489 }
490 }
491 }
492 },
493 "delete": {
494 "description": "Delete map summary with specified map id.",
495 "produces": [
496 "application/json"
497 ],
498 "tags": [
499 "maps"
500 ],
501 "parameters": [
502 {
503 "type": "string",
504 "description": "JWT Token",
505 "name": "Authorization",
506 "in": "header",
507 "required": true
367 }, 508 },
368 "400": { 509 {
369 "description": "Bad Request", 510 "type": "integer",
511 "description": "Map ID",
512 "name": "mapid",
513 "in": "path",
514 "required": true
515 },
516 {
517 "type": "integer",
518 "description": "Discussion ID",
519 "name": "discussionid",
520 "in": "path",
521 "required": true
522 }
523 ],
524 "responses": {
525 "200": {
526 "description": "OK",
370 "schema": { 527 "schema": {
371 "$ref": "#/definitions/models.Response" 528 "$ref": "#/definitions/models.Response"
372 } 529 }
@@ -374,7 +531,63 @@ const docTemplate = `{
374 } 531 }
375 } 532 }
376 }, 533 },
377 "/maps/{id}/leaderboards": { 534 "/maps/{mapid}/image": {
535 "put": {
536 "description": "Edit map image with specified map id.",
537 "produces": [
538 "application/json"
539 ],
540 "tags": [
541 "maps"
542 ],
543 "parameters": [
544 {
545 "type": "string",
546 "description": "JWT Token",
547 "name": "Authorization",
548 "in": "header",
549 "required": true
550 },
551 {
552 "type": "integer",
553 "description": "Map ID",
554 "name": "mapid",
555 "in": "path",
556 "required": true
557 },
558 {
559 "description": "Body",
560 "name": "request",
561 "in": "body",
562 "required": true,
563 "schema": {
564 "$ref": "#/definitions/handlers.EditMapImageRequest"
565 }
566 }
567 ],
568 "responses": {
569 "200": {
570 "description": "OK",
571 "schema": {
572 "allOf": [
573 {
574 "$ref": "#/definitions/models.Response"
575 },
576 {
577 "type": "object",
578 "properties": {
579 "data": {
580 "$ref": "#/definitions/handlers.EditMapImageRequest"
581 }
582 }
583 }
584 ]
585 }
586 }
587 }
588 }
589 },
590 "/maps/{mapid}/leaderboards": {
378 "get": { 591 "get": {
379 "description": "Get map leaderboards with specified id.", 592 "description": "Get map leaderboards with specified id.",
380 "produces": [ 593 "produces": [
@@ -387,7 +600,7 @@ const docTemplate = `{
387 { 600 {
388 "type": "integer", 601 "type": "integer",
389 "description": "Map ID", 602 "description": "Map ID",
390 "name": "id", 603 "name": "mapid",
391 "in": "path", 604 "in": "path",
392 "required": true 605 "required": true
393 }, 606 },
@@ -422,17 +635,11 @@ const docTemplate = `{
422 } 635 }
423 ] 636 ]
424 } 637 }
425 },
426 "400": {
427 "description": "Bad Request",
428 "schema": {
429 "$ref": "#/definitions/models.Response"
430 }
431 } 638 }
432 } 639 }
433 } 640 }
434 }, 641 },
435 "/maps/{id}/record": { 642 "/maps/{mapid}/record": {
436 "post": { 643 "post": {
437 "description": "Post record with demo of a specific map.", 644 "description": "Post record with demo of a specific map.",
438 "consumes": [ 645 "consumes": [
@@ -448,7 +655,7 @@ const docTemplate = `{
448 { 655 {
449 "type": "integer", 656 "type": "integer",
450 "description": "Map ID", 657 "description": "Map ID",
451 "name": "id", 658 "name": "mapid",
452 "in": "path", 659 "in": "path",
453 "required": true 660 "required": true
454 }, 661 },
@@ -503,23 +710,11 @@ const docTemplate = `{
503 } 710 }
504 ] 711 ]
505 } 712 }
506 },
507 "400": {
508 "description": "Bad Request",
509 "schema": {
510 "$ref": "#/definitions/models.Response"
511 }
512 },
513 "401": {
514 "description": "Unauthorized",
515 "schema": {
516 "$ref": "#/definitions/models.Response"
517 }
518 } 713 }
519 } 714 }
520 } 715 }
521 }, 716 },
522 "/maps/{id}/summary": { 717 "/maps/{mapid}/summary": {
523 "get": { 718 "get": {
524 "description": "Get map summary with specified id.", 719 "description": "Get map summary with specified id.",
525 "produces": [ 720 "produces": [
@@ -532,7 +727,7 @@ const docTemplate = `{
532 { 727 {
533 "type": "integer", 728 "type": "integer",
534 "description": "Map ID", 729 "description": "Map ID",
535 "name": "id", 730 "name": "mapid",
536 "in": "path", 731 "in": "path",
537 "required": true 732 "required": true
538 } 733 }
@@ -555,12 +750,6 @@ const docTemplate = `{
555 } 750 }
556 ] 751 ]
557 } 752 }
558 },
559 "400": {
560 "description": "Bad Request",
561 "schema": {
562 "$ref": "#/definitions/models.Response"
563 }
564 } 753 }
565 } 754 }
566 }, 755 },
@@ -583,7 +772,7 @@ const docTemplate = `{
583 { 772 {
584 "type": "integer", 773 "type": "integer",
585 "description": "Map ID", 774 "description": "Map ID",
586 "name": "id", 775 "name": "mapid",
587 "in": "path", 776 "in": "path",
588 "required": true 777 "required": true
589 }, 778 },
@@ -615,12 +804,6 @@ const docTemplate = `{
615 } 804 }
616 ] 805 ]
617 } 806 }
618 },
619 "400": {
620 "description": "Bad Request",
621 "schema": {
622 "$ref": "#/definitions/models.Response"
623 }
624 } 807 }
625 } 808 }
626 }, 809 },
@@ -643,7 +826,7 @@ const docTemplate = `{
643 { 826 {
644 "type": "integer", 827 "type": "integer",
645 "description": "Map ID", 828 "description": "Map ID",
646 "name": "id", 829 "name": "mapid",
647 "in": "path", 830 "in": "path",
648 "required": true 831 "required": true
649 }, 832 },
@@ -675,12 +858,6 @@ const docTemplate = `{
675 } 858 }
676 ] 859 ]
677 } 860 }
678 },
679 "400": {
680 "description": "Bad Request",
681 "schema": {
682 "$ref": "#/definitions/models.Response"
683 }
684 } 861 }
685 } 862 }
686 }, 863 },
@@ -703,7 +880,7 @@ const docTemplate = `{
703 { 880 {
704 "type": "integer", 881 "type": "integer",
705 "description": "Map ID", 882 "description": "Map ID",
706 "name": "id", 883 "name": "mapid",
707 "in": "path", 884 "in": "path",
708 "required": true 885 "required": true
709 }, 886 },
@@ -735,12 +912,6 @@ const docTemplate = `{
735 } 912 }
736 ] 913 ]
737 } 914 }
738 },
739 "400": {
740 "description": "Bad Request",
741 "schema": {
742 "$ref": "#/definitions/models.Response"
743 }
744 } 915 }
745 } 916 }
746 } 917 }
@@ -784,18 +955,6 @@ const docTemplate = `{
784 } 955 }
785 ] 956 ]
786 } 957 }
787 },
788 "400": {
789 "description": "Bad Request",
790 "schema": {
791 "$ref": "#/definitions/models.Response"
792 }
793 },
794 "401": {
795 "description": "Unauthorized",
796 "schema": {
797 "$ref": "#/definitions/models.Response"
798 }
799 } 958 }
800 } 959 }
801 }, 960 },
@@ -832,18 +991,6 @@ const docTemplate = `{
832 "schema": { 991 "schema": {
833 "$ref": "#/definitions/models.Response" 992 "$ref": "#/definitions/models.Response"
834 } 993 }
835 },
836 "400": {
837 "description": "Bad Request",
838 "schema": {
839 "$ref": "#/definitions/models.Response"
840 }
841 },
842 "401": {
843 "description": "Unauthorized",
844 "schema": {
845 "$ref": "#/definitions/models.Response"
846 }
847 } 994 }
848 } 995 }
849 }, 996 },
@@ -885,18 +1032,6 @@ const docTemplate = `{
885 } 1032 }
886 ] 1033 ]
887 } 1034 }
888 },
889 "400": {
890 "description": "Bad Request",
891 "schema": {
892 "$ref": "#/definitions/models.Response"
893 }
894 },
895 "401": {
896 "description": "Unauthorized",
897 "schema": {
898 "$ref": "#/definitions/models.Response"
899 }
900 } 1035 }
901 } 1036 }
902 } 1037 }
@@ -928,12 +1063,6 @@ const docTemplate = `{
928 } 1063 }
929 ] 1064 ]
930 } 1065 }
931 },
932 "400": {
933 "description": "Bad Request",
934 "schema": {
935 "$ref": "#/definitions/models.Response"
936 }
937 } 1066 }
938 } 1067 }
939 } 1068 }
@@ -973,12 +1102,6 @@ const docTemplate = `{
973 } 1102 }
974 ] 1103 ]
975 } 1104 }
976 },
977 "400": {
978 "description": "Bad Request",
979 "schema": {
980 "$ref": "#/definitions/models.Response"
981 }
982 } 1105 }
983 } 1106 }
984 } 1107 }
@@ -1055,7 +1178,7 @@ const docTemplate = `{
1055 } 1178 }
1056 } 1179 }
1057 }, 1180 },
1058 "/users/{id}": { 1181 "/users/{userid}": {
1059 "get": { 1182 "get": {
1060 "description": "Get profile page of another user.", 1183 "description": "Get profile page of another user.",
1061 "consumes": [ 1184 "consumes": [
@@ -1071,7 +1194,7 @@ const docTemplate = `{
1071 { 1194 {
1072 "type": "integer", 1195 "type": "integer",
1073 "description": "User ID", 1196 "description": "User ID",
1074 "name": "id", 1197 "name": "userid",
1075 "in": "path", 1198 "in": "path",
1076 "required": true 1199 "required": true
1077 } 1200 }
@@ -1094,18 +1217,6 @@ const docTemplate = `{
1094 } 1217 }
1095 ] 1218 ]
1096 } 1219 }
1097 },
1098 "400": {
1099 "description": "Bad Request",
1100 "schema": {
1101 "$ref": "#/definitions/models.Response"
1102 }
1103 },
1104 "404": {
1105 "description": "Not Found",
1106 "schema": {
1107 "$ref": "#/definitions/models.Response"
1108 }
1109 } 1220 }
1110 } 1221 }
1111 } 1222 }
@@ -1140,6 +1251,21 @@ const docTemplate = `{
1140 } 1251 }
1141 } 1252 }
1142 }, 1253 },
1254 "handlers.CreateMapDiscussionRequest": {
1255 "type": "object",
1256 "required": [
1257 "content",
1258 "title"
1259 ],
1260 "properties": {
1261 "content": {
1262 "type": "string"
1263 },
1264 "title": {
1265 "type": "string"
1266 }
1267 }
1268 },
1143 "handlers.CreateMapSummaryRequest": { 1269 "handlers.CreateMapSummaryRequest": {
1144 "type": "object", 1270 "type": "object",
1145 "required": [ 1271 "required": [
@@ -1181,6 +1307,21 @@ const docTemplate = `{
1181 } 1307 }
1182 } 1308 }
1183 }, 1309 },
1310 "handlers.EditMapDiscussionRequest": {
1311 "type": "object",
1312 "required": [
1313 "content",
1314 "title"
1315 ],
1316 "properties": {
1317 "content": {
1318 "type": "string"
1319 },
1320 "title": {
1321 "type": "string"
1322 }
1323 }
1324 },
1184 "handlers.EditMapImageRequest": { 1325 "handlers.EditMapImageRequest": {
1185 "type": "object", 1326 "type": "object",
1186 "required": [ 1327 "required": [
@@ -1255,6 +1396,90 @@ const docTemplate = `{
1255 } 1396 }
1256 } 1397 }
1257 }, 1398 },
1399 "handlers.MapDiscussion": {
1400 "type": "object",
1401 "properties": {
1402 "comments": {
1403 "type": "array",
1404 "items": {
1405 "$ref": "#/definitions/handlers.MapDiscussionComment"
1406 }
1407 },
1408 "content": {
1409 "type": "string"
1410 },
1411 "creator": {
1412 "$ref": "#/definitions/models.UserShortWithAvatar"
1413 },
1414 "id": {
1415 "type": "integer"
1416 },
1417 "title": {
1418 "type": "string"
1419 },
1420 "updated_at": {
1421 "description": "Upvotes int ` + "`" + `json:\"upvotes\"` + "`" + `",
1422 "type": "string"
1423 }
1424 }
1425 },
1426 "handlers.MapDiscussionComment": {
1427 "type": "object",
1428 "properties": {
1429 "comment": {
1430 "type": "string"
1431 },
1432 "date": {
1433 "type": "string"
1434 },
1435 "user": {
1436 "$ref": "#/definitions/models.UserShortWithAvatar"
1437 }
1438 }
1439 },
1440 "handlers.MapDiscussionOnlyTitle": {
1441 "type": "object",
1442 "properties": {
1443 "comments": {
1444 "type": "array",
1445 "items": {
1446 "$ref": "#/definitions/handlers.MapDiscussionComment"
1447 }
1448 },
1449 "creator": {
1450 "$ref": "#/definitions/models.UserShortWithAvatar"
1451 },
1452 "id": {
1453 "type": "integer"
1454 },
1455 "title": {
1456 "type": "string"
1457 },
1458 "updated_at": {
1459 "description": "Upvotes int ` + "`" + `json:\"upvotes\"` + "`" + `",
1460 "type": "string"
1461 }
1462 }
1463 },
1464 "handlers.MapDiscussionResponse": {
1465 "type": "object",
1466 "properties": {
1467 "discussion": {
1468 "$ref": "#/definitions/handlers.MapDiscussion"
1469 }
1470 }
1471 },
1472 "handlers.MapDiscussionsResponse": {
1473 "type": "object",
1474 "properties": {
1475 "discussions": {
1476 "type": "array",
1477 "items": {
1478 "$ref": "#/definitions/handlers.MapDiscussionOnlyTitle"
1479 }
1480 }
1481 }
1482 },
1258 "handlers.MapLeaderboardsResponse": { 1483 "handlers.MapLeaderboardsResponse": {
1259 "type": "object", 1484 "type": "object",
1260 "properties": { 1485 "properties": {