Skip to content

Commit

Permalink
docs: update to latest swagger config
Browse files Browse the repository at this point in the history
  • Loading branch information
peterxcli committed Jan 31, 2024
1 parent 74e0d0d commit 25bce03
Show file tree
Hide file tree
Showing 3 changed files with 279 additions and 0 deletions.
105 changes: 105 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
Expand Down
105 changes: 105 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
Expand Down
69 changes: 69 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 25bce03

Please sign in to comment.