aboutsummaryrefslogtreecommitdiff
path: root/docs/docs.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-04-13 01:28:48 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-04-13 01:28:48 +0300
commit3e10a3542f70f23313fc6a43c41aaca518e3d344 (patch)
tree2bf813d90aa62336335141c1902b5eb7ec915550 /docs/docs.go
parentMerge pull request #32 from Nidboj132/main (diff)
downloadlphub-3e10a3542f70f23313fc6a43c41aaca518e3d344.tar.gz
lphub-3e10a3542f70f23313fc6a43c41aaca518e3d344.tar.bz2
lphub-3e10a3542f70f23313fc6a43c41aaca518e3d344.zip
doc: swagger init for login and user routes (#34)
Diffstat (limited to 'docs/docs.go')
-rw-r--r--docs/docs.go293
1 files changed, 290 insertions, 3 deletions
diff --git a/docs/docs.go b/docs/docs.go
index b05b0ad..caa64bf 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -19,14 +19,301 @@ const docTemplate = `{
19 }, 19 },
20 "host": "{{.Host}}", 20 "host": "{{.Host}}",
21 "basePath": "{{.BasePath}}", 21 "basePath": "{{.BasePath}}",
22 "paths": {} 22 "paths": {
23 "/login": {
24 "get": {
25 "consumes": [
26 "application/json"
27 ],
28 "produces": [
29 "application/json"
30 ],
31 "summary": "Get (redirect) login page for Steam auth.",
32 "responses": {
33 "200": {
34 "description": "OK",
35 "schema": {
36 "allOf": [
37 {
38 "$ref": "#/definitions/models.Response"
39 },
40 {
41 "type": "object",
42 "properties": {
43 "data": {
44 "$ref": "#/definitions/models.LoginResponse"
45 }
46 }
47 }
48 ]
49 }
50 },
51 "400": {
52 "description": "Bad Request",
53 "schema": {
54 "$ref": "#/definitions/models.Response"
55 }
56 }
57 }
58 }
59 },
60 "/profile": {
61 "get": {
62 "consumes": [
63 "application/json"
64 ],
65 "produces": [
66 "application/json"
67 ],
68 "summary": "Get profile page of session user.",
69 "responses": {
70 "200": {
71 "description": "OK",
72 "schema": {
73 "allOf": [
74 {
75 "$ref": "#/definitions/models.Response"
76 },
77 {
78 "type": "object",
79 "properties": {
80 "data": {
81 "$ref": "#/definitions/models.ProfileResponse"
82 }
83 }
84 }
85 ]
86 }
87 },
88 "400": {
89 "description": "Bad Request",
90 "schema": {
91 "$ref": "#/definitions/models.Response"
92 }
93 },
94 "401": {
95 "description": "Unauthorized",
96 "schema": {
97 "$ref": "#/definitions/models.Response"
98 }
99 }
100 }
101 },
102 "put": {
103 "consumes": [
104 "application/json"
105 ],
106 "produces": [
107 "application/json"
108 ],
109 "summary": "Update country code of session user.",
110 "parameters": [
111 {
112 "type": "string",
113 "description": "Country Code [XX]",
114 "name": "country_code",
115 "in": "query",
116 "required": true
117 }
118 ],
119 "responses": {
120 "200": {
121 "description": "OK",
122 "schema": {
123 "allOf": [
124 {
125 "$ref": "#/definitions/models.Response"
126 },
127 {
128 "type": "object",
129 "properties": {
130 "data": {
131 "$ref": "#/definitions/models.ProfileResponse"
132 }
133 }
134 }
135 ]
136 }
137 },
138 "400": {
139 "description": "Bad Request",
140 "schema": {
141 "$ref": "#/definitions/models.Response"
142 }
143 },
144 "401": {
145 "description": "Unauthorized",
146 "schema": {
147 "$ref": "#/definitions/models.Response"
148 }
149 }
150 }
151 },
152 "post": {
153 "consumes": [
154 "application/json"
155 ],
156 "produces": [
157 "application/json"
158 ],
159 "summary": "Update profile page of session user.",
160 "responses": {
161 "200": {
162 "description": "OK",
163 "schema": {
164 "allOf": [
165 {
166 "$ref": "#/definitions/models.Response"
167 },
168 {
169 "type": "object",
170 "properties": {
171 "data": {
172 "$ref": "#/definitions/models.ProfileResponse"
173 }
174 }
175 }
176 ]
177 }
178 },
179 "400": {
180 "description": "Bad Request",
181 "schema": {
182 "$ref": "#/definitions/models.Response"
183 }
184 },
185 "401": {
186 "description": "Unauthorized",
187 "schema": {
188 "$ref": "#/definitions/models.Response"
189 }
190 }
191 }
192 }
193 },
194 "/user/{id}": {
195 "get": {
196 "consumes": [
197 "application/json"
198 ],
199 "produces": [
200 "application/json"
201 ],
202 "summary": "Get profile page of another user.",
203 "parameters": [
204 {
205 "type": "integer",
206 "description": "User ID",
207 "name": "id",
208 "in": "path",
209 "required": true
210 }
211 ],
212 "responses": {
213 "200": {
214 "description": "OK",
215 "schema": {
216 "allOf": [
217 {
218 "$ref": "#/definitions/models.Response"
219 },
220 {
221 "type": "object",
222 "properties": {
223 "data": {
224 "$ref": "#/definitions/models.ProfileResponse"
225 }
226 }
227 }
228 ]
229 }
230 },
231 "400": {
232 "description": "Bad Request",
233 "schema": {
234 "$ref": "#/definitions/models.Response"
235 }
236 },
237 "404": {
238 "description": "Not Found",
239 "schema": {
240 "$ref": "#/definitions/models.Response"
241 }
242 }
243 }
244 }
245 }
246 },
247 "definitions": {
248 "models.LoginResponse": {
249 "type": "object",
250 "properties": {
251 "token": {
252 "type": "string"
253 }
254 }
255 },
256 "models.ProfileResponse": {
257 "type": "object",
258 "properties": {
259 "avatar_link": {
260 "type": "string"
261 },
262 "country_code": {
263 "type": "string"
264 },
265 "profile": {
266 "type": "boolean"
267 },
268 "scores_mp": {
269 "type": "array",
270 "items": {
271 "$ref": "#/definitions/models.ScoreResponse"
272 }
273 },
274 "scores_sp": {
275 "type": "array",
276 "items": {
277 "$ref": "#/definitions/models.ScoreResponse"
278 }
279 },
280 "steam_id": {
281 "type": "string"
282 },
283 "username": {
284 "type": "string"
285 }
286 }
287 },
288 "models.Response": {
289 "type": "object",
290 "properties": {
291 "data": {},
292 "message": {
293 "type": "string"
294 },
295 "success": {
296 "type": "boolean"
297 }
298 }
299 },
300 "models.ScoreResponse": {
301 "type": "object",
302 "properties": {
303 "map_id": {
304 "type": "integer"
305 },
306 "records": {}
307 }
308 }
309 }
23}` 310}`
24 311
25// SwaggerInfo holds exported Swagger Info so clients can modify it 312// SwaggerInfo holds exported Swagger Info so clients can modify it
26var SwaggerInfo = &swag.Spec{ 313var SwaggerInfo = &swag.Spec{
27 Version: "1.0", 314 Version: "1.0",
28 Host: "localhost:4000", 315 Host: "localhost:4000/api",
29 BasePath: "", 316 BasePath: "/v1",
30 Schemes: []string{}, 317 Schemes: []string{},
31 Title: "Least Portals Database API", 318 Title: "Least Portals Database API",
32 Description: "Backend API endpoints for Least Portals Database.", 319 Description: "Backend API endpoints for Least Portals Database.",