diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/docs.go | 207 | ||||
| -rw-r--r-- | docs/swagger.json | 207 | ||||
| -rw-r--r-- | docs/swagger.yaml | 132 |
3 files changed, 546 insertions, 0 deletions
diff --git a/docs/docs.go b/docs/docs.go index caa64bf..40bae17 100644 --- a/docs/docs.go +++ b/docs/docs.go | |||
| @@ -20,6 +20,40 @@ const docTemplate = `{ | |||
| 20 | "host": "{{.Host}}", | 20 | "host": "{{.Host}}", |
| 21 | "basePath": "{{.BasePath}}", | 21 | "basePath": "{{.BasePath}}", |
| 22 | "paths": { | 22 | "paths": { |
| 23 | "/demo": { | ||
| 24 | "get": { | ||
| 25 | "consumes": [ | ||
| 26 | "application/json" | ||
| 27 | ], | ||
| 28 | "produces": [ | ||
| 29 | "application/octet-stream" | ||
| 30 | ], | ||
| 31 | "summary": "Get demo with specified demo uuid.", | ||
| 32 | "parameters": [ | ||
| 33 | { | ||
| 34 | "type": "integer", | ||
| 35 | "description": "Demo UUID", | ||
| 36 | "name": "uuid", | ||
| 37 | "in": "path", | ||
| 38 | "required": true | ||
| 39 | } | ||
| 40 | ], | ||
| 41 | "responses": { | ||
| 42 | "200": { | ||
| 43 | "description": "Demo File", | ||
| 44 | "schema": { | ||
| 45 | "type": "file" | ||
| 46 | } | ||
| 47 | }, | ||
| 48 | "400": { | ||
| 49 | "description": "Bad Request", | ||
| 50 | "schema": { | ||
| 51 | "$ref": "#/definitions/models.Response" | ||
| 52 | } | ||
| 53 | } | ||
| 54 | } | ||
| 55 | } | ||
| 56 | }, | ||
| 23 | "/login": { | 57 | "/login": { |
| 24 | "get": { | 58 | "get": { |
| 25 | "consumes": [ | 59 | "consumes": [ |
| @@ -57,6 +91,135 @@ const docTemplate = `{ | |||
| 57 | } | 91 | } |
| 58 | } | 92 | } |
| 59 | }, | 93 | }, |
| 94 | "/maps/{id}": { | ||
| 95 | "get": { | ||
| 96 | "consumes": [ | ||
| 97 | "application/json" | ||
| 98 | ], | ||
| 99 | "produces": [ | ||
| 100 | "application/json" | ||
| 101 | ], | ||
| 102 | "summary": "Get map page with specified id.", | ||
| 103 | "parameters": [ | ||
| 104 | { | ||
| 105 | "type": "integer", | ||
| 106 | "description": "Map ID", | ||
| 107 | "name": "id", | ||
| 108 | "in": "path", | ||
| 109 | "required": true | ||
| 110 | } | ||
| 111 | ], | ||
| 112 | "responses": { | ||
| 113 | "200": { | ||
| 114 | "description": "OK", | ||
| 115 | "schema": { | ||
| 116 | "allOf": [ | ||
| 117 | { | ||
| 118 | "$ref": "#/definitions/models.Response" | ||
| 119 | }, | ||
| 120 | { | ||
| 121 | "type": "object", | ||
| 122 | "properties": { | ||
| 123 | "data": { | ||
| 124 | "$ref": "#/definitions/models.Map" | ||
| 125 | } | ||
| 126 | } | ||
| 127 | } | ||
| 128 | ] | ||
| 129 | } | ||
| 130 | }, | ||
| 131 | "400": { | ||
| 132 | "description": "Bad Request", | ||
| 133 | "schema": { | ||
| 134 | "$ref": "#/definitions/models.Response" | ||
| 135 | } | ||
| 136 | } | ||
| 137 | } | ||
| 138 | } | ||
| 139 | }, | ||
| 140 | "/maps/{id}/record": { | ||
| 141 | "post": { | ||
| 142 | "consumes": [ | ||
| 143 | "multipart/form-data" | ||
| 144 | ], | ||
| 145 | "produces": [ | ||
| 146 | "application/json" | ||
| 147 | ], | ||
| 148 | "summary": "Post record with demo of a specific map.", | ||
| 149 | "parameters": [ | ||
| 150 | { | ||
| 151 | "type": "array", | ||
| 152 | "items": { | ||
| 153 | "type": "file" | ||
| 154 | }, | ||
| 155 | "description": "Demos", | ||
| 156 | "name": "demos", | ||
| 157 | "in": "formData", | ||
| 158 | "required": true | ||
| 159 | }, | ||
| 160 | { | ||
| 161 | "type": "integer", | ||
| 162 | "description": "Score Count", | ||
| 163 | "name": "score_count", | ||
| 164 | "in": "formData", | ||
| 165 | "required": true | ||
| 166 | }, | ||
| 167 | { | ||
| 168 | "type": "integer", | ||
| 169 | "description": "Score Time", | ||
| 170 | "name": "score_time", | ||
| 171 | "in": "formData", | ||
| 172 | "required": true | ||
| 173 | }, | ||
| 174 | { | ||
| 175 | "type": "boolean", | ||
| 176 | "description": "Is Partner Orange", | ||
| 177 | "name": "is_partner_orange", | ||
| 178 | "in": "formData", | ||
| 179 | "required": true | ||
| 180 | }, | ||
| 181 | { | ||
| 182 | "type": "string", | ||
| 183 | "description": "Partner ID", | ||
| 184 | "name": "partner_id", | ||
| 185 | "in": "formData", | ||
| 186 | "required": true | ||
| 187 | } | ||
| 188 | ], | ||
| 189 | "responses": { | ||
| 190 | "200": { | ||
| 191 | "description": "OK", | ||
| 192 | "schema": { | ||
| 193 | "allOf": [ | ||
| 194 | { | ||
| 195 | "$ref": "#/definitions/models.Response" | ||
| 196 | }, | ||
| 197 | { | ||
| 198 | "type": "object", | ||
| 199 | "properties": { | ||
| 200 | "data": { | ||
| 201 | "$ref": "#/definitions/models.RecordRequest" | ||
| 202 | } | ||
| 203 | } | ||
| 204 | } | ||
| 205 | ] | ||
| 206 | } | ||
| 207 | }, | ||
| 208 | "400": { | ||
| 209 | "description": "Bad Request", | ||
| 210 | "schema": { | ||
| 211 | "$ref": "#/definitions/models.Response" | ||
| 212 | } | ||
| 213 | }, | ||
| 214 | "401": { | ||
| 215 | "description": "Unauthorized", | ||
| 216 | "schema": { | ||
| 217 | "$ref": "#/definitions/models.Response" | ||
| 218 | } | ||
| 219 | } | ||
| 220 | } | ||
| 221 | } | ||
| 222 | }, | ||
| 60 | "/profile": { | 223 | "/profile": { |
| 61 | "get": { | 224 | "get": { |
| 62 | "consumes": [ | 225 | "consumes": [ |
| @@ -253,6 +416,27 @@ const docTemplate = `{ | |||
| 253 | } | 416 | } |
| 254 | } | 417 | } |
| 255 | }, | 418 | }, |
| 419 | "models.Map": { | ||
| 420 | "type": "object", | ||
| 421 | "properties": { | ||
| 422 | "id": { | ||
| 423 | "type": "integer" | ||
| 424 | }, | ||
| 425 | "is_coop": { | ||
| 426 | "type": "boolean" | ||
| 427 | }, | ||
| 428 | "name": { | ||
| 429 | "type": "string" | ||
| 430 | }, | ||
| 431 | "records": {}, | ||
| 432 | "wr_score": { | ||
| 433 | "type": "integer" | ||
| 434 | }, | ||
| 435 | "wr_time": { | ||
| 436 | "type": "integer" | ||
| 437 | } | ||
| 438 | } | ||
| 439 | }, | ||
| 256 | "models.ProfileResponse": { | 440 | "models.ProfileResponse": { |
| 257 | "type": "object", | 441 | "type": "object", |
| 258 | "properties": { | 442 | "properties": { |
| @@ -285,6 +469,29 @@ const docTemplate = `{ | |||
| 285 | } | 469 | } |
| 286 | } | 470 | } |
| 287 | }, | 471 | }, |
| 472 | "models.RecordRequest": { | ||
| 473 | "type": "object", | ||
| 474 | "required": [ | ||
| 475 | "is_partner_orange", | ||
| 476 | "partner_id", | ||
| 477 | "score_count", | ||
| 478 | "score_time" | ||
| 479 | ], | ||
| 480 | "properties": { | ||
| 481 | "is_partner_orange": { | ||
| 482 | "type": "boolean" | ||
| 483 | }, | ||
| 484 | "partner_id": { | ||
| 485 | "type": "string" | ||
| 486 | }, | ||
| 487 | "score_count": { | ||
| 488 | "type": "integer" | ||
| 489 | }, | ||
| 490 | "score_time": { | ||
| 491 | "type": "integer" | ||
| 492 | } | ||
| 493 | } | ||
| 494 | }, | ||
| 288 | "models.Response": { | 495 | "models.Response": { |
| 289 | "type": "object", | 496 | "type": "object", |
| 290 | "properties": { | 497 | "properties": { |
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": { |
diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 81d4073..5300e1f 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml | |||
| @@ -5,6 +5,20 @@ definitions: | |||
| 5 | token: | 5 | token: |
| 6 | type: string | 6 | type: string |
| 7 | type: object | 7 | type: object |
| 8 | models.Map: | ||
| 9 | properties: | ||
| 10 | id: | ||
| 11 | type: integer | ||
| 12 | is_coop: | ||
| 13 | type: boolean | ||
| 14 | name: | ||
| 15 | type: string | ||
| 16 | records: {} | ||
| 17 | wr_score: | ||
| 18 | type: integer | ||
| 19 | wr_time: | ||
| 20 | type: integer | ||
| 21 | type: object | ||
| 8 | models.ProfileResponse: | 22 | models.ProfileResponse: |
| 9 | properties: | 23 | properties: |
| 10 | avatar_link: | 24 | avatar_link: |
| @@ -26,6 +40,22 @@ definitions: | |||
| 26 | username: | 40 | username: |
| 27 | type: string | 41 | type: string |
| 28 | type: object | 42 | type: object |
| 43 | models.RecordRequest: | ||
| 44 | properties: | ||
| 45 | is_partner_orange: | ||
| 46 | type: boolean | ||
| 47 | partner_id: | ||
| 48 | type: string | ||
| 49 | score_count: | ||
| 50 | type: integer | ||
| 51 | score_time: | ||
| 52 | type: integer | ||
| 53 | required: | ||
| 54 | - is_partner_orange | ||
| 55 | - partner_id | ||
| 56 | - score_count | ||
| 57 | - score_time | ||
| 58 | type: object | ||
| 29 | models.Response: | 59 | models.Response: |
| 30 | properties: | 60 | properties: |
| 31 | data: {} | 61 | data: {} |
| @@ -50,6 +80,28 @@ info: | |||
| 50 | title: Least Portals Database API | 80 | title: Least Portals Database API |
| 51 | version: "1.0" | 81 | version: "1.0" |
| 52 | paths: | 82 | paths: |
| 83 | /demo: | ||
| 84 | get: | ||
| 85 | consumes: | ||
| 86 | - application/json | ||
| 87 | parameters: | ||
| 88 | - description: Demo UUID | ||
| 89 | in: path | ||
| 90 | name: uuid | ||
| 91 | required: true | ||
| 92 | type: integer | ||
| 93 | produces: | ||
| 94 | - application/octet-stream | ||
| 95 | responses: | ||
| 96 | "200": | ||
| 97 | description: Demo File | ||
| 98 | schema: | ||
| 99 | type: file | ||
| 100 | "400": | ||
| 101 | description: Bad Request | ||
| 102 | schema: | ||
| 103 | $ref: '#/definitions/models.Response' | ||
| 104 | summary: Get demo with specified demo uuid. | ||
| 53 | /login: | 105 | /login: |
| 54 | get: | 106 | get: |
| 55 | consumes: | 107 | consumes: |
| @@ -71,6 +123,86 @@ paths: | |||
| 71 | schema: | 123 | schema: |
| 72 | $ref: '#/definitions/models.Response' | 124 | $ref: '#/definitions/models.Response' |
| 73 | summary: Get (redirect) login page for Steam auth. | 125 | summary: Get (redirect) login page for Steam auth. |
| 126 | /maps/{id}: | ||
| 127 | get: | ||
| 128 | consumes: | ||
| 129 | - application/json | ||
| 130 | parameters: | ||
| 131 | - description: Map ID | ||
| 132 | in: path | ||
| 133 | name: id | ||
| 134 | required: true | ||
| 135 | type: integer | ||
| 136 | produces: | ||
| 137 | - application/json | ||
| 138 | responses: | ||
| 139 | "200": | ||
| 140 | description: OK | ||
| 141 | schema: | ||
| 142 | allOf: | ||
| 143 | - $ref: '#/definitions/models.Response' | ||
| 144 | - properties: | ||
| 145 | data: | ||
| 146 | $ref: '#/definitions/models.Map' | ||
| 147 | type: object | ||
| 148 | "400": | ||
| 149 | description: Bad Request | ||
| 150 | schema: | ||
| 151 | $ref: '#/definitions/models.Response' | ||
| 152 | summary: Get map page with specified id. | ||
| 153 | /maps/{id}/record: | ||
| 154 | post: | ||
| 155 | consumes: | ||
| 156 | - multipart/form-data | ||
| 157 | parameters: | ||
| 158 | - description: Demos | ||
| 159 | in: formData | ||
| 160 | items: | ||
| 161 | type: file | ||
| 162 | name: demos | ||
| 163 | required: true | ||
| 164 | type: array | ||
| 165 | - description: Score Count | ||
| 166 | in: formData | ||
| 167 | name: score_count | ||
| 168 | required: true | ||
| 169 | type: integer | ||
| 170 | - description: Score Time | ||
| 171 | in: formData | ||
| 172 | name: score_time | ||
| 173 | required: true | ||
| 174 | type: integer | ||
| 175 | - description: Is Partner Orange | ||
| 176 | in: formData | ||
| 177 | name: is_partner_orange | ||
| 178 | required: true | ||
| 179 | type: boolean | ||
| 180 | - description: Partner ID | ||
| 181 | in: formData | ||
| 182 | name: partner_id | ||
| 183 | required: true | ||
| 184 | type: string | ||
| 185 | produces: | ||
| 186 | - application/json | ||
| 187 | responses: | ||
| 188 | "200": | ||
| 189 | description: OK | ||
| 190 | schema: | ||
| 191 | allOf: | ||
| 192 | - $ref: '#/definitions/models.Response' | ||
| 193 | - properties: | ||
| 194 | data: | ||
| 195 | $ref: '#/definitions/models.RecordRequest' | ||
| 196 | type: object | ||
| 197 | "400": | ||
| 198 | description: Bad Request | ||
| 199 | schema: | ||
| 200 | $ref: '#/definitions/models.Response' | ||
| 201 | "401": | ||
| 202 | description: Unauthorized | ||
| 203 | schema: | ||
| 204 | $ref: '#/definitions/models.Response' | ||
| 205 | summary: Post record with demo of a specific map. | ||
| 74 | /profile: | 206 | /profile: |
| 75 | get: | 207 | get: |
| 76 | consumes: | 208 | consumes: |