From 4004ac9b925f6f9377533ce9ff349a5db681e7d4 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Thu, 20 Apr 2023 20:53:00 +0300 Subject: doc: add auth header fields (#34) --- backend/controllers/recordController.go | 1 + backend/controllers/userController.go | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'backend/controllers') 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 ( // @Summary Post record with demo of a specific map. // @Accept mpfd // @Produce json +// @Param Authorization header string true "JWT Token" // @Param demos formData []file true "Demos" // @Param score_count formData int true "Score Count" // @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 ( // @Summary Get profile page of session user. // @Accept json // @Produce json -// @Success 200 {object} models.Response{data=models.ProfileResponse} -// @Failure 400 {object} models.Response -// @Failure 401 {object} models.Response +// @Param Authorization header string true "JWT Token" +// @Success 200 {object} models.Response{data=models.ProfileResponse} +// @Failure 400 {object} models.Response +// @Failure 401 {object} models.Response // @Router /profile [get] func Profile(c *gin.Context) { // Check if user exists @@ -202,9 +203,10 @@ func FetchUser(c *gin.Context) { // @Summary Update profile page of session user. // @Accept json // @Produce json -// @Success 200 {object} models.Response{data=models.ProfileResponse} -// @Failure 400 {object} models.Response -// @Failure 401 {object} models.Response +// @Param Authorization header string true "JWT Token" +// @Success 200 {object} models.Response{data=models.ProfileResponse} +// @Failure 400 {object} models.Response +// @Failure 401 {object} models.Response // @Router /profile [post] func UpdateUser(c *gin.Context) { // Check if user exists @@ -243,6 +245,7 @@ func UpdateUser(c *gin.Context) { // @Summary Update country code of session user. // @Accept json // @Produce json +// @Param Authorization header string true "JWT Token" // @Param country_code query string true "Country Code [XX]" // @Success 200 {object} models.Response{data=models.ProfileResponse} // @Failure 400 {object} models.Response -- cgit v1.2.3