Skip to content

zhuyuanmao/timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

a timer django backend.

How to run the server.

  1. Run the command on project root directory.
docker-compose up --build
  1. Access the server via localhost:8000.

API Specs.

Get a list of tasks.

GET  /tasks

Request body: None

Response Body:

[
    {
        "id": "df5a297e-ee77-4d43-bbe5-b04aaa91ee1d",
        "name": "study",
        "status": 2,
        "duration": 10,
        "remainder": 10,
        "start_at": null,
        "end_at": null
    }
]

Get a task

GET  /tasks/:task_id

Request body: None

Response Body:

{
    "id": "df5a297e-ee77-4d43-bbe5-b04aaa91ee1d",
    "name": "study",
    "status": 2,
    "duration": 10,
    "remainder": 10,
    "start_at": null,
    "end_at": null
}

Create a task

GET  /tasks

Request body:

{
    "name": "study",
    "duration": 10,
    "webhook_url": "http://example.webhook.com"
}

Response Body:

{
    "id": "df5a297e-ee77-4d43-bbe5-b04aaa91ee1d",
    "name": "study",
    "status": 2,
    "duration": 10,
    "remainder": 10,
    "start_at": null,
    "end_at": null
}

Operate a task

GET  /tasks/:task_id/operations

Request body: (start, resume, pause)

{
    "operation": "resume"
}

Response Body:

{
    "id": "df5a297e-ee77-4d43-bbe5-b04aaa91ee1d",
    "name": "study",
    "status": 2,
    "duration": 10,
    "remainder": 10,
    "start_at": null,
    "end_at": null
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published