Update app.py
Browse files
app.py
CHANGED
@@ -62,3 +62,21 @@ async def remove(op: Operation):
|
|
62 |
return {"result": "Invalid category"}
|
63 |
else:
|
64 |
return {"result": "Invalid operation"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
return {"result": "Invalid category"}
|
63 |
else:
|
64 |
return {"result": "Invalid operation"}
|
65 |
+
|
66 |
+
|
67 |
+
@app.post("/check/")
|
68 |
+
async def add(op: Operation):
|
69 |
+
if op.a == 'Check':
|
70 |
+
target_list = None
|
71 |
+
if op.b == 'Greet':
|
72 |
+
target_list = Greet
|
73 |
+
elif op.b == 'Bye':
|
74 |
+
target_list = Bye
|
75 |
+
elif op.b == 'Sleep':
|
76 |
+
target_list = Sleep
|
77 |
+
elif op.b == 'Care':
|
78 |
+
target_list = Care
|
79 |
+
if target_list is not None:
|
80 |
+
return {"result": target_list}
|
81 |
+
else:
|
82 |
+
return {"result": "Invalid operation"}
|