diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-04-20 20:53:00 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-04-21 23:57:47 +0300 |
| commit | 4004ac9b925f6f9377533ce9ff349a5db681e7d4 (patch) | |
| tree | 21aeaf9998fe098dbb0b999b5b1ea965fe957bb5 /backend | |
| parent | fix: empty country code on user creation (#36) (diff) | |
| download | lphub-4004ac9b925f6f9377533ce9ff349a5db681e7d4.tar.gz lphub-4004ac9b925f6f9377533ce9ff349a5db681e7d4.tar.bz2 lphub-4004ac9b925f6f9377533ce9ff349a5db681e7d4.zip | |
doc: add auth header fields (#34)
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/controllers/recordController.go | 1 | ||||
| -rw-r--r-- | backend/controllers/userController.go | 15 |
2 files changed, 10 insertions, 6 deletions
diff --git a/backend/controllers/recordController.go b/backend/controllers/recordController.go index 27f39fc..3e64e14 100644 --- a/backend/controllers/recordController.go +++ b/backend/controllers/recordController.go | |||
| @@ -23,6 +23,7 @@ import ( | |||
| 23 | // @Summary Post record with demo of a specific map. | 23 | // @Summary Post record with demo of a specific map. |
| 24 | // @Accept mpfd | 24 | // @Accept mpfd |
| 25 | // @Produce json | 25 | // @Produce json |
| 26 | // @Param Authorization header string true "JWT Token" | ||
| 26 | // @Param demos formData []file true "Demos" | 27 | // @Param demos formData []file true "Demos" |
| 27 | // @Param score_count formData int true "Score Count" | 28 | // @Param score_count formData int true "Score Count" |
| 28 | // @Param score_time formData int true "Score Time" | 29 | // @Param score_time formData int true "Score Time" |
diff --git a/backend/controllers/userController.go b/backend/controllers/userController.go index cb6c15d..51c18d5 100644 --- a/backend/controllers/userController.go +++ b/backend/controllers/userController.go | |||
| @@ -16,9 +16,10 @@ import ( | |||
| 16 | // @Summary Get profile page of session user. | 16 | // @Summary Get profile page of session user. |
| 17 | // @Accept json | 17 | // @Accept json |
| 18 | // @Produce json | 18 | // @Produce json |
| 19 | // @Success 200 {object} models.Response{data=models.ProfileResponse} | 19 | // @Param Authorization header string true "JWT Token" |
| 20 | // @Failure 400 {object} models.Response | 20 | // @Success 200 {object} models.Response{data=models.ProfileResponse} |
| 21 | // @Failure 401 {object} models.Response | 21 | // @Failure 400 {object} models.Response |
| 22 | // @Failure 401 {object} models.Response | ||
| 22 | // @Router /profile [get] | 23 | // @Router /profile [get] |
| 23 | func Profile(c *gin.Context) { | 24 | func Profile(c *gin.Context) { |
| 24 | // Check if user exists | 25 | // Check if user exists |
| @@ -202,9 +203,10 @@ func FetchUser(c *gin.Context) { | |||
| 202 | // @Summary Update profile page of session user. | 203 | // @Summary Update profile page of session user. |
| 203 | // @Accept json | 204 | // @Accept json |
| 204 | // @Produce json | 205 | // @Produce json |
| 205 | // @Success 200 {object} models.Response{data=models.ProfileResponse} | 206 | // @Param Authorization header string true "JWT Token" |
| 206 | // @Failure 400 {object} models.Response | 207 | // @Success 200 {object} models.Response{data=models.ProfileResponse} |
| 207 | // @Failure 401 {object} models.Response | 208 | // @Failure 400 {object} models.Response |
| 209 | // @Failure 401 {object} models.Response | ||
| 208 | // @Router /profile [post] | 210 | // @Router /profile [post] |
| 209 | func UpdateUser(c *gin.Context) { | 211 | func UpdateUser(c *gin.Context) { |
| 210 | // Check if user exists | 212 | // Check if user exists |
| @@ -243,6 +245,7 @@ func UpdateUser(c *gin.Context) { | |||
| 243 | // @Summary Update country code of session user. | 245 | // @Summary Update country code of session user. |
| 244 | // @Accept json | 246 | // @Accept json |
| 245 | // @Produce json | 247 | // @Produce json |
| 248 | // @Param Authorization header string true "JWT Token" | ||
| 246 | // @Param country_code query string true "Country Code [XX]" | 249 | // @Param country_code query string true "Country Code [XX]" |
| 247 | // @Success 200 {object} models.Response{data=models.ProfileResponse} | 250 | // @Success 200 {object} models.Response{data=models.ProfileResponse} |
| 248 | // @Failure 400 {object} models.Response | 251 | // @Failure 400 {object} models.Response |