add delete

This commit is contained in:
2023-06-24 13:03:58 -04:00
parent a64fcfb096
commit 99182e5cda
6 changed files with 203 additions and 19 deletions

View File

@@ -66,7 +66,7 @@ const docTemplate = `{
"tags": [
"DadJoke"
],
"summary": "Generate dadjoke",
"summary": "Generate dadjokelocaloca",
"responses": {
"200": {
"description": "response",
@@ -74,7 +74,7 @@ const docTemplate = `{
"$ref": "#/definitions/model.Message"
}
},
"400": {
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
@@ -94,6 +94,15 @@ const docTemplate = `{
"DadJoke"
],
"summary": "Generate dadjoke",
"parameters": [
{
"type": "string",
"description": "Dad Joke you wish to enter into database",
"name": "joke",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "response",
@@ -101,7 +110,43 @@ const docTemplate = `{
"$ref": "#/definitions/model.Message"
}
},
"400": {
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
},
"delete": {
"description": "create a dad joke",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"DadJoke"
],
"summary": "Generate dadjoke",
"parameters": [
{
"type": "string",
"description": "Dad joke you wish to delete from the database",
"name": "joke",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/model.Message"
}
},
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"

View File

@@ -57,7 +57,7 @@
"tags": [
"DadJoke"
],
"summary": "Generate dadjoke",
"summary": "Generate dadjokelocaloca",
"responses": {
"200": {
"description": "response",
@@ -65,7 +65,7 @@
"$ref": "#/definitions/model.Message"
}
},
"400": {
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
@@ -85,6 +85,15 @@
"DadJoke"
],
"summary": "Generate dadjoke",
"parameters": [
{
"type": "string",
"description": "Dad Joke you wish to enter into database",
"name": "joke",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "response",
@@ -92,7 +101,43 @@
"$ref": "#/definitions/model.Message"
}
},
"400": {
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
},
"delete": {
"description": "create a dad joke",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"DadJoke"
],
"summary": "Generate dadjoke",
"parameters": [
{
"type": "string",
"description": "Dad joke you wish to delete from the database",
"name": "joke",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/model.Message"
}
},
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"

View File

@@ -79,6 +79,30 @@ paths:
tags:
- health
/jokes/dadjoke:
delete:
consumes:
- application/json
description: create a dad joke
parameters:
- description: Dad joke you wish to delete from the database
in: query
name: joke
required: true
type: string
produces:
- application/json
responses:
"200":
description: response
schema:
$ref: '#/definitions/model.Message'
"500":
description: error
schema:
$ref: '#/definitions/model.Message'
summary: Generate dadjoke
tags:
- DadJoke
get:
consumes:
- application/json
@@ -90,17 +114,23 @@ paths:
description: response
schema:
$ref: '#/definitions/model.Message'
"400":
"500":
description: error
schema:
$ref: '#/definitions/model.Message'
summary: Generate dadjoke
summary: Generate dadjokelocaloca
tags:
- DadJoke
post:
consumes:
- application/json
description: create a dad joke
parameters:
- description: Dad Joke you wish to enter into database
in: query
name: joke
required: true
type: string
produces:
- application/json
responses:
@@ -108,7 +138,7 @@ paths:
description: response
schema:
$ref: '#/definitions/model.Message'
"400":
"500":
description: error
schema:
$ref: '#/definitions/model.Message'