From 568e77f6d9c5d5a34879901f12ee189ade218c7d Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 21 Apr 2023 12:38:59 +0300 Subject: doc: added tags --- backend/controllers/homeController.go | 1 + backend/controllers/loginController.go | 1 + backend/controllers/mapController.go | 1 + backend/controllers/recordController.go | 2 ++ backend/controllers/userController.go | 4 ++++ docs/docs.go | 24 ++++++++++++++++++++++++ docs/swagger.json | 24 ++++++++++++++++++++++++ docs/swagger.yaml | 16 ++++++++++++++++ 8 files changed, 73 insertions(+) diff --git a/backend/controllers/homeController.go b/backend/controllers/homeController.go index b6ab644..539d2c4 100644 --- a/backend/controllers/homeController.go +++ b/backend/controllers/homeController.go @@ -22,6 +22,7 @@ func Home(c *gin.Context) { // GET Rankings // // @Summary Get rankings of every player. +// @Tags rankings // @Accept json // @Produce json // @Success 200 {object} models.Response{data=models.RankingsResponse} diff --git a/backend/controllers/loginController.go b/backend/controllers/loginController.go index 3e59211..6c0453b 100644 --- a/backend/controllers/loginController.go +++ b/backend/controllers/loginController.go @@ -18,6 +18,7 @@ import ( // Login // // @Summary Get (redirect) login page for Steam auth. +// @Tags login // @Accept json // @Produce json // @Success 200 {object} models.Response{data=models.LoginResponse} diff --git a/backend/controllers/mapController.go b/backend/controllers/mapController.go index 1560441..16dd669 100644 --- a/backend/controllers/mapController.go +++ b/backend/controllers/mapController.go @@ -12,6 +12,7 @@ import ( // GET Map // // @Summary Get map page with specified id. +// @Tags maps // @Accept json // @Produce json // @Param id path int true "Map ID" diff --git a/backend/controllers/recordController.go b/backend/controllers/recordController.go index 3e64e14..3b4bdc7 100644 --- a/backend/controllers/recordController.go +++ b/backend/controllers/recordController.go @@ -21,6 +21,7 @@ import ( // POST Record // // @Summary Post record with demo of a specific map. +// @Tags maps // @Accept mpfd // @Produce json // @Param Authorization header string true "JWT Token" @@ -194,6 +195,7 @@ func CreateRecordWithDemo(c *gin.Context) { // GET Demo // // @Summary Get demo with specified demo uuid. +// @Tags demo // @Accept json // @Produce octet-stream // @Param uuid path int true "Demo UUID" diff --git a/backend/controllers/userController.go b/backend/controllers/userController.go index 51c18d5..c86a739 100644 --- a/backend/controllers/userController.go +++ b/backend/controllers/userController.go @@ -14,6 +14,7 @@ import ( // GET Profile // // @Summary Get profile page of session user. +// @Tags users // @Accept json // @Produce json // @Param Authorization header string true "JWT Token" @@ -100,6 +101,7 @@ func Profile(c *gin.Context) { // GET User // // @Summary Get profile page of another user. +// @Tags users // @Accept json // @Produce json // @Param id path int true "User ID" @@ -201,6 +203,7 @@ func FetchUser(c *gin.Context) { // PUT Profile // // @Summary Update profile page of session user. +// @Tags users // @Accept json // @Produce json // @Param Authorization header string true "JWT Token" @@ -243,6 +246,7 @@ func UpdateUser(c *gin.Context) { // PUT Profile/CountryCode // // @Summary Update country code of session user. +// @Tags users // @Accept json // @Produce json // @Param Authorization header string true "JWT Token" diff --git a/docs/docs.go b/docs/docs.go index 5cf5e50..f37cda2 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -28,6 +28,9 @@ const docTemplate = `{ "produces": [ "application/octet-stream" ], + "tags": [ + "demo" + ], "summary": "Get demo with specified demo uuid.", "parameters": [ { @@ -62,6 +65,9 @@ const docTemplate = `{ "produces": [ "application/json" ], + "tags": [ + "login" + ], "summary": "Get (redirect) login page for Steam auth.", "responses": { "200": { @@ -99,6 +105,9 @@ const docTemplate = `{ "produces": [ "application/json" ], + "tags": [ + "maps" + ], "summary": "Get map page with specified id.", "parameters": [ { @@ -145,6 +154,9 @@ const docTemplate = `{ "produces": [ "application/json" ], + "tags": [ + "maps" + ], "summary": "Post record with demo of a specific map.", "parameters": [ { @@ -235,6 +247,9 @@ const docTemplate = `{ "produces": [ "application/json" ], + "tags": [ + "users" + ], "summary": "Get profile page of session user.", "parameters": [ { @@ -285,6 +300,9 @@ const docTemplate = `{ "produces": [ "application/json" ], + "tags": [ + "users" + ], "summary": "Update country code of session user.", "parameters": [ { @@ -342,6 +360,9 @@ const docTemplate = `{ "produces": [ "application/json" ], + "tags": [ + "users" + ], "summary": "Update profile page of session user.", "parameters": [ { @@ -394,6 +415,9 @@ const docTemplate = `{ "produces": [ "application/json" ], + "tags": [ + "users" + ], "summary": "Get profile page of another user.", "parameters": [ { diff --git a/docs/swagger.json b/docs/swagger.json index 82fb64c..9ed27d5 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -21,6 +21,9 @@ "produces": [ "application/octet-stream" ], + "tags": [ + "demo" + ], "summary": "Get demo with specified demo uuid.", "parameters": [ { @@ -55,6 +58,9 @@ "produces": [ "application/json" ], + "tags": [ + "login" + ], "summary": "Get (redirect) login page for Steam auth.", "responses": { "200": { @@ -92,6 +98,9 @@ "produces": [ "application/json" ], + "tags": [ + "maps" + ], "summary": "Get map page with specified id.", "parameters": [ { @@ -138,6 +147,9 @@ "produces": [ "application/json" ], + "tags": [ + "maps" + ], "summary": "Post record with demo of a specific map.", "parameters": [ { @@ -228,6 +240,9 @@ "produces": [ "application/json" ], + "tags": [ + "users" + ], "summary": "Get profile page of session user.", "parameters": [ { @@ -278,6 +293,9 @@ "produces": [ "application/json" ], + "tags": [ + "users" + ], "summary": "Update country code of session user.", "parameters": [ { @@ -335,6 +353,9 @@ "produces": [ "application/json" ], + "tags": [ + "users" + ], "summary": "Update profile page of session user.", "parameters": [ { @@ -387,6 +408,9 @@ "produces": [ "application/json" ], + "tags": [ + "users" + ], "summary": "Get profile page of another user.", "parameters": [ { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 76b4e7b..c134197 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -122,6 +122,8 @@ paths: schema: $ref: '#/definitions/models.Response' summary: Get demo with specified demo uuid. + tags: + - demo /login: get: consumes: @@ -143,6 +145,8 @@ paths: schema: $ref: '#/definitions/models.Response' summary: Get (redirect) login page for Steam auth. + tags: + - login /maps/{id}: get: consumes: @@ -170,6 +174,8 @@ paths: schema: $ref: '#/definitions/models.Response' summary: Get map page with specified id. + tags: + - maps /maps/{id}/record: post: consumes: @@ -228,6 +234,8 @@ paths: schema: $ref: '#/definitions/models.Response' summary: Post record with demo of a specific map. + tags: + - maps /profile: get: consumes: @@ -259,6 +267,8 @@ paths: schema: $ref: '#/definitions/models.Response' summary: Get profile page of session user. + tags: + - users post: consumes: - application/json @@ -289,6 +299,8 @@ paths: schema: $ref: '#/definitions/models.Response' summary: Update profile page of session user. + tags: + - users put: consumes: - application/json @@ -324,6 +336,8 @@ paths: schema: $ref: '#/definitions/models.Response' summary: Update country code of session user. + tags: + - users /user/{id}: get: consumes: @@ -355,4 +369,6 @@ paths: schema: $ref: '#/definitions/models.Response' summary: Get profile page of another user. + tags: + - users swagger: "2.0" -- cgit v1.2.3