OnlyBiggg commited on
Commit
353eb77
·
1 Parent(s): bad2587
Files changed (1) hide show
  1. app/dialogflow/api/v1/dialogflow.py +10 -16
app/dialogflow/api/v1/dialogflow.py CHANGED
@@ -29,31 +29,25 @@ async def confirm(request: Request):
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
- """]
35
  temp = ""
36
  if origin_office and dest_office:
37
  temp = f"""
38
- Điểm đi: {origin_office}
39
- Điểm đến: {dest_office}
40
- """
41
  elif origin_office and departure_city:
42
  temp = f"""
43
- Điểm đi: {origin_office}
44
- Điểm đến: {departure_city
45
- }
46
- """
47
  elif dest_office and departure_city:
48
  temp = f"""
49
- Điểm đi: {departure_city}
50
- Điểm đến: {dest_office}
51
- """
52
  elif departure_city and destination_city:
53
  temp = f"""
54
- Điểm đi: {departure_city}
55
- Điểm đến: {destination_city}
56
- """
57
  text[0] = temp + text[0]
58
  payload = {
59
  "richContent": [
 
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": [