diff --git a/__pycache__/GetSchedulePackager.cpython-313.pyc b/__pycache__/GetSchedulePackager.cpython-313.pyc index b58de92..ab44533 100644 Binary files a/__pycache__/GetSchedulePackager.cpython-313.pyc and b/__pycache__/GetSchedulePackager.cpython-313.pyc differ diff --git a/__pycache__/newMain.cpython-313.pyc b/__pycache__/newMain.cpython-313.pyc new file mode 100644 index 0000000..8dd137b Binary files /dev/null and b/__pycache__/newMain.cpython-313.pyc differ diff --git a/__pycache__/postSelectAppointment.cpython-313.pyc b/__pycache__/postSelectAppointment.cpython-313.pyc index 66e96de..e59725e 100644 Binary files a/__pycache__/postSelectAppointment.cpython-313.pyc and b/__pycache__/postSelectAppointment.cpython-313.pyc differ diff --git a/newMain.py b/newMain.py index 0b6ed2e..3a2fe57 100644 --- a/newMain.py +++ b/newMain.py @@ -1,6 +1,7 @@ import json from fastapi import FastAPI from fastapi.responses import JSONResponse +from pydantic import BaseModel app = FastAPI() @@ -29,7 +30,7 @@ def get_root(): from GetSchedulePackager import getSchedulePackager @app.get("/getSchedule") -def getSchedule(): +async def getSchedule(): res = getSchedulePackager() @@ -46,10 +47,15 @@ def getSchedule(): from postSelectAppointment import SelectAppointment -@app.post("/SelectInterview") -def postSelectInterview(request): +class Appointment(BaseModel): + name: str + date: str - res = SelectAppointment(request) +@app.post("/SelectInterview") +async def postSelectInterview(rawRequest: dict): + + + res = SelectAppointment(rawRequest) return JSONResponse( headers={ diff --git a/postSelectAppointment.py b/postSelectAppointment.py index b32553c..49bb918 100644 --- a/postSelectAppointment.py +++ b/postSelectAppointment.py @@ -17,20 +17,16 @@ def SelectAppointment (appointmentJson): ``Contact``: darkicewolf50@gmail.com """ - print(appointmentJson) status = mockWriteFunction(appointmentJson) if status: - resBody = {"Success": True} + resBody = {"Success": True, "message": ""} else: - resBody = {"Success": False} + resBody = {"Success": False, "message": ""} - return { - "statusCode": 200, - "isBase64ENcoded": "false", - "body": json.dumps(resBody) - } + resBody["message"] = appointmentJson["message"] + return resBody def mockWriteFunction(appTime): return 0