-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathmain.py
More file actions
52 lines (40 loc) · 989 Bytes
/
main.py
File metadata and controls
52 lines (40 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from fastapi import FastAPI
from datetime import datetime
from typing import Optional
from fastapi.encoders import jsonable_encoder
from model.model import Task, TaskList
import model.taskman as taskman
app = FastAPI()
@app.get("/api/tasks")
async def get_tasks():
"""TODO
Fetch the list of all tasks
"""
return "TODO"
@app.get("/api/tasks/{id}")
async def get_task(id: int):
"""TODO
Fetch the task by id
"""
return "TODO"
@app.post("/api/tasks/create")
async def create_task(task: Task):
"""TODO
1. Create a new task and
2. Return the details of task
"""
return "TODO"
@app.put("/api/tasks/{id}/update")
async def update_task(id: int, task: Task):
"""TODO
1. Update the task by id
2. Return the updated task
"""
return "TODO"
@app.delete("/api/tasks/{id}/delete")
async def delete_task(id: int):
"""TODO
1. Delete the task by id
2. Return a confirmation of deletion
"""
return "TODO"