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 13, 2024
1 parent 82c46bf commit ec968f3
Show file tree
Hide file tree
Showing 3 changed files with 491 additions and 237 deletions.
129 changes: 64 additions & 65 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ const docTemplate = `{
],
"summary": "Subscribe to an event",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "user_id",
"in": "header",
"required": true
},
{
"description": "Event Subscription Request",
"name": "request",
Expand Down Expand Up @@ -148,9 +141,14 @@ const docTemplate = `{
}
}
},
"/event/{id}": {
"get": {
"description": "Retrieves an event using its unique ID",
"/event/{event_id}": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Deletes a specific event by its ID for a given user",
"consumes": [
"application/json"
],
Expand All @@ -160,21 +158,28 @@ const docTemplate = `{
"tags": [
"Event"
],
"summary": "Get event by ID",
"summary": "Delete event",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "user_id",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Event ID",
"name": "id",
"name": "event_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Event successfully retrieved",
"description": "Event successfully deleted",
"schema": {
"$ref": "#/definitions/bikefest_pkg_model.EventResponse"
"$ref": "#/definitions/bikefest_pkg_model.Response"
}
},
"500": {
Expand All @@ -184,72 +189,52 @@ const docTemplate = `{
}
}
}
},
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Updates an event by ID with new details",
}
},
"/event/{id}": {
"get": {
"description": "Retrieves an event using its unique ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Events"
"Event"
],
"summary": "Update an event",
"summary": "Get event by ID",
"parameters": [
{
"type": "string",
"description": "Event ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Event Update Information",
"name": "event",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/bikefest_pkg_model.CreateEventRequest"
}
}
],
"responses": {
"200": {
"description": "Event successfully updated",
"description": "Event successfully retrieved",
"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"
}
}
}
}
},
"/events/{event_id}": {
"delete": {
},
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Deletes a specific event by its ID for a given user",
"description": "Updates an event by ID with new details",
"consumes": [
"application/json"
],
Expand All @@ -259,26 +244,34 @@ const docTemplate = `{
"tags": [
"Event"
],
"summary": "Delete event",
"summary": "Update an event",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "user_id",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Event ID",
"name": "event_id",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Event Update Information",
"name": "event",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/bikefest_pkg_model.CreateEventRequest"
}
}
],
"responses": {
"200": {
"description": "Event successfully deleted",
"description": "Event successfully updated",
"schema": {
"$ref": "#/definitions/bikefest_pkg_model.EventResponse"
}
},
"400": {
"description": "Bad Request - Invalid input",
"schema": {
"$ref": "#/definitions/bikefest_pkg_model.Response"
}
Expand Down Expand Up @@ -592,8 +585,7 @@ const docTemplate = `{
"bikefest_pkg_model.CreateEventRequest": {
"type": "object",
"required": [
"event_id",
"user_id"
"event_id"
],
"properties": {
"event_detail": {
Expand All @@ -607,9 +599,6 @@ const docTemplate = `{
},
"event_time_start": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
Expand All @@ -626,25 +615,28 @@ const docTemplate = `{
},
"bikefest_pkg_model.Event": {
"type": "object",
"required": [
"event_id"
],
"properties": {
"createdAt": {
"type": "string"
},
"deletedAt": {
"$ref": "#/definitions/gorm.DeletedAt"
},
"eventDetail": {
"event_detail": {
"description": "the ` + "`" + `EventDetail` + "`" + ` field store the event detail in json format, this would be parsed when send to line message API",
"type": "string"
},
"eventID": {
"event_id": {
"description": "the event id is defne at the frontend",
"type": "string"
},
"eventTimeEnd": {
"event_time_end": {
"type": "string"
},
"eventTimeStart": {
"event_time_start": {
"type": "string"
},
"id": {
Expand All @@ -653,7 +645,7 @@ const docTemplate = `{
"updatedAt": {
"type": "string"
},
"userID": {
"user_id": {
"type": "string"
}
}
Expand Down Expand Up @@ -789,6 +781,13 @@ const docTemplate = `{
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`

Expand Down
Loading

0 comments on commit ec968f3

Please sign in to comment.