Skip to content
Snippets Groups Projects
Commit 0282b2d0 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

doc: added swagger doc about poll routes

parent 65572ad0
Branches
No related tags found
3 merge requests!14feat: addprices + subject managment,!11feat: Add partners issue info,!5Feat: Add backoffice
......@@ -50,6 +50,38 @@ var doc = `{
}
}
},
"put": {
"description": "Update a specific monthlyNews' content",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"monthlyNews"
],
"summary": "Update a specific monthlyNews' content",
"parameters": [
{
"description": "MonthlyNews to update with new content",
"name": "monthlyNews",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/monthlyNews.MonthlyNews"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/monthlyNews.MonthlyNews"
}
}
}
},
"post": {
"description": "Create a new monthlyNews",
"consumes": [
......@@ -145,7 +177,164 @@ var doc = `{
],
"responses": {
"204": {
"description": "Sucessful delete",
"description": "Successful delete",
"schema": {
"type": "string"
}
}
}
}
},
"/api/admin/poll": {
"get": {
"description": "Get details of all polls",
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "List all polls",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/poll.Poll"
}
}
}
}
},
"put": {
"description": "Update a specific poll' content",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "Update a specific poll' content",
"parameters": [
{
"description": "Poll to update with new content",
"name": "poll",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
}
},
"post": {
"description": "Create a new poll",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "Create a new poll",
"parameters": [
{
"description": "Poll to create",
"name": "poll",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
}
}
},
"/api/admin/poll/{year}/{month}": {
"get": {
"description": "Get details of a specific poll",
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "Get details of a specific poll",
"parameters": [
{
"type": "integer",
"description": "Year of the poll",
"name": "year",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Month of the poll",
"name": "month",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
}
},
"delete": {
"description": "Delete a specific poll",
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "Delete a specific poll",
"parameters": [
{
"type": "integer",
"description": "Year of the poll",
"name": "year",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Month of the poll",
"name": "month",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "Successful delete",
"schema": {
"type": "string"
}
......@@ -171,6 +360,23 @@ var doc = `{
"type": "integer"
}
}
},
"poll.Poll": {
"type": "object",
"properties": {
"link": {
"type": "string"
},
"month": {
"type": "integer"
},
"question": {
"type": "string"
},
"year": {
"type": "integer"
}
}
}
}
}`
......
......@@ -35,6 +35,38 @@
}
}
},
"put": {
"description": "Update a specific monthlyNews' content",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"monthlyNews"
],
"summary": "Update a specific monthlyNews' content",
"parameters": [
{
"description": "MonthlyNews to update with new content",
"name": "monthlyNews",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/monthlyNews.MonthlyNews"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/monthlyNews.MonthlyNews"
}
}
}
},
"post": {
"description": "Create a new monthlyNews",
"consumes": [
......@@ -130,7 +162,164 @@
],
"responses": {
"204": {
"description": "Sucessful delete",
"description": "Successful delete",
"schema": {
"type": "string"
}
}
}
}
},
"/api/admin/poll": {
"get": {
"description": "Get details of all polls",
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "List all polls",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/poll.Poll"
}
}
}
}
},
"put": {
"description": "Update a specific poll' content",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "Update a specific poll' content",
"parameters": [
{
"description": "Poll to update with new content",
"name": "poll",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
}
},
"post": {
"description": "Create a new poll",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "Create a new poll",
"parameters": [
{
"description": "Poll to create",
"name": "poll",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
}
}
},
"/api/admin/poll/{year}/{month}": {
"get": {
"description": "Get details of a specific poll",
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "Get details of a specific poll",
"parameters": [
{
"type": "integer",
"description": "Year of the poll",
"name": "year",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Month of the poll",
"name": "month",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/poll.Poll"
}
}
}
},
"delete": {
"description": "Delete a specific poll",
"produces": [
"application/json"
],
"tags": [
"poll"
],
"summary": "Delete a specific poll",
"parameters": [
{
"type": "integer",
"description": "Year of the poll",
"name": "year",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Month of the poll",
"name": "month",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "Successful delete",
"schema": {
"type": "string"
}
......@@ -156,6 +345,23 @@
"type": "integer"
}
}
},
"poll.Poll": {
"type": "object",
"properties": {
"link": {
"type": "string"
},
"month": {
"type": "integer"
},
"question": {
"type": "string"
},
"year": {
"type": "integer"
}
}
}
}
}
\ No newline at end of file
......@@ -11,6 +11,17 @@ definitions:
year:
type: integer
type: object
poll.Poll:
properties:
link:
type: string
month:
type: integer
question:
type: string
year:
type: integer
type: object
host: localhost:1443
info:
contact:
......@@ -57,6 +68,27 @@ paths:
summary: Create a new monthlyNews
tags:
- monthlyNews
put:
consumes:
- application/json
description: Update a specific monthlyNews' content
parameters:
- description: MonthlyNews to update with new content
in: body
name: monthlyNews
required: true
schema:
$ref: '#/definitions/monthlyNews.MonthlyNews'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/monthlyNews.MonthlyNews'
summary: Update a specific monthlyNews' content
tags:
- monthlyNews
/api/admin/monthlyNews/{year}/{month}:
delete:
description: Delete a specific monthlyNews
......@@ -75,7 +107,7 @@ paths:
- application/json
responses:
"204":
description: Sucessful delete
description: Successful delete
schema:
type: string
summary: Delete a specific monthlyNews
......@@ -104,4 +136,108 @@ paths:
summary: Get details of a specific monthlyNews
tags:
- monthlyNews
/api/admin/poll:
get:
description: Get details of all polls
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/poll.Poll'
type: array
summary: List all polls
tags:
- poll
post:
consumes:
- application/json
description: Create a new poll
parameters:
- description: Poll to create
in: body
name: poll
required: true
schema:
$ref: '#/definitions/poll.Poll'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/poll.Poll'
summary: Create a new poll
tags:
- poll
put:
consumes:
- application/json
description: Update a specific poll' content
parameters:
- description: Poll to update with new content
in: body
name: poll
required: true
schema:
$ref: '#/definitions/poll.Poll'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/poll.Poll'
summary: Update a specific poll' content
tags:
- poll
/api/admin/poll/{year}/{month}:
delete:
description: Delete a specific poll
parameters:
- description: Year of the poll
in: path
name: year
required: true
type: integer
- description: Month of the poll
in: path
name: month
required: true
type: integer
produces:
- application/json
responses:
"204":
description: Successful delete
schema:
type: string
summary: Delete a specific poll
tags:
- poll
get:
description: Get details of a specific poll
parameters:
- description: Year of the poll
in: path
name: year
required: true
type: integer
- description: Month of the poll
in: path
name: month
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/poll.Poll'
summary: Get details of a specific poll
tags:
- poll
swagger: "2.0"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment