|
@@ -50,6 +50,16 @@ class deco_request_detail(BaseModel):
|
|
|
prefer_date: str
|
|
|
time_stamp: str
|
|
|
gender: str
|
|
|
+
|
|
|
+class client_info(BaseModel):
|
|
|
+ name:str
|
|
|
+ organization:str
|
|
|
+ position:str
|
|
|
+ phone:str
|
|
|
+ email:str
|
|
|
+ cert_last5:str
|
|
|
+ where_learn:str
|
|
|
+ why_sign:str
|
|
|
|
|
|
@app.get("/deco_request")
|
|
|
async def get_req():
|
|
@@ -72,6 +82,16 @@ async def create_req(req:deco_request):
|
|
|
req.id = pk
|
|
|
return req
|
|
|
|
|
|
+@app.post("/add_client_info")
|
|
|
+async def add_client_info(ci:client_info):
|
|
|
+ request_table = db['client_info']
|
|
|
+ time_stamp = datetime.fromtimestamp(time.time())
|
|
|
+ time_stamp = time_stamp.strftime("%Y-%m-%d %H:%M:%S")
|
|
|
+
|
|
|
+ pk = request_table.insert({'name':ci.name,'organization':ci.organization,'position':ci.position,'phone':ci.phone,'email':ci.email
|
|
|
+ ,'cert_last5':ci.cert_last5,'where_learn':ci.where_learn,'why_sign':ci.why_sign,'time_stamp':time_stamp})
|
|
|
+
|
|
|
+ return pk
|
|
|
@app.post("/deco_request_detail")
|
|
|
async def create_req_detail(req:deco_request_detail):
|
|
|
|