Spaces:
Sleeping
Sleeping
OnlyBiggg
commited on
Commit
·
0895e6a
1
Parent(s):
e29792b
fix
Browse files- .gitignore +3 -0
- app/dialogflow/api/v1/dialogflow.py +2 -2
- app/dialogflow/services/__pycache__/dialog_service.cpython-310.pyc +0 -0
- app/dialogflow/services/dialog_service.py +7 -0
- common/external/__pycache__/external_api.cpython-310.pyc +0 -0
- core/__pycache__/conf.cpython-310.pyc +0 -0
- core/__pycache__/token_manager.cpython-310.pyc +0 -0
.gitignore
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
.env__pycache__/
|
| 2 |
.env
|
|
|
|
| 3 |
log/
|
| 4 |
alembic/versions/
|
| 5 |
static/media/
|
|
@@ -14,3 +15,5 @@ venv/
|
|
| 14 |
.ruff_cache/00
|
| 15 |
.pytest_cache/
|
| 16 |
note.txt
|
|
|
|
|
|
|
|
|
| 1 |
.env__pycache__/
|
| 2 |
.env
|
| 3 |
+
__pycache__
|
| 4 |
log/
|
| 5 |
alembic/versions/
|
| 6 |
static/media/
|
|
|
|
| 15 |
.ruff_cache/00
|
| 16 |
.pytest_cache/
|
| 17 |
note.txt
|
| 18 |
+
|
| 19 |
+
process _data/
|
app/dialogflow/api/v1/dialogflow.py
CHANGED
|
@@ -275,12 +275,12 @@ async def booking_trip(request: Request) -> Response:
|
|
| 275 |
|
| 276 |
origin_code, origin_id, origin_ids, dest_code, dest_id, dest_ids = None, None, None, None, None, None
|
| 277 |
if origin_office:
|
| 278 |
-
|
| 279 |
origin_ids = await dialog_service.find_id_office_by_name_office(origin_office)
|
| 280 |
elif raw_departure_city:
|
| 281 |
origin_code = origin_codes.get(raw_departure_city)
|
| 282 |
if dest_office:
|
| 283 |
-
|
| 284 |
dest_ids = await dialog_service.find_id_office_by_name_office(dest_office)
|
| 285 |
elif raw_destination_city:
|
| 286 |
dest_code = origin_codes.get(raw_destination_city)
|
|
|
|
| 275 |
|
| 276 |
origin_code, origin_id, origin_ids, dest_code, dest_id, dest_ids = None, None, None, None, None, None
|
| 277 |
if origin_office:
|
| 278 |
+
origin_id, origin_code = await dialog_service.find_id_and_code_provine_by_name_office(origin_office)
|
| 279 |
origin_ids = await dialog_service.find_id_office_by_name_office(origin_office)
|
| 280 |
elif raw_departure_city:
|
| 281 |
origin_code = origin_codes.get(raw_departure_city)
|
| 282 |
if dest_office:
|
| 283 |
+
dest_id, dest_code = await dialog_service.find_id_and_code_provine_by_name_office(dest_office)
|
| 284 |
dest_ids = await dialog_service.find_id_office_by_name_office(dest_office)
|
| 285 |
elif raw_destination_city:
|
| 286 |
dest_code = origin_codes.get(raw_destination_city)
|
app/dialogflow/services/__pycache__/dialog_service.cpython-310.pyc
CHANGED
|
Binary files a/app/dialogflow/services/__pycache__/dialog_service.cpython-310.pyc and b/app/dialogflow/services/__pycache__/dialog_service.cpython-310.pyc differ
|
|
|
app/dialogflow/services/dialog_service.py
CHANGED
|
@@ -213,6 +213,13 @@ class DialogService:
|
|
| 213 |
return group["provinceId"]
|
| 214 |
return None
|
| 215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
async def find_id_and_code_provine_by_name_office(self, office_name: str):
|
| 217 |
data = await self.search_pickup_points(origin=office_name)
|
| 218 |
if data.get("origin"):
|
|
|
|
| 213 |
return group["provinceId"]
|
| 214 |
return None
|
| 215 |
|
| 216 |
+
async def find_all_origin_by_name_office(self, office_name: str):
|
| 217 |
+
data = await self.search_pickup_points(origin=office_name)
|
| 218 |
+
if data.get("origin"):
|
| 219 |
+
origins = data["origin"]
|
| 220 |
+
return origins
|
| 221 |
+
return None
|
| 222 |
+
|
| 223 |
async def find_id_and_code_provine_by_name_office(self, office_name: str):
|
| 224 |
data = await self.search_pickup_points(origin=office_name)
|
| 225 |
if data.get("origin"):
|
common/external/__pycache__/external_api.cpython-310.pyc
CHANGED
|
Binary files a/common/external/__pycache__/external_api.cpython-310.pyc and b/common/external/__pycache__/external_api.cpython-310.pyc differ
|
|
|
core/__pycache__/conf.cpython-310.pyc
CHANGED
|
Binary files a/core/__pycache__/conf.cpython-310.pyc and b/core/__pycache__/conf.cpython-310.pyc differ
|
|
|
core/__pycache__/token_manager.cpython-310.pyc
CHANGED
|
Binary files a/core/__pycache__/token_manager.cpython-310.pyc and b/core/__pycache__/token_manager.cpython-310.pyc differ
|
|
|