diff options
Diffstat (limited to 'docs/swagger.json')
| -rw-r--r-- | docs/swagger.json | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/docs/swagger.json b/docs/swagger.json index 3d038cb..03a2592 100644 --- a/docs/swagger.json +++ b/docs/swagger.json | |||
| @@ -13,6 +13,40 @@ | |||
| 13 | "host": "localhost:4000/api", | 13 | "host": "localhost:4000/api", |
| 14 | "basePath": "/v1", | 14 | "basePath": "/v1", |
| 15 | "paths": { | 15 | "paths": { |
| 16 | "/demo": { | ||
| 17 | "get": { | ||
| 18 | "consumes": [ | ||
| 19 | "application/json" | ||
| 20 | ], | ||
| 21 | "produces": [ | ||
| 22 | "application/octet-stream" | ||
| 23 | ], | ||
| 24 | "summary": "Get demo with specified demo uuid.", | ||
| 25 | "parameters": [ | ||
| 26 | { | ||
| 27 | "type": "integer", | ||
| 28 | "description": "Demo UUID", | ||
| 29 | "name": "uuid", | ||
| 30 | "in": "path", | ||
| 31 | "required": true | ||
| 32 | } | ||
| 33 | ], | ||
| 34 | "responses": { | ||
| 35 | "200": { | ||
| 36 | "description": "Demo File", | ||
| 37 | "schema": { | ||
| 38 | "type": "file" | ||
| 39 | } | ||
| 40 | }, | ||
| 41 | "400": { | ||
| 42 | "description": "Bad Request", | ||
| 43 | "schema": { | ||
| 44 | "$ref": "#/definitions/models.Response" | ||
| 45 | } | ||
| 46 | } | ||
| 47 | } | ||
| 48 | } | ||
| 49 | }, | ||
| 16 | "/login": { | 50 | "/login": { |
| 17 | "get": { | 51 | "get": { |
| 18 | "consumes": [ | 52 | "consumes": [ |
| @@ -50,6 +84,135 @@ | |||
| 50 | } | 84 | } |
| 51 | } | 85 | } |
| 52 | }, | 86 | }, |
| 87 | "/maps/{id}": { | ||
| 88 | "get": { | ||
| 89 | "consumes": [ | ||
| 90 | "application/json" | ||
| 91 | ], | ||
| 92 | "produces": [ | ||
| 93 | "application/json" | ||
| 94 | ], | ||
| 95 | "summary": "Get map page with specified id.", | ||
| 96 | "parameters": [ | ||
| 97 | { | ||
| 98 | "type": "integer", | ||
| 99 | "description": "Map ID", | ||
| 100 | "name": "id", | ||
| 101 | "in": "path", | ||
| 102 | "required": true | ||
| 103 | } | ||
| 104 | ], | ||
| 105 | "responses": { | ||
| 106 | "200": { | ||
| 107 | "description": "OK", | ||
| 108 | "schema": { | ||
| 109 | "allOf": [ | ||
| 110 | { | ||
| 111 | "$ref": "#/definitions/models.Response" | ||
| 112 | }, | ||
| 113 | { | ||
| 114 | "type": "object", | ||
| 115 | "properties": { | ||
| 116 | "data": { | ||
| 117 | "$ref": "#/definitions/models.Map" | ||
| 118 | } | ||
| 119 | } | ||
| 120 | } | ||
| 121 | ] | ||
| 122 | } | ||
| 123 | }, | ||
| 124 | "400": { | ||
| 125 | "description": "Bad Request", | ||
| 126 | "schema": { | ||
| 127 | "$ref": "#/definitions/models.Response" | ||
| 128 | } | ||
| 129 | } | ||
| 130 | } | ||
| 131 | } | ||
| 132 | }, | ||
| 133 | "/maps/{id}/record": { | ||
| 134 | "post": { | ||
| 135 | "consumes": [ | ||
| 136 | "multipart/form-data" | ||
| 137 | ], | ||
| 138 | "produces": [ | ||
| 139 | "application/json" | ||
| 140 | ], | ||
| 141 | "summary": "Post record with demo of a specific map.", | ||
| 142 | "parameters": [ | ||
| 143 | { | ||
| 144 | "type": "array", | ||
| 145 | "items": { | ||
| 146 | "type": "file" | ||
| 147 | }, | ||
| 148 | "description": "Demos", | ||
| 149 | "name": "demos", | ||
| 150 | "in": "formData", | ||
| 151 | "required": true | ||
| 152 | }, | ||
| 153 | { | ||
| 154 | "type": "integer", | ||
| 155 | "description": "Score Count", | ||
| 156 | "name": "score_count", | ||
| 157 | "in": "formData", | ||
| 158 | "required": true | ||
| 159 | }, | ||
| 160 | { | ||
| 161 | "type": "integer", | ||
| 162 | "description": "Score Time", | ||
| 163 | "name": "score_time", | ||
| 164 | "in": "formData", | ||
| 165 | "required": true | ||
| 166 | }, | ||
| 167 | { | ||
| 168 | "type": "boolean", | ||
| 169 | "description": "Is Partner Orange", | ||
| 170 | "name": "is_partner_orange", | ||
| 171 | "in": "formData", | ||
| 172 | "required": true | ||
| 173 | }, | ||
| 174 | { | ||
| 175 | "type": "string", | ||
| 176 | "description": "Partner ID", | ||
| 177 | "name": "partner_id", | ||
| 178 | "in": "formData", | ||
| 179 | "required": true | ||
| 180 | } | ||
| 181 | ], | ||
| 182 | "responses": { | ||
| 183 | "200": { | ||
| 184 | "description": "OK", | ||
| 185 | "schema": { | ||
| 186 | "allOf": [ | ||
| 187 | { | ||
| 188 | "$ref": "#/definitions/models.Response" | ||
| 189 | }, | ||
| 190 | { | ||
| 191 | "type": "object", | ||
| 192 | "properties": { | ||
| 193 | "data": { | ||
| 194 | "$ref": "#/definitions/models.RecordRequest" | ||
| 195 | } | ||
| 196 | } | ||
| 197 | } | ||
| 198 | ] | ||
| 199 | } | ||
| 200 | }, | ||
| 201 | "400": { | ||
| 202 | "description": "Bad Request", | ||
| 203 | "schema": { | ||
| 204 | "$ref": "#/definitions/models.Response" | ||
| 205 | } | ||
| 206 | }, | ||
| 207 | "401": { | ||
| 208 | "description": "Unauthorized", | ||
| 209 | "schema": { | ||
| 210 | "$ref": "#/definitions/models.Response" | ||
| 211 | } | ||
| 212 | } | ||
| 213 | } | ||
| 214 | } | ||
| 215 | }, | ||
| 53 | "/profile": { | 216 | "/profile": { |
| 54 | "get": { | 217 | "get": { |
| 55 | "consumes": [ | 218 | "consumes": [ |
| @@ -246,6 +409,27 @@ | |||
| 246 | } | 409 | } |
| 247 | } | 410 | } |
| 248 | }, | 411 | }, |
| 412 | "models.Map": { | ||
| 413 | "type": "object", | ||
| 414 | "properties": { | ||
| 415 | "id": { | ||
| 416 | "type": "integer" | ||
| 417 | }, | ||
| 418 | "is_coop": { | ||
| 419 | "type": "boolean" | ||
| 420 | }, | ||
| 421 | "name": { | ||
| 422 | "type": "string" | ||
| 423 | }, | ||
| 424 | "records": {}, | ||
| 425 | "wr_score": { | ||
| 426 | "type": "integer" | ||
| 427 | }, | ||
| 428 | "wr_time": { | ||
| 429 | "type": "integer" | ||
| 430 | } | ||
| 431 | } | ||
| 432 | }, | ||
| 249 | "models.ProfileResponse": { | 433 | "models.ProfileResponse": { |
| 250 | "type": "object", | 434 | "type": "object", |
| 251 | "properties": { | 435 | "properties": { |
| @@ -278,6 +462,29 @@ | |||
| 278 | } | 462 | } |
| 279 | } | 463 | } |
| 280 | }, | 464 | }, |
| 465 | "models.RecordRequest": { | ||
| 466 | "type": "object", | ||
| 467 | "required": [ | ||
| 468 | "is_partner_orange", | ||
| 469 | "partner_id", | ||
| 470 | "score_count", | ||
| 471 | "score_time" | ||
| 472 | ], | ||
| 473 | "properties": { | ||
| 474 | "is_partner_orange": { | ||
| 475 | "type": "boolean" | ||
| 476 | }, | ||
| 477 | "partner_id": { | ||
| 478 | "type": "string" | ||
| 479 | }, | ||
| 480 | "score_count": { | ||
| 481 | "type": "integer" | ||
| 482 | }, | ||
| 483 | "score_time": { | ||
| 484 | "type": "integer" | ||
| 485 | } | ||
| 486 | } | ||
| 487 | }, | ||
| 281 | "models.Response": { | 488 | "models.Response": { |
| 282 | "type": "object", | 489 | "type": "object", |
| 283 | "properties": { | 490 | "properties": { |