From 7d27b7bde11fa117f37ce18e0807ef299b69c700 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Thu, 29 Jun 2023 19:35:02 +0300 Subject: docs: updated for add/edit/delete map summary Former-commit-id: 0f2f20f84b5a52d747f18fba771bc88478f8c059 --- docs/docs.go | 96 +++++++++++++++++++++++++++++++++++++++++++++++++------ docs/swagger.json | 96 +++++++++++++++++++++++++++++++++++++++++++++++++------ docs/swagger.yaml | 66 +++++++++++++++++++++++++++++++++----- 3 files changed, 232 insertions(+), 26 deletions(-) (limited to 'docs') diff --git a/docs/docs.go b/docs/docs.go index 8318e14..40632e3 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -492,6 +492,59 @@ const docTemplate = `{ } } } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "maps" + ], + "summary": "Delete map summary with specified map id.", + "parameters": [ + { + "type": "integer", + "description": "Map ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.DeleteMapSummaryRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/models.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/models.DeleteMapSummaryRequest" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.Response" + } + } + } } }, "/profile": { @@ -874,24 +927,49 @@ const docTemplate = `{ } } }, - "models.EditMapSummaryRequest": { + "models.CreateMapSummaryRequest": { "type": "object", "required": [ - "image" + "category_id", + "description", + "record_date", + "score_count", + "showcase", + "user_name" ], "properties": { - "image": { + "category_id": { + "type": "integer" + }, + "description": { "type": "string" }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/models.EditMapSummaryRequestDetails" - } + "record_date": { + "type": "string" + }, + "score_count": { + "type": "integer" + }, + "showcase": { + "type": "string" + }, + "user_name": { + "type": "string" } } }, - "models.EditMapSummaryRequestDetails": { + "models.DeleteMapSummaryRequest": { + "type": "object", + "required": [ + "route_id" + ], + "properties": { + "route_id": { + "type": "integer" + } + } + }, + "models.EditMapSummaryRequest": { "type": "object", "required": [ "description", diff --git a/docs/swagger.json b/docs/swagger.json index 212ebee..7e251ca 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -485,6 +485,59 @@ } } } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "maps" + ], + "summary": "Delete map summary with specified map id.", + "parameters": [ + { + "type": "integer", + "description": "Map ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.DeleteMapSummaryRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/models.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/models.DeleteMapSummaryRequest" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.Response" + } + } + } } }, "/profile": { @@ -867,24 +920,49 @@ } } }, - "models.EditMapSummaryRequest": { + "models.CreateMapSummaryRequest": { "type": "object", "required": [ - "image" + "category_id", + "description", + "record_date", + "score_count", + "showcase", + "user_name" ], "properties": { - "image": { + "category_id": { + "type": "integer" + }, + "description": { "type": "string" }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/models.EditMapSummaryRequestDetails" - } + "record_date": { + "type": "string" + }, + "score_count": { + "type": "integer" + }, + "showcase": { + "type": "string" + }, + "user_name": { + "type": "string" } } }, - "models.EditMapSummaryRequestDetails": { + "models.DeleteMapSummaryRequest": { + "type": "object", + "required": [ + "route_id" + ], + "properties": { + "route_id": { + "type": "integer" + } + } + }, + "models.EditMapSummaryRequest": { "type": "object", "required": [ "description", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ba20f6d..5309f67 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -32,18 +32,36 @@ definitions: game: $ref: '#/definitions/models.Game' type: object - models.EditMapSummaryRequest: + models.CreateMapSummaryRequest: properties: - image: + category_id: + type: integer + description: type: string - routes: - items: - $ref: '#/definitions/models.EditMapSummaryRequestDetails' - type: array + record_date: + type: string + score_count: + type: integer + showcase: + type: string + user_name: + type: string + required: + - category_id + - description + - record_date + - score_count + - showcase + - user_name + type: object + models.DeleteMapSummaryRequest: + properties: + route_id: + type: integer required: - - image + - route_id type: object - models.EditMapSummaryRequestDetails: + models.EditMapSummaryRequest: properties: description: type: string @@ -474,6 +492,38 @@ paths: summary: Get map summary with specified id. tags: - maps + post: + parameters: + - description: Map ID + in: path + name: id + required: true + type: integer + - description: Body + in: body + name: request + required: true + schema: + $ref: '#/definitions/models.DeleteMapSummaryRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/models.Response' + - properties: + data: + $ref: '#/definitions/models.DeleteMapSummaryRequest' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.Response' + summary: Delete map summary with specified map id. + tags: + - maps put: parameters: - description: Map ID -- cgit v1.2.3