From f04bb43856e72d3c0265bc7e2c38661fac268c7c Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Sun, 24 Sep 2023 12:41:36 +0300 Subject: docs: add delete record, update discussion and main (#56) Former-commit-id: 8abea862f066e06fc31df3d5ddd921334fe76f5c --- docs/docs.go | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- docs/swagger.json | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- docs/swagger.yaml | 37 ++++++++++++++++++++++++++++++------- 3 files changed, 118 insertions(+), 25 deletions(-) (limited to 'docs') diff --git a/docs/docs.go b/docs/docs.go index 9712377..5a107c1 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -344,13 +344,6 @@ const docTemplate = `{ "in": "path", "required": true }, - { - "type": "integer", - "description": "Discussion ID", - "name": "discussionid", - "in": "path", - "required": true - }, { "description": "Body", "name": "request", @@ -714,6 +707,48 @@ const docTemplate = `{ } } }, + "/maps/{mapid}/record/{recordid}": { + "delete": { + "description": "Delete record with specified map and record id.", + "produces": [ + "application/json" + ], + "tags": [ + "maps" + ], + "parameters": [ + { + "type": "integer", + "description": "Map ID", + "name": "mapid", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Record ID", + "name": "recordid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "JWT Token", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Response" + } + } + } + } + }, "/maps/{mapid}/summary": { "get": { "description": "Get map summary with specified id.", @@ -1937,8 +1972,8 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0", - Host: "lp.ardapektezol.com/api", - BasePath: "/v1", + Host: "lp.ardapektezol.com", + BasePath: "/api/v1", Schemes: []string{}, Title: "Least Portals Database API", Description: "Backend API endpoints for the Least Portals Database.", diff --git a/docs/swagger.json b/docs/swagger.json index 226cadd..d118ce7 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -10,8 +10,8 @@ }, "version": "1.0" }, - "host": "lp.ardapektezol.com/api", - "basePath": "/v1", + "host": "lp.ardapektezol.com", + "basePath": "/api/v1", "paths": { "/chapters/{chapterid}": { "get": { @@ -337,13 +337,6 @@ "in": "path", "required": true }, - { - "type": "integer", - "description": "Discussion ID", - "name": "discussionid", - "in": "path", - "required": true - }, { "description": "Body", "name": "request", @@ -707,6 +700,48 @@ } } }, + "/maps/{mapid}/record/{recordid}": { + "delete": { + "description": "Delete record with specified map and record id.", + "produces": [ + "application/json" + ], + "tags": [ + "maps" + ], + "parameters": [ + { + "type": "integer", + "description": "Map ID", + "name": "mapid", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Record ID", + "name": "recordid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "JWT Token", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Response" + } + } + } + } + }, "/maps/{mapid}/summary": { "get": { "description": "Get map summary with specified id.", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index b20f762..3e83fe8 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,4 +1,4 @@ -basePath: /v1 +basePath: /api/v1 definitions: handlers.ChapterMapsResponse: properties: @@ -462,7 +462,7 @@ definitions: user_name: type: string type: object -host: lp.ardapektezol.com/api +host: lp.ardapektezol.com info: contact: {} description: Backend API endpoints for the Least Portals Database. @@ -660,11 +660,6 @@ paths: name: mapid required: true type: integer - - description: Discussion ID - in: path - name: discussionid - required: true - type: integer - description: Body in: body name: request @@ -890,6 +885,34 @@ paths: type: object tags: - maps + /maps/{mapid}/record/{recordid}: + delete: + description: Delete record with specified map and record id. + parameters: + - description: Map ID + in: path + name: mapid + required: true + type: integer + - description: Record ID + in: path + name: recordid + required: true + type: integer + - description: JWT Token + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.Response' + tags: + - maps /maps/{mapid}/summary: delete: description: Delete map summary with specified map id. -- cgit v1.2.3