aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-04-24 18:05:38 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-04-24 18:05:38 +0300
commit7f8277d89c8d60a91fded6d4095de9e789c61838 (patch)
tree1d3b64f41563211cbb4cb55dbdeb9d4293cc0605 /docs
parentfeat: map summary and leaderboard endpoints, new models and routes (#38) (diff)
downloadlphub-7f8277d89c8d60a91fded6d4095de9e789c61838.tar.gz
lphub-7f8277d89c8d60a91fded6d4095de9e789c61838.tar.bz2
lphub-7f8277d89c8d60a91fded6d4095de9e789c61838.zip
doc: map summary and leaderboard endpoints (#38)
Diffstat (limited to 'docs')
-rw-r--r--docs/docs.go181
-rw-r--r--docs/swagger.json181
-rw-r--r--docs/swagger.yaml112
3 files changed, 442 insertions, 32 deletions
diff --git a/docs/docs.go b/docs/docs.go
index b708f2b..022814a 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -26,6 +26,46 @@ const docTemplate = `{
26 "application/json" 26 "application/json"
27 ], 27 ],
28 "produces": [ 28 "produces": [
29 "application/json"
30 ],
31 "tags": [
32 "rankings"
33 ],
34 "summary": "Get rankings of every player.",
35 "responses": {
36 "200": {
37 "description": "OK",
38 "schema": {
39 "allOf": [
40 {
41 "$ref": "#/definitions/models.Response"
42 },
43 {
44 "type": "object",
45 "properties": {
46 "data": {
47 "$ref": "#/definitions/models.RankingsResponse"
48 }
49 }
50 }
51 ]
52 }
53 },
54 "400": {
55 "description": "Bad Request",
56 "schema": {
57 "$ref": "#/definitions/models.Response"
58 }
59 }
60 }
61 }
62 },
63 "/demos": {
64 "get": {
65 "consumes": [
66 "application/json"
67 ],
68 "produces": [
29 "application/octet-stream" 69 "application/octet-stream"
30 ], 70 ],
31 "tags": [ 71 "tags": [
@@ -97,7 +137,7 @@ const docTemplate = `{
97 } 137 }
98 } 138 }
99 }, 139 },
100 "/maps/{id}": { 140 "/maps/{id}/leaderboards": {
101 "get": { 141 "get": {
102 "consumes": [ 142 "consumes": [
103 "application/json" 143 "application/json"
@@ -108,7 +148,7 @@ const docTemplate = `{
108 "tags": [ 148 "tags": [
109 "maps" 149 "maps"
110 ], 150 ],
111 "summary": "Get map page with specified id.", 151 "summary": "Get map leaderboards with specified id.",
112 "parameters": [ 152 "parameters": [
113 { 153 {
114 "type": "integer", 154 "type": "integer",
@@ -130,7 +170,19 @@ const docTemplate = `{
130 "type": "object", 170 "type": "object",
131 "properties": { 171 "properties": {
132 "data": { 172 "data": {
133 "$ref": "#/definitions/models.Map" 173 "allOf": [
174 {
175 "$ref": "#/definitions/models.Map"
176 },
177 {
178 "type": "object",
179 "properties": {
180 "data": {
181 "$ref": "#/definitions/models.MapRecords"
182 }
183 }
184 }
185 ]
134 } 186 }
135 } 187 }
136 } 188 }
@@ -239,6 +291,67 @@ const docTemplate = `{
239 } 291 }
240 } 292 }
241 }, 293 },
294 "/maps/{id}/summary": {
295 "get": {
296 "consumes": [
297 "application/json"
298 ],
299 "produces": [
300 "application/json"
301 ],
302 "tags": [
303 "maps"
304 ],
305 "summary": "Get map summary with specified id.",
306 "parameters": [
307 {
308 "type": "integer",
309 "description": "Map ID",
310 "name": "id",
311 "in": "path",
312 "required": true
313 }
314 ],
315 "responses": {
316 "200": {
317 "description": "OK",
318 "schema": {
319 "allOf": [
320 {
321 "$ref": "#/definitions/models.Response"
322 },
323 {
324 "type": "object",
325 "properties": {
326 "data": {
327 "allOf": [
328 {
329 "$ref": "#/definitions/models.Map"
330 },
331 {
332 "type": "object",
333 "properties": {
334 "data": {
335 "$ref": "#/definitions/models.MapSummary"
336 }
337 }
338 }
339 ]
340 }
341 }
342 }
343 ]
344 }
345 },
346 "400": {
347 "description": "Bad Request",
348 "schema": {
349 "$ref": "#/definitions/models.Response"
350 }
351 }
352 }
353 }
354 },
242 "/profile": { 355 "/profile": {
243 "get": { 356 "get": {
244 "consumes": [ 357 "consumes": [
@@ -407,7 +520,7 @@ const docTemplate = `{
407 } 520 }
408 } 521 }
409 }, 522 },
410 "/user/{id}": { 523 "/users/{id}": {
411 "get": { 524 "get": {
412 "consumes": [ 525 "consumes": [
413 "application/json" 526 "application/json"
@@ -475,24 +588,70 @@ const docTemplate = `{
475 "models.Map": { 588 "models.Map": {
476 "type": "object", 589 "type": "object",
477 "properties": { 590 "properties": {
591 "chapter_name": {
592 "type": "string"
593 },
594 "data": {},
595 "game_name": {
596 "type": "string"
597 },
478 "id": { 598 "id": {
479 "type": "integer" 599 "type": "integer"
480 }, 600 },
481 "is_coop": { 601 "map_name": {
482 "type": "boolean"
483 },
484 "name": {
485 "type": "string" 602 "type": "string"
603 }
604 }
605 },
606 "models.MapCategoryScores": {
607 "type": "object",
608 "properties": {
609 "any": {
610 "type": "integer"
611 },
612 "cm": {
613 "type": "integer"
486 }, 614 },
487 "records": {}, 615 "inbounds_sla": {
488 "wr_score": {
489 "type": "integer" 616 "type": "integer"
490 }, 617 },
491 "wr_time": { 618 "no_sla": {
492 "type": "integer" 619 "type": "integer"
493 } 620 }
494 } 621 }
495 }, 622 },
623 "models.MapRecords": {
624 "type": "object",
625 "properties": {
626 "records": {}
627 }
628 },
629 "models.MapSummary": {
630 "type": "object",
631 "properties": {
632 "category_scores": {
633 "$ref": "#/definitions/models.MapCategoryScores"
634 },
635 "description": {
636 "type": "string"
637 },
638 "first_completion": {
639 "type": "string"
640 },
641 "rating": {
642 "type": "number"
643 },
644 "routers": {
645 "type": "array",
646 "items": {
647 "type": "string"
648 }
649 },
650 "showcase": {
651 "type": "string"
652 }
653 }
654 },
496 "models.ProfileResponse": { 655 "models.ProfileResponse": {
497 "type": "object", 656 "type": "object",
498 "properties": { 657 "properties": {
diff --git a/docs/swagger.json b/docs/swagger.json
index abdd6a8..4f3e868 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -19,6 +19,46 @@
19 "application/json" 19 "application/json"
20 ], 20 ],
21 "produces": [ 21 "produces": [
22 "application/json"
23 ],
24 "tags": [
25 "rankings"
26 ],
27 "summary": "Get rankings of every player.",
28 "responses": {
29 "200": {
30 "description": "OK",
31 "schema": {
32 "allOf": [
33 {
34 "$ref": "#/definitions/models.Response"
35 },
36 {
37 "type": "object",
38 "properties": {
39 "data": {
40 "$ref": "#/definitions/models.RankingsResponse"
41 }
42 }
43 }
44 ]
45 }
46 },
47 "400": {
48 "description": "Bad Request",
49 "schema": {
50 "$ref": "#/definitions/models.Response"
51 }
52 }
53 }
54 }
55 },
56 "/demos": {
57 "get": {
58 "consumes": [
59 "application/json"
60 ],
61 "produces": [
22 "application/octet-stream" 62 "application/octet-stream"
23 ], 63 ],
24 "tags": [ 64 "tags": [
@@ -90,7 +130,7 @@
90 } 130 }
91 } 131 }
92 }, 132 },
93 "/maps/{id}": { 133 "/maps/{id}/leaderboards": {
94 "get": { 134 "get": {
95 "consumes": [ 135 "consumes": [
96 "application/json" 136 "application/json"
@@ -101,7 +141,7 @@
101 "tags": [ 141 "tags": [
102 "maps" 142 "maps"
103 ], 143 ],
104 "summary": "Get map page with specified id.", 144 "summary": "Get map leaderboards with specified id.",
105 "parameters": [ 145 "parameters": [
106 { 146 {
107 "type": "integer", 147 "type": "integer",
@@ -123,7 +163,19 @@
123 "type": "object", 163 "type": "object",
124 "properties": { 164 "properties": {
125 "data": { 165 "data": {
126 "$ref": "#/definitions/models.Map" 166 "allOf": [
167 {
168 "$ref": "#/definitions/models.Map"
169 },
170 {
171 "type": "object",
172 "properties": {
173 "data": {
174 "$ref": "#/definitions/models.MapRecords"
175 }
176 }
177 }
178 ]
127 } 179 }
128 } 180 }
129 } 181 }
@@ -232,6 +284,67 @@
232 } 284 }
233 } 285 }
234 }, 286 },
287 "/maps/{id}/summary": {
288 "get": {
289 "consumes": [
290 "application/json"
291 ],
292 "produces": [
293 "application/json"
294 ],
295 "tags": [
296 "maps"
297 ],
298 "summary": "Get map summary with specified id.",
299 "parameters": [
300 {
301 "type": "integer",
302 "description": "Map ID",
303 "name": "id",
304 "in": "path",
305 "required": true
306 }
307 ],
308 "responses": {
309 "200": {
310 "description": "OK",
311 "schema": {
312 "allOf": [
313 {
314 "$ref": "#/definitions/models.Response"
315 },
316 {
317 "type": "object",
318 "properties": {
319 "data": {
320 "allOf": [
321 {
322 "$ref": "#/definitions/models.Map"
323 },
324 {
325 "type": "object",
326 "properties": {
327 "data": {
328 "$ref": "#/definitions/models.MapSummary"
329 }
330 }
331 }
332 ]
333 }
334 }
335 }
336 ]
337 }
338 },
339 "400": {
340 "description": "Bad Request",
341 "schema": {
342 "$ref": "#/definitions/models.Response"
343 }
344 }
345 }
346 }
347 },
235 "/profile": { 348 "/profile": {
236 "get": { 349 "get": {
237 "consumes": [ 350 "consumes": [
@@ -400,7 +513,7 @@
400 } 513 }
401 } 514 }
402 }, 515 },
403 "/user/{id}": { 516 "/users/{id}": {
404 "get": { 517 "get": {
405 "consumes": [ 518 "consumes": [
406 "application/json" 519 "application/json"
@@ -468,24 +581,70 @@
468 "models.Map": { 581 "models.Map": {
469 "type": "object", 582 "type": "object",
470 "properties": { 583 "properties": {
584 "chapter_name": {
585 "type": "string"
586 },
587 "data": {},
588 "game_name": {
589 "type": "string"
590 },
471 "id": { 591 "id": {
472 "type": "integer" 592 "type": "integer"
473 }, 593 },
474 "is_coop": { 594 "map_name": {
475 "type": "boolean"
476 },
477 "name": {
478 "type": "string" 595 "type": "string"
596 }
597 }
598 },
599 "models.MapCategoryScores": {
600 "type": "object",
601 "properties": {
602 "any": {
603 "type": "integer"
604 },
605 "cm": {
606 "type": "integer"
479 }, 607 },
480 "records": {}, 608 "inbounds_sla": {
481 "wr_score": {
482 "type": "integer" 609 "type": "integer"
483 }, 610 },
484 "wr_time": { 611 "no_sla": {
485 "type": "integer" 612 "type": "integer"
486 } 613 }
487 } 614 }
488 }, 615 },
616 "models.MapRecords": {
617 "type": "object",
618 "properties": {
619 "records": {}
620 }
621 },
622 "models.MapSummary": {
623 "type": "object",
624 "properties": {
625 "category_scores": {
626 "$ref": "#/definitions/models.MapCategoryScores"
627 },
628 "description": {
629 "type": "string"
630 },
631 "first_completion": {
632 "type": "string"
633 },
634 "rating": {
635 "type": "number"
636 },
637 "routers": {
638 "type": "array",
639 "items": {
640 "type": "string"
641 }
642 },
643 "showcase": {
644 "type": "string"
645 }
646 }
647 },
489 "models.ProfileResponse": { 648 "models.ProfileResponse": {
490 "type": "object", 649 "type": "object",
491 "properties": { 650 "properties": {
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 16e5eab..873dbee 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -7,17 +7,47 @@ definitions:
7 type: object 7 type: object
8 models.Map: 8 models.Map:
9 properties: 9 properties:
10 chapter_name:
11 type: string
12 data: {}
13 game_name:
14 type: string
10 id: 15 id:
11 type: integer 16 type: integer
12 is_coop: 17 map_name:
13 type: boolean
14 name:
15 type: string 18 type: string
16 records: {} 19 type: object
17 wr_score: 20 models.MapCategoryScores:
21 properties:
22 any:
23 type: integer
24 cm:
18 type: integer 25 type: integer
19 wr_time: 26 inbounds_sla:
20 type: integer 27 type: integer
28 no_sla:
29 type: integer
30 type: object
31 models.MapRecords:
32 properties:
33 records: {}
34 type: object
35 models.MapSummary:
36 properties:
37 category_scores:
38 $ref: '#/definitions/models.MapCategoryScores'
39 description:
40 type: string
41 first_completion:
42 type: string
43 rating:
44 type: number
45 routers:
46 items:
47 type: string
48 type: array
49 showcase:
50 type: string
21 type: object 51 type: object
22 models.ProfileResponse: 52 models.ProfileResponse:
23 properties: 53 properties:
@@ -104,6 +134,29 @@ paths:
104 get: 134 get:
105 consumes: 135 consumes:
106 - application/json 136 - application/json
137 produces:
138 - application/json
139 responses:
140 "200":
141 description: OK
142 schema:
143 allOf:
144 - $ref: '#/definitions/models.Response'
145 - properties:
146 data:
147 $ref: '#/definitions/models.RankingsResponse'
148 type: object
149 "400":
150 description: Bad Request
151 schema:
152 $ref: '#/definitions/models.Response'
153 summary: Get rankings of every player.
154 tags:
155 - rankings
156 /demos:
157 get:
158 consumes:
159 - application/json
107 parameters: 160 parameters:
108 - description: Demo UUID 161 - description: Demo UUID
109 in: query 162 in: query
@@ -147,7 +200,7 @@ paths:
147 summary: Get (redirect) login page for Steam auth. 200 summary: Get (redirect) login page for Steam auth.
148 tags: 201 tags:
149 - login 202 - login
150 /maps/{id}: 203 /maps/{id}/leaderboards:
151 get: 204 get:
152 consumes: 205 consumes:
153 - application/json 206 - application/json
@@ -167,13 +220,18 @@ paths:
167 - $ref: '#/definitions/models.Response' 220 - $ref: '#/definitions/models.Response'
168 - properties: 221 - properties:
169 data: 222 data:
170 $ref: '#/definitions/models.Map' 223 allOf:
224 - $ref: '#/definitions/models.Map'
225 - properties:
226 data:
227 $ref: '#/definitions/models.MapRecords'
228 type: object
171 type: object 229 type: object
172 "400": 230 "400":
173 description: Bad Request 231 description: Bad Request
174 schema: 232 schema:
175 $ref: '#/definitions/models.Response' 233 $ref: '#/definitions/models.Response'
176 summary: Get map page with specified id. 234 summary: Get map leaderboards with specified id.
177 tags: 235 tags:
178 - maps 236 - maps
179 /maps/{id}/record: 237 /maps/{id}/record:
@@ -236,6 +294,40 @@ paths:
236 summary: Post record with demo of a specific map. 294 summary: Post record with demo of a specific map.
237 tags: 295 tags:
238 - maps 296 - maps
297 /maps/{id}/summary:
298 get:
299 consumes:
300 - application/json
301 parameters:
302 - description: Map ID
303 in: path
304 name: id
305 required: true
306 type: integer
307 produces:
308 - application/json
309 responses:
310 "200":
311 description: OK
312 schema:
313 allOf:
314 - $ref: '#/definitions/models.Response'
315 - properties:
316 data:
317 allOf:
318 - $ref: '#/definitions/models.Map'
319 - properties:
320 data:
321 $ref: '#/definitions/models.MapSummary'
322 type: object
323 type: object
324 "400":
325 description: Bad Request
326 schema:
327 $ref: '#/definitions/models.Response'
328 summary: Get map summary with specified id.
329 tags:
330 - maps
239 /profile: 331 /profile:
240 get: 332 get:
241 consumes: 333 consumes:
@@ -338,7 +430,7 @@ paths:
338 summary: Update country code of session user. 430 summary: Update country code of session user.
339 tags: 431 tags:
340 - users 432 - users
341 /user/{id}: 433 /users/{id}:
342 get: 434 get:
343 consumes: 435 consumes:
344 - application/json 436 - application/json