Skip to content

Commit

Permalink
Merge branch 'main' into haley-crud-tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
MattCMcCoy committed Feb 21, 2024
2 parents d58ccd9 + 4c2985b commit 4ec0e1a
Show file tree
Hide file tree
Showing 5 changed files with 353 additions and 69 deletions.
121 changes: 121 additions & 0 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,34 @@ const docTemplate = `{
}
}
},
"/tasks": {
"post": {
"description": "Create a new task",
"tags": [
"tasks"
],
"summary": "Create a New Task",
"parameters": [
{
"description": "Create Task Request",
"name": "request_body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Task"
}
}
],
"responses": {
"201": {
"description": "Created Task",
"schema": {
"$ref": "#/definitions/models.Task"
}
}
}
}
},
"/tasks/assigned": {
"get": {
"description": "get tasks assigned to given users",
Expand Down Expand Up @@ -532,6 +560,29 @@ const docTemplate = `{
}
}
},
"/tasks/{tid}": {
"delete": {
"description": "Delete a task by ID",
"tags": [
"tasks"
],
"summary": "Delete a Task",
"parameters": [
{
"type": "integer",
"description": "Task ID",
"name": "tid",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/tasks/{tid}/assign": {
"post": {
"description": "assign users to task",
Expand Down Expand Up @@ -576,6 +627,76 @@ const docTemplate = `{
}
}
},
"/tasks/{tid}/assigned-users": {
"get": {
"description": "Get list of users assigned to a task by task ID",
"tags": [
"tasks"
],
"summary": "Get list of users assigned to a task",
"parameters": [
{
"type": "integer",
"description": "Task ID",
"name": "tid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "List of user IDs assigned to the task",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/tasks/{tid}/info": {
"put": {
"description": "Update the task_info field of a task by ID",
"tags": [
"tasks"
],
"summary": "Update Task Info",
"parameters": [
{
"type": "integer",
"description": "Task ID",
"name": "tid",
"in": "path",
"required": true
},
{
"description": "Update Task Info Request",
"name": "request_body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Task"
}
}
],
"responses": {
"200": {
"description": "Updated Task",
"schema": {
"$ref": "#/definitions/models.Task"
}
}
}
}
},
"/tasks/{tid}/labels": {
"get": {
"description": "get a tasks labels given the task id",
Expand Down
121 changes: 121 additions & 0 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,34 @@
}
}
},
"/tasks": {
"post": {
"description": "Create a new task",
"tags": [
"tasks"
],
"summary": "Create a New Task",
"parameters": [
{
"description": "Create Task Request",
"name": "request_body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Task"
}
}
],
"responses": {
"201": {
"description": "Created Task",
"schema": {
"$ref": "#/definitions/models.Task"
}
}
}
}
},
"/tasks/assigned": {
"get": {
"description": "get tasks assigned to given users",
Expand Down Expand Up @@ -525,6 +553,29 @@
}
}
},
"/tasks/{tid}": {
"delete": {
"description": "Delete a task by ID",
"tags": [
"tasks"
],
"summary": "Delete a Task",
"parameters": [
{
"type": "integer",
"description": "Task ID",
"name": "tid",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/tasks/{tid}/assign": {
"post": {
"description": "assign users to task",
Expand Down Expand Up @@ -569,6 +620,76 @@
}
}
},
"/tasks/{tid}/assigned-users": {
"get": {
"description": "Get list of users assigned to a task by task ID",
"tags": [
"tasks"
],
"summary": "Get list of users assigned to a task",
"parameters": [
{
"type": "integer",
"description": "Task ID",
"name": "tid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "List of user IDs assigned to the task",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/tasks/{tid}/info": {
"put": {
"description": "Update the task_info field of a task by ID",
"tags": [
"tasks"
],
"summary": "Update Task Info",
"parameters": [
{
"type": "integer",
"description": "Task ID",
"name": "tid",
"in": "path",
"required": true
},
{
"description": "Update Task Info Request",
"name": "request_body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Task"
}
}
],
"responses": {
"200": {
"description": "Updated Task",
"schema": {
"$ref": "#/definitions/models.Task"
}
}
}
}
},
"/tasks/{tid}/labels": {
"get": {
"description": "get a tasks labels given the task id",
Expand Down
79 changes: 79 additions & 0 deletions backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,39 @@ paths:
summary: add a medication
tags:
- medications
/tasks:
post:
description: Create a new task
parameters:
- description: Create Task Request
in: body
name: request_body
required: true
schema:
$ref: '#/definitions/models.Task'
responses:
"201":
description: Created Task
schema:
$ref: '#/definitions/models.Task'
summary: Create a New Task
tags:
- tasks
/tasks/{tid}:
delete:
description: Delete a task by ID
parameters:
- description: Task ID
in: path
name: tid
required: true
type: integer
responses:
"204":
description: No Content
summary: Delete a Task
tags:
- tasks
/tasks/{tid}/assign:
post:
description: assign users to task
Expand Down Expand Up @@ -455,6 +488,52 @@ paths:
summary: Assign Users To Task
tags:
- tasks
/tasks/{tid}/assigned-users:
get:
description: Get list of users assigned to a task by task ID
parameters:
- description: Task ID
in: path
name: tid
required: true
type: integer
responses:
"200":
description: List of user IDs assigned to the task
schema:
items:
type: string
type: array
"400":
description: Bad Request
schema:
type: string
summary: Get list of users assigned to a task
tags:
- tasks
/tasks/{tid}/info:
put:
description: Update the task_info field of a task by ID
parameters:
- description: Task ID
in: path
name: tid
required: true
type: integer
- description: Update Task Info Request
in: body
name: request_body
required: true
schema:
$ref: '#/definitions/models.Task'
responses:
"200":
description: Updated Task
schema:
$ref: '#/definitions/models.Task'
summary: Update Task Info
tags:
- tasks
/tasks/{tid}/labels:
delete:
description: remove a label from a task given the task id, group id, and label
Expand Down
Loading

0 comments on commit 4ec0e1a

Please sign in to comment.