diff options
Diffstat (limited to 'docs/swagger.json')
| -rw-r--r-- | docs/swagger.json | 292 |
1 files changed, 290 insertions, 2 deletions
diff --git a/docs/swagger.json b/docs/swagger.json index 9c64dd0..3d038cb 100644 --- a/docs/swagger.json +++ b/docs/swagger.json | |||
| @@ -10,6 +10,294 @@ | |||
| 10 | }, | 10 | }, |
| 11 | "version": "1.0" | 11 | "version": "1.0" |
| 12 | }, | 12 | }, |
| 13 | "host": "localhost:4000", | 13 | "host": "localhost:4000/api", |
| 14 | "paths": {} | 14 | "basePath": "/v1", |
| 15 | "paths": { | ||
| 16 | "/login": { | ||
| 17 | "get": { | ||
| 18 | "consumes": [ | ||
| 19 | "application/json" | ||
| 20 | ], | ||
| 21 | "produces": [ | ||
| 22 | "application/json" | ||
| 23 | ], | ||
| 24 | "summary": "Get (redirect) login page for Steam auth.", | ||
| 25 | "responses": { | ||
| 26 | "200": { | ||
| 27 | "description": "OK", | ||
| 28 | "schema": { | ||
| 29 | "allOf": [ | ||
| 30 | { | ||
| 31 | "$ref": "#/definitions/models.Response" | ||
| 32 | }, | ||
| 33 | { | ||
| 34 | "type": "object", | ||
| 35 | "properties": { | ||
| 36 | "data": { | ||
| 37 | "$ref": "#/definitions/models.LoginResponse" | ||
| 38 | } | ||
| 39 | } | ||
| 40 | } | ||
| 41 | ] | ||
| 42 | } | ||
| 43 | }, | ||
| 44 | "400": { | ||
| 45 | "description": "Bad Request", | ||
| 46 | "schema": { | ||
| 47 | "$ref": "#/definitions/models.Response" | ||
| 48 | } | ||
| 49 | } | ||
| 50 | } | ||
| 51 | } | ||
| 52 | }, | ||
| 53 | "/profile": { | ||
| 54 | "get": { | ||
| 55 | "consumes": [ | ||
| 56 | "application/json" | ||
| 57 | ], | ||
| 58 | "produces": [ | ||
| 59 | "application/json" | ||
| 60 | ], | ||
| 61 | "summary": "Get profile page of session user.", | ||
| 62 | "responses": { | ||
| 63 | "200": { | ||
| 64 | "description": "OK", | ||
| 65 | "schema": { | ||
| 66 | "allOf": [ | ||
| 67 | { | ||
| 68 | "$ref": "#/definitions/models.Response" | ||
| 69 | }, | ||
| 70 | { | ||
| 71 | "type": "object", | ||
| 72 | "properties": { | ||
| 73 | "data": { | ||
| 74 | "$ref": "#/definitions/models.ProfileResponse" | ||
| 75 | } | ||
| 76 | } | ||
| 77 | } | ||
| 78 | ] | ||
| 79 | } | ||
| 80 | }, | ||
| 81 | "400": { | ||
| 82 | "description": "Bad Request", | ||
| 83 | "schema": { | ||
| 84 | "$ref": "#/definitions/models.Response" | ||
| 85 | } | ||
| 86 | }, | ||
| 87 | "401": { | ||
| 88 | "description": "Unauthorized", | ||
| 89 | "schema": { | ||
| 90 | "$ref": "#/definitions/models.Response" | ||
| 91 | } | ||
| 92 | } | ||
| 93 | } | ||
| 94 | }, | ||
| 95 | "put": { | ||
| 96 | "consumes": [ | ||
| 97 | "application/json" | ||
| 98 | ], | ||
| 99 | "produces": [ | ||
| 100 | "application/json" | ||
| 101 | ], | ||
| 102 | "summary": "Update country code of session user.", | ||
| 103 | "parameters": [ | ||
| 104 | { | ||
| 105 | "type": "string", | ||
| 106 | "description": "Country Code [XX]", | ||
| 107 | "name": "country_code", | ||
| 108 | "in": "query", | ||
| 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.ProfileResponse" | ||
| 125 | } | ||
| 126 | } | ||
| 127 | } | ||
| 128 | ] | ||
| 129 | } | ||
| 130 | }, | ||
| 131 | "400": { | ||
| 132 | "description": "Bad Request", | ||
| 133 | "schema": { | ||
| 134 | "$ref": "#/definitions/models.Response" | ||
| 135 | } | ||
| 136 | }, | ||
| 137 | "401": { | ||
| 138 | "description": "Unauthorized", | ||
| 139 | "schema": { | ||
| 140 | "$ref": "#/definitions/models.Response" | ||
| 141 | } | ||
| 142 | } | ||
| 143 | } | ||
| 144 | }, | ||
| 145 | "post": { | ||
| 146 | "consumes": [ | ||
| 147 | "application/json" | ||
| 148 | ], | ||
| 149 | "produces": [ | ||
| 150 | "application/json" | ||
| 151 | ], | ||
| 152 | "summary": "Update profile page of session user.", | ||
| 153 | "responses": { | ||
| 154 | "200": { | ||
| 155 | "description": "OK", | ||
| 156 | "schema": { | ||
| 157 | "allOf": [ | ||
| 158 | { | ||
| 159 | "$ref": "#/definitions/models.Response" | ||
| 160 | }, | ||
| 161 | { | ||
| 162 | "type": "object", | ||
| 163 | "properties": { | ||
| 164 | "data": { | ||
| 165 | "$ref": "#/definitions/models.ProfileResponse" | ||
| 166 | } | ||
| 167 | } | ||
| 168 | } | ||
| 169 | ] | ||
| 170 | } | ||
| 171 | }, | ||
| 172 | "400": { | ||
| 173 | "description": "Bad Request", | ||
| 174 | "schema": { | ||
| 175 | "$ref": "#/definitions/models.Response" | ||
| 176 | } | ||
| 177 | }, | ||
| 178 | "401": { | ||
| 179 | "description": "Unauthorized", | ||
| 180 | "schema": { | ||
| 181 | "$ref": "#/definitions/models.Response" | ||
| 182 | } | ||
| 183 | } | ||
| 184 | } | ||
| 185 | } | ||
| 186 | }, | ||
| 187 | "/user/{id}": { | ||
| 188 | "get": { | ||
| 189 | "consumes": [ | ||
| 190 | "application/json" | ||
| 191 | ], | ||
| 192 | "produces": [ | ||
| 193 | "application/json" | ||
| 194 | ], | ||
| 195 | "summary": "Get profile page of another user.", | ||
| 196 | "parameters": [ | ||
| 197 | { | ||
| 198 | "type": "integer", | ||
| 199 | "description": "User ID", | ||
| 200 | "name": "id", | ||
| 201 | "in": "path", | ||
| 202 | "required": true | ||
| 203 | } | ||
| 204 | ], | ||
| 205 | "responses": { | ||
| 206 | "200": { | ||
| 207 | "description": "OK", | ||
| 208 | "schema": { | ||
| 209 | "allOf": [ | ||
| 210 | { | ||
| 211 | "$ref": "#/definitions/models.Response" | ||
| 212 | }, | ||
| 213 | { | ||
| 214 | "type": "object", | ||
| 215 | "properties": { | ||
| 216 | "data": { | ||
| 217 | "$ref": "#/definitions/models.ProfileResponse" | ||
| 218 | } | ||
| 219 | } | ||
| 220 | } | ||
| 221 | ] | ||
| 222 | } | ||
| 223 | }, | ||
| 224 | "400": { | ||
| 225 | "description": "Bad Request", | ||
| 226 | "schema": { | ||
| 227 | "$ref": "#/definitions/models.Response" | ||
| 228 | } | ||
| 229 | }, | ||
| 230 | "404": { | ||
| 231 | "description": "Not Found", | ||
| 232 | "schema": { | ||
| 233 | "$ref": "#/definitions/models.Response" | ||
| 234 | } | ||
| 235 | } | ||
| 236 | } | ||
| 237 | } | ||
| 238 | } | ||
| 239 | }, | ||
| 240 | "definitions": { | ||
| 241 | "models.LoginResponse": { | ||
| 242 | "type": "object", | ||
| 243 | "properties": { | ||
| 244 | "token": { | ||
| 245 | "type": "string" | ||
| 246 | } | ||
| 247 | } | ||
| 248 | }, | ||
| 249 | "models.ProfileResponse": { | ||
| 250 | "type": "object", | ||
| 251 | "properties": { | ||
| 252 | "avatar_link": { | ||
| 253 | "type": "string" | ||
| 254 | }, | ||
| 255 | "country_code": { | ||
| 256 | "type": "string" | ||
| 257 | }, | ||
| 258 | "profile": { | ||
| 259 | "type": "boolean" | ||
| 260 | }, | ||
| 261 | "scores_mp": { | ||
| 262 | "type": "array", | ||
| 263 | "items": { | ||
| 264 | "$ref": "#/definitions/models.ScoreResponse" | ||
| 265 | } | ||
| 266 | }, | ||
| 267 | "scores_sp": { | ||
| 268 | "type": "array", | ||
| 269 | "items": { | ||
| 270 | "$ref": "#/definitions/models.ScoreResponse" | ||
| 271 | } | ||
| 272 | }, | ||
| 273 | "steam_id": { | ||
| 274 | "type": "string" | ||
| 275 | }, | ||
| 276 | "username": { | ||
| 277 | "type": "string" | ||
| 278 | } | ||
| 279 | } | ||
| 280 | }, | ||
| 281 | "models.Response": { | ||
| 282 | "type": "object", | ||
| 283 | "properties": { | ||
| 284 | "data": {}, | ||
| 285 | "message": { | ||
| 286 | "type": "string" | ||
| 287 | }, | ||
| 288 | "success": { | ||
| 289 | "type": "boolean" | ||
| 290 | } | ||
| 291 | } | ||
| 292 | }, | ||
| 293 | "models.ScoreResponse": { | ||
| 294 | "type": "object", | ||
| 295 | "properties": { | ||
| 296 | "map_id": { | ||
| 297 | "type": "integer" | ||
| 298 | }, | ||
| 299 | "records": {} | ||
| 300 | } | ||
| 301 | } | ||
| 302 | } | ||
| 15 | } \ No newline at end of file | 303 | } \ No newline at end of file |