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
|
import json
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from fastapi.responses import JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ def get_root():
|
|||||||
from GetSchedulePackager import getSchedulePackager
|
from GetSchedulePackager import getSchedulePackager
|
||||||
|
|
||||||
@app.get("/getSchedule")
|
@app.get("/getSchedule")
|
||||||
def getSchedule():
|
async def getSchedule():
|
||||||
|
|
||||||
res = getSchedulePackager()
|
res = getSchedulePackager()
|
||||||
|
|
||||||
@ -46,10 +47,15 @@ def getSchedule():
|
|||||||
|
|
||||||
from postSelectAppointment import SelectAppointment
|
from postSelectAppointment import SelectAppointment
|
||||||
|
|
||||||
@app.post("/SelectInterview")
|
class Appointment(BaseModel):
|
||||||
def postSelectInterview(request):
|
name: str
|
||||||
|
date: str
|
||||||
|
|
||||||
res = SelectAppointment(request)
|
@app.post("/SelectInterview")
|
||||||
|
async def postSelectInterview(rawRequest: dict):
|
||||||
|
|
||||||
|
|
||||||
|
res = SelectAppointment(rawRequest)
|
||||||
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
headers={
|
headers={
|
||||||
|
@ -17,20 +17,16 @@ def SelectAppointment (appointmentJson):
|
|||||||
``Contact``: darkicewolf50@gmail.com
|
``Contact``: darkicewolf50@gmail.com
|
||||||
"""
|
"""
|
||||||
|
|
||||||
print(appointmentJson)
|
|
||||||
|
|
||||||
status = mockWriteFunction(appointmentJson)
|
status = mockWriteFunction(appointmentJson)
|
||||||
|
|
||||||
if status:
|
if status:
|
||||||
resBody = {"Success": True}
|
resBody = {"Success": True, "message": ""}
|
||||||
else:
|
else:
|
||||||
resBody = {"Success": False}
|
resBody = {"Success": False, "message": ""}
|
||||||
|
|
||||||
return {
|
resBody["message"] = appointmentJson["message"]
|
||||||
"statusCode": 200,
|
return resBody
|
||||||
"isBase64ENcoded": "false",
|
|
||||||
"body": json.dumps(resBody)
|
|
||||||
}
|
|
||||||
|
|
||||||
def mockWriteFunction(appTime):
|
def mockWriteFunction(appTime):
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user