aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/docs.go228
-rw-r--r--docs/swagger.json228
-rw-r--r--docs/swagger.yaml138
3 files changed, 577 insertions, 17 deletions
diff --git a/docs/docs.go b/docs/docs.go
index 22d4362..788ca3d 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -20,6 +20,55 @@ const docTemplate = `{
20 "host": "{{.Host}}", 20 "host": "{{.Host}}",
21 "basePath": "{{.BasePath}}", 21 "basePath": "{{.BasePath}}",
22 "paths": { 22 "paths": {
23 "/chapters/{id}": {
24 "get": {
25 "produces": [
26 "application/json"
27 ],
28 "tags": [
29 "chapters"
30 ],
31 "summary": "Get chapters from the specified game id.",
32 "parameters": [
33 {
34 "type": "integer",
35 "description": "Game ID",
36 "name": "id",
37 "in": "path",
38 "required": true
39 }
40 ],
41 "responses": {
42 "200": {
43 "description": "OK",
44 "schema": {
45 "allOf": [
46 {
47 "$ref": "#/definitions/models.Response"
48 },
49 {
50 "type": "object",
51 "properties": {
52 "data": {
53 "type": "array",
54 "items": {
55 "$ref": "#/definitions/models.Chapter"
56 }
57 }
58 }
59 }
60 ]
61 }
62 },
63 "400": {
64 "description": "Bad Request",
65 "schema": {
66 "$ref": "#/definitions/models.Response"
67 }
68 }
69 }
70 }
71 },
23 "/demo": { 72 "/demo": {
24 "get": { 73 "get": {
25 "produces": [ 74 "produces": [
@@ -94,6 +143,46 @@ const docTemplate = `{
94 } 143 }
95 } 144 }
96 }, 145 },
146 "/games": {
147 "get": {
148 "produces": [
149 "application/json"
150 ],
151 "tags": [
152 "games"
153 ],
154 "summary": "Get games from the leaderboards.",
155 "responses": {
156 "200": {
157 "description": "OK",
158 "schema": {
159 "allOf": [
160 {
161 "$ref": "#/definitions/models.Response"
162 },
163 {
164 "type": "object",
165 "properties": {
166 "data": {
167 "type": "array",
168 "items": {
169 "$ref": "#/definitions/models.Game"
170 }
171 }
172 }
173 }
174 ]
175 }
176 },
177 "400": {
178 "description": "Bad Request",
179 "schema": {
180 "$ref": "#/definitions/models.Response"
181 }
182 }
183 }
184 }
185 },
97 "/login": { 186 "/login": {
98 "get": { 187 "get": {
99 "consumes": [ 188 "consumes": [
@@ -134,11 +223,57 @@ const docTemplate = `{
134 } 223 }
135 } 224 }
136 }, 225 },
137 "/maps/{id}/leaderboards": { 226 "/maps/{id}": {
138 "get": { 227 "get": {
139 "consumes": [ 228 "produces": [
140 "application/json" 229 "application/json"
141 ], 230 ],
231 "tags": [
232 "maps"
233 ],
234 "summary": "Get maps from the specified chapter id.",
235 "parameters": [
236 {
237 "type": "integer",
238 "description": "Chapter ID",
239 "name": "id",
240 "in": "path",
241 "required": true
242 }
243 ],
244 "responses": {
245 "200": {
246 "description": "OK",
247 "schema": {
248 "allOf": [
249 {
250 "$ref": "#/definitions/models.Response"
251 },
252 {
253 "type": "object",
254 "properties": {
255 "data": {
256 "type": "array",
257 "items": {
258 "$ref": "#/definitions/models.MapShort"
259 }
260 }
261 }
262 }
263 ]
264 }
265 },
266 "400": {
267 "description": "Bad Request",
268 "schema": {
269 "$ref": "#/definitions/models.Response"
270 }
271 }
272 }
273 }
274 },
275 "/maps/{id}/leaderboards": {
276 "get": {
142 "produces": [ 277 "produces": [
143 "application/json" 278 "application/json"
144 ], 279 ],
@@ -290,9 +425,6 @@ const docTemplate = `{
290 }, 425 },
291 "/maps/{id}/summary": { 426 "/maps/{id}/summary": {
292 "get": { 427 "get": {
293 "consumes": [
294 "application/json"
295 ],
296 "produces": [ 428 "produces": [
297 "application/json" 429 "application/json"
298 ], 430 ],
@@ -530,7 +662,19 @@ const docTemplate = `{
530 "200": { 662 "200": {
531 "description": "OK", 663 "description": "OK",
532 "schema": { 664 "schema": {
533 "$ref": "#/definitions/models.Response" 665 "allOf": [
666 {
667 "$ref": "#/definitions/models.Response"
668 },
669 {
670 "type": "object",
671 "properties": {
672 "data": {
673 "$ref": "#/definitions/models.SearchResponse"
674 }
675 }
676 }
677 ]
534 } 678 }
535 }, 679 },
536 "400": { 680 "400": {
@@ -599,6 +743,31 @@ const docTemplate = `{
599 } 743 }
600 }, 744 },
601 "definitions": { 745 "definitions": {
746 "models.Chapter": {
747 "type": "object",
748 "properties": {
749 "game_id": {
750 "type": "integer"
751 },
752 "id": {
753 "type": "integer"
754 },
755 "name": {
756 "type": "string"
757 }
758 }
759 },
760 "models.Game": {
761 "type": "object",
762 "properties": {
763 "id": {
764 "type": "integer"
765 },
766 "name": {
767 "type": "string"
768 }
769 }
770 },
602 "models.LoginResponse": { 771 "models.LoginResponse": {
603 "type": "object", 772 "type": "object",
604 "properties": { 773 "properties": {
@@ -662,6 +831,20 @@ const docTemplate = `{
662 "records": {} 831 "records": {}
663 } 832 }
664 }, 833 },
834 "models.MapShort": {
835 "type": "object",
836 "properties": {
837 "chapter_id": {
838 "type": "integer"
839 },
840 "id": {
841 "type": "integer"
842 },
843 "name": {
844 "type": "string"
845 }
846 }
847 },
665 "models.MapSummary": { 848 "models.MapSummary": {
666 "type": "object", 849 "type": "object",
667 "properties": { 850 "properties": {
@@ -784,6 +967,39 @@ const docTemplate = `{
784 "records": {} 967 "records": {}
785 } 968 }
786 }, 969 },
970 "models.SearchResponse": {
971 "type": "object",
972 "properties": {
973 "maps": {
974 "type": "array",
975 "items": {
976 "type": "object",
977 "properties": {
978 "id": {
979 "type": "integer"
980 },
981 "name": {
982 "type": "string"
983 }
984 }
985 }
986 },
987 "players": {
988 "type": "array",
989 "items": {
990 "type": "object",
991 "properties": {
992 "steam_id": {
993 "type": "string"
994 },
995 "user_name": {
996 "type": "string"
997 }
998 }
999 }
1000 }
1001 }
1002 },
787 "models.UserRanking": { 1003 "models.UserRanking": {
788 "type": "object", 1004 "type": "object",
789 "properties": { 1005 "properties": {
diff --git a/docs/swagger.json b/docs/swagger.json
index 0bebe1c..ba0e8a3 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -13,6 +13,55 @@
13 "host": "lp.ardapektezol.com/api", 13 "host": "lp.ardapektezol.com/api",
14 "basePath": "/v1", 14 "basePath": "/v1",
15 "paths": { 15 "paths": {
16 "/chapters/{id}": {
17 "get": {
18 "produces": [
19 "application/json"
20 ],
21 "tags": [
22 "chapters"
23 ],
24 "summary": "Get chapters from the specified game id.",
25 "parameters": [
26 {
27 "type": "integer",
28 "description": "Game ID",
29 "name": "id",
30 "in": "path",
31 "required": true
32 }
33 ],
34 "responses": {
35 "200": {
36 "description": "OK",
37 "schema": {
38 "allOf": [
39 {
40 "$ref": "#/definitions/models.Response"
41 },
42 {
43 "type": "object",
44 "properties": {
45 "data": {
46 "type": "array",
47 "items": {
48 "$ref": "#/definitions/models.Chapter"
49 }
50 }
51 }
52 }
53 ]
54 }
55 },
56 "400": {
57 "description": "Bad Request",
58 "schema": {
59 "$ref": "#/definitions/models.Response"
60 }
61 }
62 }
63 }
64 },
16 "/demo": { 65 "/demo": {
17 "get": { 66 "get": {
18 "produces": [ 67 "produces": [
@@ -87,6 +136,46 @@
87 } 136 }
88 } 137 }
89 }, 138 },
139 "/games": {
140 "get": {
141 "produces": [
142 "application/json"
143 ],
144 "tags": [
145 "games"
146 ],
147 "summary": "Get games from the leaderboards.",
148 "responses": {
149 "200": {
150 "description": "OK",
151 "schema": {
152 "allOf": [
153 {
154 "$ref": "#/definitions/models.Response"
155 },
156 {
157 "type": "object",
158 "properties": {
159 "data": {
160 "type": "array",
161 "items": {
162 "$ref": "#/definitions/models.Game"
163 }
164 }
165 }
166 }
167 ]
168 }
169 },
170 "400": {
171 "description": "Bad Request",
172 "schema": {
173 "$ref": "#/definitions/models.Response"
174 }
175 }
176 }
177 }
178 },
90 "/login": { 179 "/login": {
91 "get": { 180 "get": {
92 "consumes": [ 181 "consumes": [
@@ -127,11 +216,57 @@
127 } 216 }
128 } 217 }
129 }, 218 },
130 "/maps/{id}/leaderboards": { 219 "/maps/{id}": {
131 "get": { 220 "get": {
132 "consumes": [ 221 "produces": [
133 "application/json" 222 "application/json"
134 ], 223 ],
224 "tags": [
225 "maps"
226 ],
227 "summary": "Get maps from the specified chapter id.",
228 "parameters": [
229 {
230 "type": "integer",
231 "description": "Chapter ID",
232 "name": "id",
233 "in": "path",
234 "required": true
235 }
236 ],
237 "responses": {
238 "200": {
239 "description": "OK",
240 "schema": {
241 "allOf": [
242 {
243 "$ref": "#/definitions/models.Response"
244 },
245 {
246 "type": "object",
247 "properties": {
248 "data": {
249 "type": "array",
250 "items": {
251 "$ref": "#/definitions/models.MapShort"
252 }
253 }
254 }
255 }
256 ]
257 }
258 },
259 "400": {
260 "description": "Bad Request",
261 "schema": {
262 "$ref": "#/definitions/models.Response"
263 }
264 }
265 }
266 }
267 },
268 "/maps/{id}/leaderboards": {
269 "get": {
135 "produces": [ 270 "produces": [
136 "application/json" 271 "application/json"
137 ], 272 ],
@@ -283,9 +418,6 @@
283 }, 418 },
284 "/maps/{id}/summary": { 419 "/maps/{id}/summary": {
285 "get": { 420 "get": {
286 "consumes": [
287 "application/json"
288 ],
289 "produces": [ 421 "produces": [
290 "application/json" 422 "application/json"
291 ], 423 ],
@@ -523,7 +655,19 @@
523 "200": { 655 "200": {
524 "description": "OK", 656 "description": "OK",
525 "schema": { 657 "schema": {
526 "$ref": "#/definitions/models.Response" 658 "allOf": [
659 {
660 "$ref": "#/definitions/models.Response"
661 },
662 {
663 "type": "object",
664 "properties": {
665 "data": {
666 "$ref": "#/definitions/models.SearchResponse"
667 }
668 }
669 }
670 ]
527 } 671 }
528 }, 672 },
529 "400": { 673 "400": {
@@ -592,6 +736,31 @@
592 } 736 }
593 }, 737 },
594 "definitions": { 738 "definitions": {
739 "models.Chapter": {
740 "type": "object",
741 "properties": {
742 "game_id": {
743 "type": "integer"
744 },
745 "id": {
746 "type": "integer"
747 },
748 "name": {
749 "type": "string"
750 }
751 }
752 },
753 "models.Game": {
754 "type": "object",
755 "properties": {
756 "id": {
757 "type": "integer"
758 },
759 "name": {
760 "type": "string"
761 }
762 }
763 },
595 "models.LoginResponse": { 764 "models.LoginResponse": {
596 "type": "object", 765 "type": "object",
597 "properties": { 766 "properties": {
@@ -655,6 +824,20 @@
655 "records": {} 824 "records": {}
656 } 825 }
657 }, 826 },
827 "models.MapShort": {
828 "type": "object",
829 "properties": {
830 "chapter_id": {
831 "type": "integer"
832 },
833 "id": {
834 "type": "integer"
835 },
836 "name": {
837 "type": "string"
838 }
839 }
840 },
658 "models.MapSummary": { 841 "models.MapSummary": {
659 "type": "object", 842 "type": "object",
660 "properties": { 843 "properties": {
@@ -777,6 +960,39 @@
777 "records": {} 960 "records": {}
778 } 961 }
779 }, 962 },
963 "models.SearchResponse": {
964 "type": "object",
965 "properties": {
966 "maps": {
967 "type": "array",
968 "items": {
969 "type": "object",
970 "properties": {
971 "id": {
972 "type": "integer"
973 },
974 "name": {
975 "type": "string"
976 }
977 }
978 }
979 },
980 "players": {
981 "type": "array",
982 "items": {
983 "type": "object",
984 "properties": {
985 "steam_id": {
986 "type": "string"
987 },
988 "user_name": {
989 "type": "string"
990 }
991 }
992 }
993 }
994 }
995 },
780 "models.UserRanking": { 996 "models.UserRanking": {
781 "type": "object", 997 "type": "object",
782 "properties": { 998 "properties": {
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index f719008..8b66ec8 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1,5 +1,21 @@
1basePath: /v1 1basePath: /v1
2definitions: 2definitions:
3 models.Chapter:
4 properties:
5 game_id:
6 type: integer
7 id:
8 type: integer
9 name:
10 type: string
11 type: object
12 models.Game:
13 properties:
14 id:
15 type: integer
16 name:
17 type: string
18 type: object
3 models.LoginResponse: 19 models.LoginResponse:
4 properties: 20 properties:
5 token: 21 token:
@@ -41,6 +57,15 @@ definitions:
41 properties: 57 properties:
42 records: {} 58 records: {}
43 type: object 59 type: object
60 models.MapShort:
61 properties:
62 chapter_id:
63 type: integer
64 id:
65 type: integer
66 name:
67 type: string
68 type: object
44 models.MapSummary: 69 models.MapSummary:
45 properties: 70 properties:
46 category_scores: 71 category_scores:
@@ -122,6 +147,27 @@ definitions:
122 type: integer 147 type: integer
123 records: {} 148 records: {}
124 type: object 149 type: object
150 models.SearchResponse:
151 properties:
152 maps:
153 items:
154 properties:
155 id:
156 type: integer
157 name:
158 type: string
159 type: object
160 type: array
161 players:
162 items:
163 properties:
164 steam_id:
165 type: string
166 user_name:
167 type: string
168 type: object
169 type: array
170 type: object
125 models.UserRanking: 171 models.UserRanking:
126 properties: 172 properties:
127 total_score: 173 total_score:
@@ -141,6 +187,35 @@ info:
141 title: Least Portals Database API 187 title: Least Portals Database API
142 version: "1.0" 188 version: "1.0"
143paths: 189paths:
190 /chapters/{id}:
191 get:
192 parameters:
193 - description: Game ID
194 in: path
195 name: id
196 required: true
197 type: integer
198 produces:
199 - application/json
200 responses:
201 "200":
202 description: OK
203 schema:
204 allOf:
205 - $ref: '#/definitions/models.Response'
206 - properties:
207 data:
208 items:
209 $ref: '#/definitions/models.Chapter'
210 type: array
211 type: object
212 "400":
213 description: Bad Request
214 schema:
215 $ref: '#/definitions/models.Response'
216 summary: Get chapters from the specified game id.
217 tags:
218 - chapters
144 /demo: 219 /demo:
145 get: 220 get:
146 produces: 221 produces:
@@ -186,6 +261,29 @@ paths:
186 summary: Get demo with specified demo uuid. 261 summary: Get demo with specified demo uuid.
187 tags: 262 tags:
188 - demo 263 - demo
264 /games:
265 get:
266 produces:
267 - application/json
268 responses:
269 "200":
270 description: OK
271 schema:
272 allOf:
273 - $ref: '#/definitions/models.Response'
274 - properties:
275 data:
276 items:
277 $ref: '#/definitions/models.Game'
278 type: array
279 type: object
280 "400":
281 description: Bad Request
282 schema:
283 $ref: '#/definitions/models.Response'
284 summary: Get games from the leaderboards.
285 tags:
286 - games
189 /login: 287 /login:
190 get: 288 get:
191 consumes: 289 consumes:
@@ -209,10 +307,37 @@ paths:
209 summary: Get (redirect) login page for Steam auth. 307 summary: Get (redirect) login page for Steam auth.
210 tags: 308 tags:
211 - login 309 - login
212 /maps/{id}/leaderboards: 310 /maps/{id}:
213 get: 311 get:
214 consumes: 312 parameters:
313 - description: Chapter ID
314 in: path
315 name: id
316 required: true
317 type: integer
318 produces:
215 - application/json 319 - application/json
320 responses:
321 "200":
322 description: OK
323 schema:
324 allOf:
325 - $ref: '#/definitions/models.Response'
326 - properties:
327 data:
328 items:
329 $ref: '#/definitions/models.MapShort'
330 type: array
331 type: object
332 "400":
333 description: Bad Request
334 schema:
335 $ref: '#/definitions/models.Response'
336 summary: Get maps from the specified chapter id.
337 tags:
338 - maps
339 /maps/{id}/leaderboards:
340 get:
216 parameters: 341 parameters:
217 - description: Map ID 342 - description: Map ID
218 in: path 343 in: path
@@ -305,8 +430,6 @@ paths:
305 - maps 430 - maps
306 /maps/{id}/summary: 431 /maps/{id}/summary:
307 get: 432 get:
308 consumes:
309 - application/json
310 parameters: 433 parameters:
311 - description: Map ID 434 - description: Map ID
312 in: path 435 in: path
@@ -447,7 +570,12 @@ paths:
447 "200": 570 "200":
448 description: OK 571 description: OK
449 schema: 572 schema:
450 $ref: '#/definitions/models.Response' 573 allOf:
574 - $ref: '#/definitions/models.Response'
575 - properties:
576 data:
577 $ref: '#/definitions/models.SearchResponse'
578 type: object
451 "400": 579 "400":
452 description: Bad Request 580 description: Bad Request
453 schema: 581 schema: