aboutsummaryrefslogtreecommitdiff
path: root/backend/docs/docs.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/docs/docs.go')
-rw-r--r--backend/docs/docs.go2160
1 files changed, 2160 insertions, 0 deletions
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 @@
1// Package docs Code generated by swaggo/swag. DO NOT EDIT
2package docs
3
4import "github.com/swaggo/swag"
5
6const docTemplate = `{
7 "schemes": {{ marshal .Schemes }},
8 "swagger": "2.0",
9 "info": {
10 "description": "{{escape .Description}}",
11 "title": "{{.Title}}",
12 "contact": {},
13 "license": {
14 "name": "GNU Affero General Public License, Version 3",
15 "url": "https://www.gnu.org/licenses/agpl-3.0.html"
16 },
17 "version": "{{.Version}}"
18 },
19 "host": "{{.Host}}",
20 "basePath": "{{.BasePath}}",
21 "paths": {
22 "/chapters/{chapterid}": {
23 "get": {
24 "description": "Get maps from the specified chapter id.",
25 "produces": [
26 "application/json"
27 ],
28 "tags": [
29 "games \u0026 chapters"
30 ],
31 "parameters": [
32 {
33 "type": "integer",
34 "description": "Chapter ID",
35 "name": "chapterid",
36 "in": "path",
37 "required": true
38 }
39 ],
40 "responses": {
41 "200": {
42 "description": "OK",
43 "schema": {
44 "allOf": [
45 {
46 "$ref": "#/definitions/models.Response"
47 },
48 {
49 "type": "object",
50 "properties": {
51 "data": {
52 "$ref": "#/definitions/handlers.ChapterMapsResponse"
53 }
54 }
55 }
56 ]
57 }
58 },
59 "400": {
60 "description": "Bad Request",
61 "schema": {
62 "$ref": "#/definitions/models.Response"
63 }
64 }
65 }
66 }
67 },
68 "/demos": {
69 "get": {
70 "description": "Get demo with specified demo uuid.",
71 "consumes": [
72 "application/json"
73 ],
74 "produces": [
75 "application/octet-stream"
76 ],
77 "tags": [
78 "demo"
79 ],
80 "parameters": [
81 {
82 "type": "string",
83 "description": "Demo UUID",
84 "name": "uuid",
85 "in": "query",
86 "required": true
87 }
88 ],
89 "responses": {
90 "200": {
91 "description": "Demo File",
92 "schema": {
93 "type": "file"
94 }
95 }
96 }
97 }
98 },
99 "/games": {
100 "get": {
101 "description": "Get games from the leaderboards.",
102 "produces": [
103 "application/json"
104 ],
105 "tags": [
106 "games \u0026 chapters"
107 ],
108 "responses": {
109 "200": {
110 "description": "OK",
111 "schema": {
112 "allOf": [
113 {
114 "$ref": "#/definitions/models.Response"
115 },
116 {
117 "type": "object",
118 "properties": {
119 "data": {
120 "type": "array",
121 "items": {
122 "$ref": "#/definitions/models.Game"
123 }
124 }
125 }
126 }
127 ]
128 }
129 },
130 "400": {
131 "description": "Bad Request",
132 "schema": {
133 "$ref": "#/definitions/models.Response"
134 }
135 }
136 }
137 }
138 },
139 "/games/{gameid}": {
140 "get": {
141 "description": "Get chapters from the specified game id.",
142 "produces": [
143 "application/json"
144 ],
145 "tags": [
146 "games \u0026 chapters"
147 ],
148 "parameters": [
149 {
150 "type": "integer",
151 "description": "Game ID",
152 "name": "gameid",
153 "in": "path",
154 "required": true
155 }
156 ],
157 "responses": {
158 "200": {
159 "description": "OK",
160 "schema": {
161 "allOf": [
162 {
163 "$ref": "#/definitions/models.Response"
164 },
165 {
166 "type": "object",
167 "properties": {
168 "data": {
169 "$ref": "#/definitions/handlers.ChaptersResponse"
170 }
171 }
172 }
173 ]
174 }
175 }
176 }
177 }
178 },
179 "/games/{gameid}/maps": {
180 "get": {
181 "description": "Get maps from the specified game id.",
182 "produces": [
183 "application/json"
184 ],
185 "tags": [
186 "games \u0026 chapters"
187 ],
188 "parameters": [
189 {
190 "type": "integer",
191 "description": "Game ID",
192 "name": "gameid",
193 "in": "path",
194 "required": true
195 }
196 ],
197 "responses": {
198 "200": {
199 "description": "OK",
200 "schema": {
201 "allOf": [
202 {
203 "$ref": "#/definitions/models.Response"
204 },
205 {
206 "type": "object",
207 "properties": {
208 "data": {
209 "$ref": "#/definitions/handlers.ChaptersResponse"
210 }
211 }
212 }
213 ]
214 }
215 }
216 }
217 }
218 },
219 "/login": {
220 "get": {
221 "description": "Get (redirect) login page for Steam auth.",
222 "consumes": [
223 "application/json"
224 ],
225 "produces": [
226 "application/json"
227 ],
228 "tags": [
229 "login"
230 ],
231 "responses": {
232 "200": {
233 "description": "OK",
234 "schema": {
235 "allOf": [
236 {
237 "$ref": "#/definitions/models.Response"
238 },
239 {
240 "type": "object",
241 "properties": {
242 "data": {
243 "$ref": "#/definitions/handlers.LoginResponse"
244 }
245 }
246 }
247 ]
248 }
249 }
250 }
251 }
252 },
253 "/logs/mod": {
254 "get": {
255 "description": "Get mod logs.",
256 "produces": [
257 "application/json"
258 ],
259 "tags": [
260 "logs"
261 ],
262 "parameters": [
263 {
264 "type": "string",
265 "description": "JWT Token",
266 "name": "Authorization",
267 "in": "header",
268 "required": true
269 }
270 ],
271 "responses": {
272 "200": {
273 "description": "OK",
274 "schema": {
275 "allOf": [
276 {
277 "$ref": "#/definitions/models.Response"
278 },
279 {
280 "type": "object",
281 "properties": {
282 "data": {
283 "$ref": "#/definitions/handlers.LogsResponse"
284 }
285 }
286 }
287 ]
288 }
289 }
290 }
291 }
292 },
293 "/logs/score": {
294 "get": {
295 "description": "Get score logs of every player.",
296 "produces": [
297 "application/json"
298 ],
299 "tags": [
300 "logs"
301 ],
302 "responses": {
303 "200": {
304 "description": "OK",
305 "schema": {
306 "allOf": [
307 {
308 "$ref": "#/definitions/models.Response"
309 },
310 {
311 "type": "object",
312 "properties": {
313 "data": {
314 "$ref": "#/definitions/handlers.ScoreLogsResponse"
315 }
316 }
317 }
318 ]
319 }
320 }
321 }
322 }
323 },
324 "/maps/{mapid}/discussions": {
325 "get": {
326 "description": "Get map discussions with specified map id.",
327 "produces": [
328 "application/json"
329 ],
330 "tags": [
331 "maps / discussions"
332 ],
333 "parameters": [
334 {
335 "type": "integer",
336 "description": "Map ID",
337 "name": "mapid",
338 "in": "path",
339 "required": true
340 }
341 ],
342 "responses": {
343 "200": {
344 "description": "OK",
345 "schema": {
346 "allOf": [
347 {
348 "$ref": "#/definitions/models.Response"
349 },
350 {
351 "type": "object",
352 "properties": {
353 "data": {
354 "$ref": "#/definitions/handlers.MapDiscussionsResponse"
355 }
356 }
357 }
358 ]
359 }
360 }
361 }
362 },
363 "post": {
364 "description": "Create map discussion with specified map id.",
365 "produces": [
366 "application/json"
367 ],
368 "tags": [
369 "maps / discussions"
370 ],
371 "parameters": [
372 {
373 "type": "string",
374 "description": "JWT Token",
375 "name": "Authorization",
376 "in": "header",
377 "required": true
378 },
379 {
380 "type": "integer",
381 "description": "Map ID",
382 "name": "mapid",
383 "in": "path",
384 "required": true
385 },
386 {
387 "description": "Body",
388 "name": "request",
389 "in": "body",
390 "required": true,
391 "schema": {
392 "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
393 }
394 }
395 ],
396 "responses": {
397 "200": {
398 "description": "OK",
399 "schema": {
400 "allOf": [
401 {
402 "$ref": "#/definitions/models.Response"
403 },
404 {
405 "type": "object",
406 "properties": {
407 "data": {
408 "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
409 }
410 }
411 }
412 ]
413 }
414 }
415 }
416 }
417 },
418 "/maps/{mapid}/discussions/{discussionid}": {
419 "get": {
420 "description": "Get map discussion with specified map and discussion id.",
421 "produces": [
422 "application/json"
423 ],
424 "tags": [
425 "maps / discussions"
426 ],
427 "parameters": [
428 {
429 "type": "integer",
430 "description": "Map ID",
431 "name": "mapid",
432 "in": "path",
433 "required": true
434 },
435 {
436 "type": "integer",
437 "description": "Discussion ID",
438 "name": "discussionid",
439 "in": "path",
440 "required": true
441 }
442 ],
443 "responses": {
444 "200": {
445 "description": "OK",
446 "schema": {
447 "allOf": [
448 {
449 "$ref": "#/definitions/models.Response"
450 },
451 {
452 "type": "object",
453 "properties": {
454 "data": {
455 "$ref": "#/definitions/handlers.MapDiscussionResponse"
456 }
457 }
458 }
459 ]
460 }
461 }
462 }
463 },
464 "put": {
465 "description": "Edit map discussion with specified map id.",
466 "produces": [
467 "application/json"
468 ],
469 "tags": [
470 "maps / discussions"
471 ],
472 "parameters": [
473 {
474 "type": "string",
475 "description": "JWT Token",
476 "name": "Authorization",
477 "in": "header",
478 "required": true
479 },
480 {
481 "type": "integer",
482 "description": "Map ID",
483 "name": "mapid",
484 "in": "path",
485 "required": true
486 },
487 {
488 "type": "integer",
489 "description": "Discussion ID",
490 "name": "discussionid",
491 "in": "path",
492 "required": true
493 },
494 {
495 "description": "Body",
496 "name": "request",
497 "in": "body",
498 "required": true,
499 "schema": {
500 "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
501 }
502 }
503 ],
504 "responses": {
505 "200": {
506 "description": "OK",
507 "schema": {
508 "allOf": [
509 {
510 "$ref": "#/definitions/models.Response"
511 },
512 {
513 "type": "object",
514 "properties": {
515 "data": {
516 "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
517 }
518 }
519 }
520 ]
521 }
522 }
523 }
524 },
525 "post": {
526 "description": "Create map discussion comment with specified map id.",
527 "produces": [
528 "application/json"
529 ],
530 "tags": [
531 "maps / discussions"
532 ],
533 "parameters": [
534 {
535 "type": "string",
536 "description": "JWT Token",
537 "name": "Authorization",
538 "in": "header",
539 "required": true
540 },
541 {
542 "type": "integer",
543 "description": "Map ID",
544 "name": "mapid",
545 "in": "path",
546 "required": true
547 },
548 {
549 "type": "integer",
550 "description": "Discussion ID",
551 "name": "discussionid",
552 "in": "path",
553 "required": true
554 },
555 {
556 "description": "Body",
557 "name": "request",
558 "in": "body",
559 "required": true,
560 "schema": {
561 "$ref": "#/definitions/handlers.CreateMapDiscussionCommentRequest"
562 }
563 }
564 ],
565 "responses": {
566 "200": {
567 "description": "OK",
568 "schema": {
569 "allOf": [
570 {
571 "$ref": "#/definitions/models.Response"
572 },
573 {
574 "type": "object",
575 "properties": {
576 "data": {
577 "$ref": "#/definitions/handlers.CreateMapDiscussionCommentRequest"
578 }
579 }
580 }
581 ]
582 }
583 }
584 }
585 },
586 "delete": {
587 "description": "Delete map discussion with specified map id.",
588 "produces": [
589 "application/json"
590 ],
591 "tags": [
592 "maps / discussions"
593 ],
594 "parameters": [
595 {
596 "type": "string",
597 "description": "JWT Token",
598 "name": "Authorization",
599 "in": "header",
600 "required": true
601 },
602 {
603 "type": "integer",
604 "description": "Map ID",
605 "name": "mapid",
606 "in": "path",
607 "required": true
608 },
609 {
610 "type": "integer",
611 "description": "Discussion ID",
612 "name": "discussionid",
613 "in": "path",
614 "required": true
615 }
616 ],
617 "responses": {
618 "200": {
619 "description": "OK",
620 "schema": {
621 "$ref": "#/definitions/models.Response"
622 }
623 }
624 }
625 }
626 },
627 "/maps/{mapid}/image": {
628 "put": {
629 "description": "Edit map image with specified map id.",
630 "produces": [
631 "application/json"
632 ],
633 "tags": [
634 "maps / summary"
635 ],
636 "parameters": [
637 {
638 "type": "string",
639 "description": "JWT Token",
640 "name": "Authorization",
641 "in": "header",
642 "required": true
643 },
644 {
645 "type": "integer",
646 "description": "Map ID",
647 "name": "mapid",
648 "in": "path",
649 "required": true
650 },
651 {
652 "description": "Body",
653 "name": "request",
654 "in": "body",
655 "required": true,
656 "schema": {
657 "$ref": "#/definitions/handlers.EditMapImageRequest"
658 }
659 }
660 ],
661 "responses": {
662 "200": {
663 "description": "OK",
664 "schema": {
665 "allOf": [
666 {
667 "$ref": "#/definitions/models.Response"
668 },
669 {
670 "type": "object",
671 "properties": {
672 "data": {
673 "$ref": "#/definitions/handlers.EditMapImageRequest"
674 }
675 }
676 }
677 ]
678 }
679 }
680 }
681 }
682 },
683 "/maps/{mapid}/leaderboards": {
684 "get": {
685 "description": "Get map leaderboards with specified id.",
686 "produces": [
687 "application/json"
688 ],
689 "tags": [
690 "maps / leaderboards"
691 ],
692 "parameters": [
693 {
694 "type": "integer",
695 "description": "Map ID",
696 "name": "mapid",
697 "in": "path",
698 "required": true
699 },
700 {
701 "type": "integer",
702 "description": "Page Number (default: 1)",
703 "name": "page",
704 "in": "query"
705 },
706 {
707 "type": "integer",
708 "description": "Number of Records Per Page (default: 20)",
709 "name": "pageSize",
710 "in": "query"
711 }
712 ],
713 "responses": {
714 "200": {
715 "description": "OK",
716 "schema": {
717 "allOf": [
718 {
719 "$ref": "#/definitions/models.Response"
720 },
721 {
722 "type": "object",
723 "properties": {
724 "data": {
725 "$ref": "#/definitions/handlers.MapLeaderboardsResponse"
726 }
727 }
728 }
729 ]
730 }
731 }
732 }
733 }
734 },
735 "/maps/{mapid}/record": {
736 "post": {
737 "description": "Post record with demo of a specific map.",
738 "consumes": [
739 "multipart/form-data"
740 ],
741 "produces": [
742 "application/json"
743 ],
744 "tags": [
745 "maps / leaderboards"
746 ],
747 "parameters": [
748 {
749 "type": "integer",
750 "description": "Map ID",
751 "name": "mapid",
752 "in": "path",
753 "required": true
754 },
755 {
756 "type": "string",
757 "description": "JWT Token",
758 "name": "Authorization",
759 "in": "header",
760 "required": true
761 },
762 {
763 "type": "file",
764 "description": "Host Demo",
765 "name": "host_demo",
766 "in": "formData",
767 "required": true
768 },
769 {
770 "type": "file",
771 "description": "Partner Demo",
772 "name": "partner_demo",
773 "in": "formData"
774 },
775 {
776 "type": "boolean",
777 "description": "Is Partner Orange",
778 "name": "is_partner_orange",
779 "in": "formData"
780 },
781 {
782 "type": "string",
783 "description": "Partner ID",
784 "name": "partner_id",
785 "in": "formData"
786 }
787 ],
788 "responses": {
789 "200": {
790 "description": "OK",
791 "schema": {
792 "allOf": [
793 {
794 "$ref": "#/definitions/models.Response"
795 },
796 {
797 "type": "object",
798 "properties": {
799 "data": {
800 "$ref": "#/definitions/handlers.RecordResponse"
801 }
802 }
803 }
804 ]
805 }
806 }
807 }
808 }
809 },
810 "/maps/{mapid}/record/{recordid}": {
811 "delete": {
812 "description": "Delete record with specified map and record id.",
813 "produces": [
814 "application/json"
815 ],
816 "tags": [
817 "maps / leaderboards"
818 ],
819 "parameters": [
820 {
821 "type": "integer",
822 "description": "Map ID",
823 "name": "mapid",
824 "in": "path",
825 "required": true
826 },
827 {
828 "type": "integer",
829 "description": "Record ID",
830 "name": "recordid",
831 "in": "path",
832 "required": true
833 },
834 {
835 "type": "string",
836 "description": "JWT Token",
837 "name": "Authorization",
838 "in": "header",
839 "required": true
840 }
841 ],
842 "responses": {
843 "200": {
844 "description": "OK",
845 "schema": {
846 "$ref": "#/definitions/models.Response"
847 }
848 }
849 }
850 }
851 },
852 "/maps/{mapid}/summary": {
853 "get": {
854 "description": "Get map summary with specified id.",
855 "produces": [
856 "application/json"
857 ],
858 "tags": [
859 "maps / summary"
860 ],
861 "parameters": [
862 {
863 "type": "integer",
864 "description": "Map ID",
865 "name": "mapid",
866 "in": "path",
867 "required": true
868 }
869 ],
870 "responses": {
871 "200": {
872 "description": "OK",
873 "schema": {
874 "allOf": [
875 {
876 "$ref": "#/definitions/models.Response"
877 },
878 {
879 "type": "object",
880 "properties": {
881 "data": {
882 "$ref": "#/definitions/handlers.MapSummaryResponse"
883 }
884 }
885 }
886 ]
887 }
888 }
889 }
890 },
891 "put": {
892 "description": "Edit map summary with specified map id.",
893 "produces": [
894 "application/json"
895 ],
896 "tags": [
897 "maps / summary"
898 ],
899 "parameters": [
900 {
901 "type": "string",
902 "description": "JWT Token",
903 "name": "Authorization",
904 "in": "header",
905 "required": true
906 },
907 {
908 "type": "integer",
909 "description": "Map ID",
910 "name": "mapid",
911 "in": "path",
912 "required": true
913 },
914 {
915 "description": "Body",
916 "name": "request",
917 "in": "body",
918 "required": true,
919 "schema": {
920 "$ref": "#/definitions/handlers.EditMapSummaryRequest"
921 }
922 }
923 ],
924 "responses": {
925 "200": {
926 "description": "OK",
927 "schema": {
928 "allOf": [
929 {
930 "$ref": "#/definitions/models.Response"
931 },
932 {
933 "type": "object",
934 "properties": {
935 "data": {
936 "$ref": "#/definitions/handlers.EditMapSummaryRequest"
937 }
938 }
939 }
940 ]
941 }
942 }
943 }
944 },
945 "post": {
946 "description": "Create map summary with specified map id.",
947 "produces": [
948 "application/json"
949 ],
950 "tags": [
951 "maps / summary"
952 ],
953 "parameters": [
954 {
955 "type": "string",
956 "description": "JWT Token",
957 "name": "Authorization",
958 "in": "header",
959 "required": true
960 },
961 {
962 "type": "integer",
963 "description": "Map ID",
964 "name": "mapid",
965 "in": "path",
966 "required": true
967 },
968 {
969 "description": "Body",
970 "name": "request",
971 "in": "body",
972 "required": true,
973 "schema": {
974 "$ref": "#/definitions/handlers.CreateMapSummaryRequest"
975 }
976 }
977 ],
978 "responses": {
979 "200": {
980 "description": "OK",
981 "schema": {
982 "allOf": [
983 {
984 "$ref": "#/definitions/models.Response"
985 },
986 {
987 "type": "object",
988 "properties": {
989 "data": {
990 "$ref": "#/definitions/handlers.CreateMapSummaryRequest"
991 }
992 }
993 }
994 ]
995 }
996 }
997 }
998 },
999 "delete": {
1000 "description": "Delete map summary with specified map id.",
1001 "produces": [
1002 "application/json"
1003 ],
1004 "tags": [
1005 "maps / summary"
1006 ],
1007 "parameters": [
1008 {
1009 "type": "string",
1010 "description": "JWT Token",
1011 "name": "Authorization",
1012 "in": "header",
1013 "required": true
1014 },
1015 {
1016 "type": "integer",
1017 "description": "Map ID",
1018 "name": "mapid",
1019 "in": "path",
1020 "required": true
1021 },
1022 {
1023 "description": "Body",
1024 "name": "request",
1025 "in": "body",
1026 "required": true,
1027 "schema": {
1028 "$ref": "#/definitions/handlers.DeleteMapSummaryRequest"
1029 }
1030 }
1031 ],
1032 "responses": {
1033 "200": {
1034 "description": "OK",
1035 "schema": {
1036 "allOf": [
1037 {
1038 "$ref": "#/definitions/models.Response"
1039 },
1040 {
1041 "type": "object",
1042 "properties": {
1043 "data": {
1044 "$ref": "#/definitions/handlers.DeleteMapSummaryRequest"
1045 }
1046 }
1047 }
1048 ]
1049 }
1050 }
1051 }
1052 }
1053 },
1054 "/profile": {
1055 "get": {
1056 "description": "Get profile page of session user.",
1057 "consumes": [
1058 "application/json"
1059 ],
1060 "produces": [
1061 "application/json"
1062 ],
1063 "tags": [
1064 "users"
1065 ],
1066 "parameters": [
1067 {
1068 "type": "string",
1069 "description": "JWT Token",
1070 "name": "Authorization",
1071 "in": "header",
1072 "required": true
1073 }
1074 ],
1075 "responses": {
1076 "200": {
1077 "description": "OK",
1078 "schema": {
1079 "allOf": [
1080 {
1081 "$ref": "#/definitions/models.Response"
1082 },
1083 {
1084 "type": "object",
1085 "properties": {
1086 "data": {
1087 "$ref": "#/definitions/handlers.ProfileResponse"
1088 }
1089 }
1090 }
1091 ]
1092 }
1093 }
1094 }
1095 },
1096 "put": {
1097 "description": "Update country code of session user.",
1098 "consumes": [
1099 "application/json"
1100 ],
1101 "produces": [
1102 "application/json"
1103 ],
1104 "tags": [
1105 "users"
1106 ],
1107 "parameters": [
1108 {
1109 "type": "string",
1110 "description": "JWT Token",
1111 "name": "Authorization",
1112 "in": "header",
1113 "required": true
1114 },
1115 {
1116 "type": "string",
1117 "description": "Country Code [XX]",
1118 "name": "country_code",
1119 "in": "query",
1120 "required": true
1121 }
1122 ],
1123 "responses": {
1124 "200": {
1125 "description": "OK",
1126 "schema": {
1127 "$ref": "#/definitions/models.Response"
1128 }
1129 }
1130 }
1131 },
1132 "post": {
1133 "description": "Update profile page of session user.",
1134 "consumes": [
1135 "application/json"
1136 ],
1137 "produces": [
1138 "application/json"
1139 ],
1140 "tags": [
1141 "users"
1142 ],
1143 "parameters": [
1144 {
1145 "type": "string",
1146 "description": "JWT Token",
1147 "name": "Authorization",
1148 "in": "header",
1149 "required": true
1150 }
1151 ],
1152 "responses": {
1153 "200": {
1154 "description": "OK",
1155 "schema": {
1156 "allOf": [
1157 {
1158 "$ref": "#/definitions/models.Response"
1159 },
1160 {
1161 "type": "object",
1162 "properties": {
1163 "data": {
1164 "$ref": "#/definitions/handlers.ProfileResponse"
1165 }
1166 }
1167 }
1168 ]
1169 }
1170 }
1171 }
1172 }
1173 },
1174 "/rankings": {
1175 "get": {
1176 "description": "Get rankings of every player.",
1177 "produces": [
1178 "application/json"
1179 ],
1180 "tags": [
1181 "rankings"
1182 ],
1183 "responses": {
1184 "200": {
1185 "description": "OK",
1186 "schema": {
1187 "allOf": [
1188 {
1189 "$ref": "#/definitions/models.Response"
1190 },
1191 {
1192 "type": "object",
1193 "properties": {
1194 "data": {
1195 "$ref": "#/definitions/handlers.RankingsResponse"
1196 }
1197 }
1198 }
1199 ]
1200 }
1201 }
1202 }
1203 }
1204 },
1205 "/search": {
1206 "get": {
1207 "description": "Get all user and map data matching to the query.",
1208 "produces": [
1209 "application/json"
1210 ],
1211 "tags": [
1212 "search"
1213 ],
1214 "parameters": [
1215 {
1216 "type": "string",
1217 "description": "Search user or map name.",
1218 "name": "q",
1219 "in": "query"
1220 }
1221 ],
1222 "responses": {
1223 "200": {
1224 "description": "OK",
1225 "schema": {
1226 "allOf": [
1227 {
1228 "$ref": "#/definitions/models.Response"
1229 },
1230 {
1231 "type": "object",
1232 "properties": {
1233 "data": {
1234 "$ref": "#/definitions/handlers.SearchResponse"
1235 }
1236 }
1237 }
1238 ]
1239 }
1240 }
1241 }
1242 }
1243 },
1244 "/token": {
1245 "get": {
1246 "description": "Gets the token cookie value from the user.",
1247 "produces": [
1248 "application/json"
1249 ],
1250 "tags": [
1251 "auth"
1252 ],
1253 "responses": {
1254 "200": {
1255 "description": "OK",
1256 "schema": {
1257 "allOf": [
1258 {
1259 "$ref": "#/definitions/models.Response"
1260 },
1261 {
1262 "type": "object",
1263 "properties": {
1264 "data": {
1265 "$ref": "#/definitions/handlers.LoginResponse"
1266 }
1267 }
1268 }
1269 ]
1270 }
1271 },
1272 "404": {
1273 "description": "Not Found",
1274 "schema": {
1275 "$ref": "#/definitions/models.Response"
1276 }
1277 }
1278 }
1279 },
1280 "delete": {
1281 "description": "Deletes the token cookie from the user.",
1282 "produces": [
1283 "application/json"
1284 ],
1285 "tags": [
1286 "auth"
1287 ],
1288 "responses": {
1289 "200": {
1290 "description": "OK",
1291 "schema": {
1292 "allOf": [
1293 {
1294 "$ref": "#/definitions/models.Response"
1295 },
1296 {
1297 "type": "object",
1298 "properties": {
1299 "data": {
1300 "$ref": "#/definitions/handlers.LoginResponse"
1301 }
1302 }
1303 }
1304 ]
1305 }
1306 },
1307 "404": {
1308 "description": "Not Found",
1309 "schema": {
1310 "$ref": "#/definitions/models.Response"
1311 }
1312 }
1313 }
1314 }
1315 },
1316 "/users/{userid}": {
1317 "get": {
1318 "description": "Get profile page of another user.",
1319 "consumes": [
1320 "application/json"
1321 ],
1322 "produces": [
1323 "application/json"
1324 ],
1325 "tags": [
1326 "users"
1327 ],
1328 "parameters": [
1329 {
1330 "type": "integer",
1331 "description": "User ID",
1332 "name": "userid",
1333 "in": "path",
1334 "required": true
1335 }
1336 ],
1337 "responses": {
1338 "200": {
1339 "description": "OK",
1340 "schema": {
1341 "allOf": [
1342 {
1343 "$ref": "#/definitions/models.Response"
1344 },
1345 {
1346 "type": "object",
1347 "properties": {
1348 "data": {
1349 "$ref": "#/definitions/handlers.ProfileResponse"
1350 }
1351 }
1352 }
1353 ]
1354 }
1355 }
1356 }
1357 }
1358 }
1359 },
1360 "definitions": {
1361 "handlers.ChapterMapsResponse": {
1362 "type": "object",
1363 "properties": {
1364 "chapter": {
1365 "$ref": "#/definitions/models.Chapter"
1366 },
1367 "maps": {
1368 "type": "array",
1369 "items": {
1370 "$ref": "#/definitions/models.MapSelect"
1371 }
1372 }
1373 }
1374 },
1375 "handlers.ChaptersResponse": {
1376 "type": "object",
1377 "properties": {
1378 "chapters": {
1379 "type": "array",
1380 "items": {
1381 "$ref": "#/definitions/models.Chapter"
1382 }
1383 },
1384 "game": {
1385 "$ref": "#/definitions/models.Game"
1386 }
1387 }
1388 },
1389 "handlers.CreateMapDiscussionCommentRequest": {
1390 "type": "object",
1391 "required": [
1392 "comment"
1393 ],
1394 "properties": {
1395 "comment": {
1396 "type": "string"
1397 }
1398 }
1399 },
1400 "handlers.CreateMapDiscussionRequest": {
1401 "type": "object",
1402 "required": [
1403 "content",
1404 "title"
1405 ],
1406 "properties": {
1407 "content": {
1408 "type": "string"
1409 },
1410 "title": {
1411 "type": "string"
1412 }
1413 }
1414 },
1415 "handlers.CreateMapSummaryRequest": {
1416 "type": "object",
1417 "required": [
1418 "category_id",
1419 "description",
1420 "record_date",
1421 "score_count",
1422 "user_name"
1423 ],
1424 "properties": {
1425 "category_id": {
1426 "type": "integer"
1427 },
1428 "description": {
1429 "type": "string"
1430 },
1431 "record_date": {
1432 "type": "string"
1433 },
1434 "score_count": {
1435 "type": "integer"
1436 },
1437 "showcase": {
1438 "type": "string"
1439 },
1440 "user_name": {
1441 "type": "string"
1442 }
1443 }
1444 },
1445 "handlers.DeleteMapSummaryRequest": {
1446 "type": "object",
1447 "required": [
1448 "route_id"
1449 ],
1450 "properties": {
1451 "route_id": {
1452 "type": "integer"
1453 }
1454 }
1455 },
1456 "handlers.EditMapDiscussionRequest": {
1457 "type": "object",
1458 "required": [
1459 "content",
1460 "title"
1461 ],
1462 "properties": {
1463 "content": {
1464 "type": "string"
1465 },
1466 "title": {
1467 "type": "string"
1468 }
1469 }
1470 },
1471 "handlers.EditMapImageRequest": {
1472 "type": "object",
1473 "required": [
1474 "image"
1475 ],
1476 "properties": {
1477 "image": {
1478 "type": "string"
1479 }
1480 }
1481 },
1482 "handlers.EditMapSummaryRequest": {
1483 "type": "object",
1484 "required": [
1485 "description",
1486 "record_date",
1487 "route_id",
1488 "score_count",
1489 "user_name"
1490 ],
1491 "properties": {
1492 "description": {
1493 "type": "string"
1494 },
1495 "record_date": {
1496 "type": "string"
1497 },
1498 "route_id": {
1499 "type": "integer"
1500 },
1501 "score_count": {
1502 "type": "integer"
1503 },
1504 "showcase": {
1505 "type": "string"
1506 },
1507 "user_name": {
1508 "type": "string"
1509 }
1510 }
1511 },
1512 "handlers.LoginResponse": {
1513 "type": "object",
1514 "properties": {
1515 "token": {
1516 "type": "string"
1517 }
1518 }
1519 },
1520 "handlers.LogsResponse": {
1521 "type": "object",
1522 "properties": {
1523 "logs": {
1524 "type": "array",
1525 "items": {
1526 "$ref": "#/definitions/handlers.LogsResponseDetails"
1527 }
1528 }
1529 }
1530 },
1531 "handlers.LogsResponseDetails": {
1532 "type": "object",
1533 "properties": {
1534 "date": {
1535 "type": "string"
1536 },
1537 "detail": {
1538 "type": "string"
1539 },
1540 "message": {
1541 "type": "string"
1542 },
1543 "user": {
1544 "$ref": "#/definitions/models.UserShort"
1545 }
1546 }
1547 },
1548 "handlers.MapDiscussion": {
1549 "type": "object",
1550 "properties": {
1551 "comments": {
1552 "type": "array",
1553 "items": {
1554 "$ref": "#/definitions/handlers.MapDiscussionComment"
1555 }
1556 },
1557 "content": {
1558 "type": "string"
1559 },
1560 "created_at": {
1561 "description": "Upvotes int ` + "`" + `json:\"upvotes\"` + "`" + `",
1562 "type": "string"
1563 },
1564 "creator": {
1565 "$ref": "#/definitions/models.UserShortWithAvatar"
1566 },
1567 "id": {
1568 "type": "integer"
1569 },
1570 "title": {
1571 "type": "string"
1572 },
1573 "updated_at": {
1574 "type": "string"
1575 }
1576 }
1577 },
1578 "handlers.MapDiscussionComment": {
1579 "type": "object",
1580 "properties": {
1581 "comment": {
1582 "type": "string"
1583 },
1584 "date": {
1585 "type": "string"
1586 },
1587 "user": {
1588 "$ref": "#/definitions/models.UserShortWithAvatar"
1589 }
1590 }
1591 },
1592 "handlers.MapDiscussionResponse": {
1593 "type": "object",
1594 "properties": {
1595 "discussion": {
1596 "$ref": "#/definitions/handlers.MapDiscussion"
1597 }
1598 }
1599 },
1600 "handlers.MapDiscussionsResponse": {
1601 "type": "object",
1602 "properties": {
1603 "discussions": {
1604 "type": "array",
1605 "items": {
1606 "$ref": "#/definitions/handlers.MapDiscussion"
1607 }
1608 }
1609 }
1610 },
1611 "handlers.MapLeaderboardsResponse": {
1612 "type": "object",
1613 "properties": {
1614 "map": {
1615 "$ref": "#/definitions/models.Map"
1616 },
1617 "pagination": {
1618 "$ref": "#/definitions/models.Pagination"
1619 },
1620 "records": {}
1621 }
1622 },
1623 "handlers.MapShortWithGame": {
1624 "type": "object",
1625 "properties": {
1626 "chapter": {
1627 "type": "string"
1628 },
1629 "game": {
1630 "type": "string"
1631 },
1632 "id": {
1633 "type": "integer"
1634 },
1635 "map": {
1636 "type": "string"
1637 }
1638 }
1639 },
1640 "handlers.MapSummaryResponse": {
1641 "type": "object",
1642 "properties": {
1643 "map": {
1644 "$ref": "#/definitions/models.Map"
1645 },
1646 "summary": {
1647 "$ref": "#/definitions/models.MapSummary"
1648 }
1649 }
1650 },
1651 "handlers.ProfileRankings": {
1652 "type": "object",
1653 "properties": {
1654 "cooperative": {
1655 "$ref": "#/definitions/handlers.ProfileRankingsDetails"
1656 },
1657 "overall": {
1658 "$ref": "#/definitions/handlers.ProfileRankingsDetails"
1659 },
1660 "singleplayer": {
1661 "$ref": "#/definitions/handlers.ProfileRankingsDetails"
1662 }
1663 }
1664 },
1665 "handlers.ProfileRankingsDetails": {
1666 "type": "object",
1667 "properties": {
1668 "completion_count": {
1669 "type": "integer"
1670 },
1671 "completion_total": {
1672 "type": "integer"
1673 },
1674 "rank": {
1675 "type": "integer"
1676 }
1677 }
1678 },
1679 "handlers.ProfileRecords": {
1680 "type": "object",
1681 "properties": {
1682 "category_id": {
1683 "type": "integer"
1684 },
1685 "game_id": {
1686 "type": "integer"
1687 },
1688 "map_id": {
1689 "type": "integer"
1690 },
1691 "map_name": {
1692 "type": "string"
1693 },
1694 "map_wr_count": {
1695 "type": "integer"
1696 },
1697 "placement": {
1698 "type": "integer"
1699 },
1700 "scores": {
1701 "type": "array",
1702 "items": {
1703 "$ref": "#/definitions/handlers.ProfileScores"
1704 }
1705 }
1706 }
1707 },
1708 "handlers.ProfileResponse": {
1709 "type": "object",
1710 "properties": {
1711 "avatar_link": {
1712 "type": "string"
1713 },
1714 "country_code": {
1715 "type": "string"
1716 },
1717 "links": {
1718 "$ref": "#/definitions/models.Links"
1719 },
1720 "pagination": {
1721 "$ref": "#/definitions/models.Pagination"
1722 },
1723 "profile": {
1724 "type": "boolean"
1725 },
1726 "rankings": {
1727 "$ref": "#/definitions/handlers.ProfileRankings"
1728 },
1729 "records": {
1730 "type": "array",
1731 "items": {
1732 "$ref": "#/definitions/handlers.ProfileRecords"
1733 }
1734 },
1735 "steam_id": {
1736 "type": "string"
1737 },
1738 "titles": {
1739 "type": "array",
1740 "items": {
1741 "$ref": "#/definitions/models.Title"
1742 }
1743 },
1744 "user_name": {
1745 "type": "string"
1746 }
1747 }
1748 },
1749 "handlers.ProfileScores": {
1750 "type": "object",
1751 "properties": {
1752 "date": {
1753 "type": "string"
1754 },
1755 "demo_id": {
1756 "type": "string"
1757 },
1758 "record_id": {
1759 "type": "integer"
1760 },
1761 "score_count": {
1762 "type": "integer"
1763 },
1764 "score_time": {
1765 "type": "integer"
1766 }
1767 }
1768 },
1769 "handlers.RankingsResponse": {
1770 "type": "object",
1771 "properties": {
1772 "rankings_multiplayer": {
1773 "type": "array",
1774 "items": {
1775 "$ref": "#/definitions/models.UserRanking"
1776 }
1777 },
1778 "rankings_overall": {
1779 "type": "array",
1780 "items": {
1781 "$ref": "#/definitions/models.UserRanking"
1782 }
1783 },
1784 "rankings_singleplayer": {
1785 "type": "array",
1786 "items": {
1787 "$ref": "#/definitions/models.UserRanking"
1788 }
1789 }
1790 }
1791 },
1792 "handlers.RecordResponse": {
1793 "type": "object",
1794 "properties": {
1795 "score_count": {
1796 "type": "integer"
1797 },
1798 "score_time": {
1799 "type": "integer"
1800 }
1801 }
1802 },
1803 "handlers.ScoreLogsResponse": {
1804 "type": "object",
1805 "properties": {
1806 "scores": {
1807 "type": "array",
1808 "items": {
1809 "$ref": "#/definitions/handlers.ScoreLogsResponseDetails"
1810 }
1811 }
1812 }
1813 },
1814 "handlers.ScoreLogsResponseDetails": {
1815 "type": "object",
1816 "properties": {
1817 "date": {
1818 "type": "string"
1819 },
1820 "demo_id": {
1821 "type": "string"
1822 },
1823 "game": {
1824 "$ref": "#/definitions/models.Game"
1825 },
1826 "map": {
1827 "$ref": "#/definitions/models.MapShort"
1828 },
1829 "score_count": {
1830 "type": "integer"
1831 },
1832 "score_time": {
1833 "type": "integer"
1834 },
1835 "user": {
1836 "$ref": "#/definitions/models.UserShort"
1837 }
1838 }
1839 },
1840 "handlers.SearchResponse": {
1841 "type": "object",
1842 "properties": {
1843 "maps": {
1844 "type": "array",
1845 "items": {
1846 "$ref": "#/definitions/handlers.MapShortWithGame"
1847 }
1848 },
1849 "players": {
1850 "type": "array",
1851 "items": {
1852 "$ref": "#/definitions/models.UserShortWithAvatar"
1853 }
1854 }
1855 }
1856 },
1857 "models.Category": {
1858 "type": "object",
1859 "properties": {
1860 "id": {
1861 "type": "integer"
1862 },
1863 "name": {
1864 "type": "string"
1865 }
1866 }
1867 },
1868 "models.CategoryPortal": {
1869 "type": "object",
1870 "properties": {
1871 "category": {
1872 "$ref": "#/definitions/models.Category"
1873 },
1874 "portal_count": {
1875 "type": "integer"
1876 }
1877 }
1878 },
1879 "models.Chapter": {
1880 "type": "object",
1881 "properties": {
1882 "id": {
1883 "type": "integer"
1884 },
1885 "image": {
1886 "type": "string"
1887 },
1888 "is_disabled": {
1889 "type": "boolean"
1890 },
1891 "name": {
1892 "type": "string"
1893 }
1894 }
1895 },
1896 "models.Game": {
1897 "type": "object",
1898 "properties": {
1899 "category_portals": {
1900 "type": "array",
1901 "items": {
1902 "$ref": "#/definitions/models.CategoryPortal"
1903 }
1904 },
1905 "id": {
1906 "type": "integer"
1907 },
1908 "image": {
1909 "type": "string"
1910 },
1911 "is_coop": {
1912 "type": "boolean"
1913 },
1914 "name": {
1915 "type": "string"
1916 }
1917 }
1918 },
1919 "models.Links": {
1920 "type": "object",
1921 "properties": {
1922 "p2sr": {
1923 "type": "string"
1924 },
1925 "steam": {
1926 "type": "string"
1927 },
1928 "twitch": {
1929 "type": "string"
1930 },
1931 "youtube": {
1932 "type": "string"
1933 }
1934 }
1935 },
1936 "models.Map": {
1937 "type": "object",
1938 "properties": {
1939 "chapter_name": {
1940 "type": "string"
1941 },
1942 "game_name": {
1943 "type": "string"
1944 },
1945 "id": {
1946 "type": "integer"
1947 },
1948 "image": {
1949 "type": "string"
1950 },
1951 "is_coop": {
1952 "type": "boolean"
1953 },
1954 "is_disabled": {
1955 "type": "boolean"
1956 },
1957 "map_name": {
1958 "type": "string"
1959 }
1960 }
1961 },
1962 "models.MapHistory": {
1963 "type": "object",
1964 "properties": {
1965 "date": {
1966 "type": "string"
1967 },
1968 "runner_name": {
1969 "type": "string"
1970 },
1971 "score_count": {
1972 "type": "integer"
1973 }
1974 }
1975 },
1976 "models.MapRoute": {
1977 "type": "object",
1978 "properties": {
1979 "category": {
1980 "$ref": "#/definitions/models.Category"
1981 },
1982 "completion_count": {
1983 "type": "integer"
1984 },
1985 "description": {
1986 "type": "string"
1987 },
1988 "history": {
1989 "$ref": "#/definitions/models.MapHistory"
1990 },
1991 "rating": {
1992 "type": "number"
1993 },
1994 "route_id": {
1995 "type": "integer"
1996 },
1997 "showcase": {
1998 "type": "string"
1999 }
2000 }
2001 },
2002 "models.MapSelect": {
2003 "type": "object",
2004 "properties": {
2005 "category_portals": {
2006 "type": "array",
2007 "items": {
2008 "$ref": "#/definitions/models.CategoryPortal"
2009 }
2010 },
2011 "difficulty": {
2012 "type": "integer"
2013 },
2014 "id": {
2015 "type": "integer"
2016 },
2017 "image": {
2018 "type": "string"
2019 },
2020 "is_disabled": {
2021 "type": "boolean"
2022 },
2023 "name": {
2024 "type": "string"
2025 }
2026 }
2027 },
2028 "models.MapShort": {
2029 "type": "object",
2030 "properties": {
2031 "difficulty": {
2032 "type": "integer"
2033 },
2034 "id": {
2035 "type": "integer"
2036 },
2037 "image": {
2038 "type": "string"
2039 },
2040 "is_disabled": {
2041 "type": "boolean"
2042 },
2043 "name": {
2044 "type": "string"
2045 },
2046 "portal_count": {
2047 "type": "integer"
2048 }
2049 }
2050 },
2051 "models.MapSummary": {
2052 "type": "object",
2053 "properties": {
2054 "routes": {
2055 "type": "array",
2056 "items": {
2057 "$ref": "#/definitions/models.MapRoute"
2058 }
2059 }
2060 }
2061 },
2062 "models.Pagination": {
2063 "type": "object",
2064 "properties": {
2065 "current_page": {
2066 "type": "integer"
2067 },
2068 "page_size": {
2069 "type": "integer"
2070 },
2071 "total_pages": {
2072 "type": "integer"
2073 },
2074 "total_records": {
2075 "type": "integer"
2076 }
2077 }
2078 },
2079 "models.Response": {
2080 "type": "object",
2081 "properties": {
2082 "data": {},
2083 "message": {
2084 "type": "string"
2085 },
2086 "success": {
2087 "type": "boolean"
2088 }
2089 }
2090 },
2091 "models.Title": {
2092 "type": "object",
2093 "properties": {
2094 "color": {
2095 "type": "string"
2096 },
2097 "name": {
2098 "type": "string"
2099 }
2100 }
2101 },
2102 "models.UserRanking": {
2103 "type": "object",
2104 "properties": {
2105 "placement": {
2106 "type": "integer"
2107 },
2108 "total_score": {
2109 "type": "integer"
2110 },
2111 "user": {
2112 "$ref": "#/definitions/models.UserShortWithAvatar"
2113 }
2114 }
2115 },
2116 "models.UserShort": {
2117 "type": "object",
2118 "properties": {
2119 "steam_id": {
2120 "type": "string"
2121 },
2122 "user_name": {
2123 "type": "string"
2124 }
2125 }
2126 },
2127 "models.UserShortWithAvatar": {
2128 "type": "object",
2129 "properties": {
2130 "avatar_link": {
2131 "type": "string"
2132 },
2133 "steam_id": {
2134 "type": "string"
2135 },
2136 "user_name": {
2137 "type": "string"
2138 }
2139 }
2140 }
2141 }
2142}`
2143
2144// SwaggerInfo holds exported Swagger Info so clients can modify it
2145var SwaggerInfo = &swag.Spec{
2146 Version: "1.0",
2147 Host: "lp.ardapektezol.com",
2148 BasePath: "/api/v1",
2149 Schemes: []string{},
2150 Title: "Least Portals Database API",
2151 Description: "Backend API endpoints for the Least Portals Database.",
2152 InfoInstanceName: "swagger",
2153 SwaggerTemplate: docTemplate,
2154 LeftDelim: "{{",
2155 RightDelim: "}}",
2156}
2157
2158func init() {
2159 swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
2160}