From 25bce03223b45729067df3c1814f67bd8420bd5e Mon Sep 17 00:00:00 2001 From: peterxcli Date: Wed, 31 Jan 2024 22:07:21 +0800 Subject: [PATCH] docs: update to latest swagger config --- docs/docs.go | 105 ++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.json | 105 ++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.yaml | 69 ++++++++++++++++++++++++++++++ 3 files changed, 279 insertions(+) diff --git a/docs/docs.go b/docs/docs.go index d076a34..238c190 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -58,7 +58,64 @@ const docTemplate = `{ } } }, + "/events/test-store-all": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Event" + ], + "summary": "Store all events from the json file in the frontend repo", + "responses": {} + } + }, "/events/{id}": { + "get": { + "description": "Retrieves an event by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Event" + ], + "summary": "Get an event by ID", + "parameters": [ + { + "type": "string", + "description": "Event ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.EventResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.Response" + } + } + } + }, "put": { "security": [ { @@ -310,6 +367,54 @@ const docTemplate = `{ } } }, + "/users/events/all": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Subscribes a user to all events", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Subscribe to all events, and if remind is true, it will send all the event notification to user immediately", + "parameters": [ + { + "type": "boolean", + "description": "Send the Line notification immediately", + "name": "remind", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully subscribed to the event", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.EventResponse" + } + }, + "400": { + "description": "Bad Request - Invalid input", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.Response" + } + } + } + } + }, "/users/events/{event_id}": { "delete": { "security": [ diff --git a/docs/swagger.json b/docs/swagger.json index f7a1452..e414f38 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -47,7 +47,64 @@ } } }, + "/events/test-store-all": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Event" + ], + "summary": "Store all events from the json file in the frontend repo", + "responses": {} + } + }, "/events/{id}": { + "get": { + "description": "Retrieves an event by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Event" + ], + "summary": "Get an event by ID", + "parameters": [ + { + "type": "string", + "description": "Event ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.EventResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.Response" + } + } + } + }, "put": { "security": [ { @@ -299,6 +356,54 @@ } } }, + "/users/events/all": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Subscribes a user to all events", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Subscribe to all events, and if remind is true, it will send all the event notification to user immediately", + "parameters": [ + { + "type": "boolean", + "description": "Send the Line notification immediately", + "name": "remind", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully subscribed to the event", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.EventResponse" + } + }, + "400": { + "description": "Bad Request - Invalid input", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/bikefest_pkg_model.Response" + } + } + } + } + }, "/users/events/{event_id}": { "delete": { "security": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f95ce76..e8a7b6c 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -153,6 +153,34 @@ paths: tags: - Event /events/{id}: + get: + consumes: + - application/json + description: Retrieves an event by ID + parameters: + - description: Event ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/bikefest_pkg_model.EventResponse' + "404": + description: Not Found + schema: + $ref: '#/definitions/bikefest_pkg_model.Response' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/bikefest_pkg_model.Response' + summary: Get an event by ID + tags: + - Event put: consumes: - application/json @@ -189,6 +217,16 @@ paths: summary: Update an event tags: - Event + /events/test-store-all: + get: + consumes: + - application/json + produces: + - application/json + responses: {} + summary: Store all events from the json file in the frontend repo + tags: + - Event /line-login/auth: get: consumes: @@ -367,6 +405,37 @@ paths: summary: Delete event tags: - User + /users/events/all: + post: + consumes: + - application/json + description: Subscribes a user to all events + parameters: + - description: Send the Line notification immediately + in: query + name: remind + type: boolean + produces: + - application/json + responses: + "200": + description: Successfully subscribed to the event + schema: + $ref: '#/definitions/bikefest_pkg_model.EventResponse' + "400": + description: Bad Request - Invalid input + schema: + $ref: '#/definitions/bikefest_pkg_model.Response' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/bikefest_pkg_model.Response' + security: + - ApiKeyAuth: [] + summary: Subscribe to all events, and if remind is true, it will send all the + event notification to user immediately + tags: + - User /users/login/{user_id}: get: consumes: