Spaces:
Running
Running
OnlyBiggg
commited on
Commit
·
9ec0cd6
1
Parent(s):
353eb77
fix
Browse files
app/dialogflow/api/v1/dialogflow.py
CHANGED
@@ -28,26 +28,16 @@ async def confirm(request: Request):
|
|
28 |
ticket_number = int(raw_ticket_number) if raw_ticket_number else 1
|
29 |
date = dialog_service.to_datetime_from_Dialogflow(raw_date)
|
30 |
date, week_day = get_weekday_name(date)
|
31 |
-
text = [f"""
|
32 |
-
Ngày: {date} {week_day}
|
33 |
-
Số vé: {ticket_number}"""]
|
34 |
temp = ""
|
35 |
if origin_office and dest_office:
|
36 |
-
temp = f"""
|
37 |
-
Điểm đi: {origin_office}
|
38 |
-
Điểm đến: {dest_office}"""
|
39 |
elif origin_office and departure_city:
|
40 |
-
temp = f"""
|
41 |
-
Điểm đi: {origin_office}
|
42 |
-
Điểm đến: {departure_city}"""
|
43 |
elif dest_office and departure_city:
|
44 |
-
temp = f"""
|
45 |
-
Điểm đi: {departure_city}
|
46 |
-
Điểm đến: {dest_office}"""
|
47 |
elif departure_city and destination_city:
|
48 |
-
temp = f"""
|
49 |
-
Điểm đi: {departure_city}
|
50 |
-
Điểm đến: {destination_city}"""
|
51 |
text[0] = temp + text[0]
|
52 |
payload = {
|
53 |
"richContent": [
|
|
|
28 |
ticket_number = int(raw_ticket_number) if raw_ticket_number else 1
|
29 |
date = dialog_service.to_datetime_from_Dialogflow(raw_date)
|
30 |
date, week_day = get_weekday_name(date)
|
31 |
+
text = [f"""Ngày: {date} {week_day}\nSố vé: {ticket_number}"""]
|
|
|
|
|
32 |
temp = ""
|
33 |
if origin_office and dest_office:
|
34 |
+
temp = f"""Điểm đi: {origin_office}\nĐiểm đến: {dest_office}"""
|
|
|
|
|
35 |
elif origin_office and departure_city:
|
36 |
+
temp = f"""Điểm đi: {origin_office}\nĐiểm đến: {departure_city}"""
|
|
|
|
|
37 |
elif dest_office and departure_city:
|
38 |
+
temp = f"""Điểm đi: {departure_city}\nĐiểm đến: {dest_office}"""
|
|
|
|
|
39 |
elif departure_city and destination_city:
|
40 |
+
temp = f"""Điểm đi: {departure_city}\nĐiểm đến: {destination_city}"""
|
|
|
|
|
41 |
text[0] = temp + text[0]
|
42 |
payload = {
|
43 |
"richContent": [
|
utils/format_data_dialog.py
CHANGED
@@ -36,4 +36,4 @@ def get_weekday_name(date: datetime) -> tuple:
|
|
36 |
weekday_ids = date.weekday()
|
37 |
weekday = vietnam_weekdays.get(weekday_ids) if vietnam_weekdays.get(weekday_ids) else ""
|
38 |
|
39 |
-
return
|
|
|
36 |
weekday_ids = date.weekday()
|
37 |
weekday = vietnam_weekdays.get(weekday_ids) if vietnam_weekdays.get(weekday_ids) else ""
|
38 |
|
39 |
+
return date.strftime("%d-%m-%Y"), weekday
|