mirror of
https://github.com/UofCBaja/Interview-Backend.git
synced 2025-06-15 13:24:19 -06:00
feat:(Packagers): post request sorted
This commit is contained in:
parent
a0712e15eb
commit
207db735e7
Binary file not shown.
BIN
__pycache__/newMain.cpython-313.pyc
Normal file
BIN
__pycache__/newMain.cpython-313.pyc
Normal file
Binary file not shown.
Binary file not shown.
14
newMain.py
14
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={
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user