|
@@ -62,26 +62,41 @@ https://wiki.sharix-app.org/doku.php/open/tech/dev/sharix_open_-_primery_json
|
|
|
|
|
|
#надо адаптировать класс к новому формату JSON
|
|
#надо адаптировать класс к новому формату JSON
|
|
class Order(object):
|
|
class Order(object):
|
|
- def __init__(self, ticket, state, id_metaservice, is_global, is_visible, service, service_type, time_placed, time_start=None, time_start_predicted=None, time_finish_predicted=None, time_start_real=None, time_finish_real=None, order_place_start=None, order_place_start_gps=None, order_place_start_real=None, order_place_start_real_gps=None, order_place_finish_predicted=None, order_place_finish_predicted_gps=None, order_place_finish_real=None, order_place_finish_real_gps=None, predicted_price=None, real_price=None, payment_transaction_id=None, rating_id=None, provider=None, provider_screen_name=None, receiver=None, receiver_screen_name=None, client_id=None, resource_id=None):
|
|
|
|
|
|
+ #def __init__(self, ticket, state, id_metaservice, is_global, is_visible, service, service_type, time_placed, time_start=None, time_start_predicted=None, time_finish_predicted=None, time_start_real=None, time_finish_real=None, order_place_start=None, order_place_start_gps=None, order_place_start_real=None, order_place_start_real_gps=None, order_place_finish_predicted=None, order_place_finish_predicted_gps=None, order_place_finish_real=None, order_place_finish_real_gps=None, predicted_price=None, real_price=None, payment_transaction_id=None, rating_id=None, provider=None, provider_screen_name=None, receiver=None, receiver_screen_name=None, client_id=None, resource_id=None):
|
|
|
|
+ def __init__(self, receivers=None, receivers_names=None, comment=None, tasks=None, journey_places=None, is_with_payment_document=None, ticket=None, status=None, priority=None, title=None, note=None, due_date=None, id_metaservice=None, is_global=None, is_visible=None, service=None, service_type=None, status_changed_date=None, time_placed=None, time_start=None, time_start_predicted=None, time_finish_predicted=None, time_start_real=None, time_finish_real=None, order_place_type=None, order_place_start=None, order_place_start_gps=None, order_place_start_sector=None, order_place_start_real=None, order_place_start_real_gps=None, order_place_finish_predicted=None, order_place_finish_predicted_gps=None, order_place_finish_sector = None, order_place_finish_real = None, order_place_finish_real_gps = None, predicted_price=None, real_price=None, payment_transaction_id=None, rating_id=None, provider=None, provider_screen_name=None, receiver=None, receiver_screen_name=None, client_id=None, client_screen_name=None, resource_id=None, attempts=None, asap=None):
|
|
|
|
+ self.receivers = receivers
|
|
|
|
+ self.receivers_names = receivers_names
|
|
|
|
+ self.comment = comment
|
|
|
|
+ self.tasks = tasks
|
|
|
|
+ self.journey_places = journey_places
|
|
|
|
+ self.is_with_payment_document = is_with_payment_document
|
|
self.ticket = ticket
|
|
self.ticket = ticket
|
|
- self.state = state
|
|
|
|
|
|
+ self.status = status
|
|
|
|
+ self.priority = priority
|
|
|
|
+ self.title = title
|
|
|
|
+ self.note = note
|
|
|
|
+ self.due_date = due_date
|
|
self.id_metaservice = id_metaservice
|
|
self.id_metaservice = id_metaservice
|
|
self.is_global = is_global
|
|
self.is_global = is_global
|
|
self.is_visible = is_visible
|
|
self.is_visible = is_visible
|
|
self.service = service
|
|
self.service = service
|
|
self.service_type = service_type
|
|
self.service_type = service_type
|
|
|
|
+ self.status_changed_date = status_changed_date
|
|
self.time_placed = time_placed
|
|
self.time_placed = time_placed
|
|
self.time_start = time_start
|
|
self.time_start = time_start
|
|
self.time_start_predicted = time_start_predicted
|
|
self.time_start_predicted = time_start_predicted
|
|
self.time_finish_predicted = time_finish_predicted
|
|
self.time_finish_predicted = time_finish_predicted
|
|
self.time_start_real = time_start_real
|
|
self.time_start_real = time_start_real
|
|
self.time_finish_real = time_finish_real
|
|
self.time_finish_real = time_finish_real
|
|
|
|
+ self.order_place_type = order_place_type
|
|
self.order_place_start = order_place_start
|
|
self.order_place_start = order_place_start
|
|
self.order_place_start_gps = order_place_start_gps
|
|
self.order_place_start_gps = order_place_start_gps
|
|
|
|
+ self.order_place_start_sector = order_place_start_sector
|
|
self.order_place_start_real = order_place_start_real
|
|
self.order_place_start_real = order_place_start_real
|
|
self.order_place_start_real_gps = order_place_start_real_gps
|
|
self.order_place_start_real_gps = order_place_start_real_gps
|
|
self.order_place_finish_predicted = order_place_finish_predicted
|
|
self.order_place_finish_predicted = order_place_finish_predicted
|
|
self.order_place_finish_predicted_gps = order_place_finish_predicted_gps
|
|
self.order_place_finish_predicted_gps = order_place_finish_predicted_gps
|
|
|
|
+ self.order_place_finish_sector = order_place_finish_sector
|
|
self.order_place_finish_real = order_place_finish_real
|
|
self.order_place_finish_real = order_place_finish_real
|
|
self.order_place_finish_real_gps = order_place_finish_real_gps
|
|
self.order_place_finish_real_gps = order_place_finish_real_gps
|
|
self.predicted_price = predicted_price
|
|
self.predicted_price = predicted_price
|
|
@@ -93,11 +108,14 @@ class Order(object):
|
|
self.receiver = receiver
|
|
self.receiver = receiver
|
|
self.receiver_screen_name = receiver_screen_name
|
|
self.receiver_screen_name = receiver_screen_name
|
|
self.client_id = client_id
|
|
self.client_id = client_id
|
|
|
|
+ self.client_screen_name = client_screen_name
|
|
self.resource_id = resource_id
|
|
self.resource_id = resource_id
|
|
|
|
+ self.attempts = attempts
|
|
|
|
+ self.asap = asap
|
|
|
|
|
|
#доделать до конца по аналогии с закоммиченным json
|
|
#доделать до конца по аналогии с закоммиченным json
|
|
def __str__(self):
|
|
def __str__(self):
|
|
- return "{0}, {1}, {2}, {3}, {4}, {5}, {6},\n{7}, {8}, {9}, {10}, {11}, {12},\n{13}, {14}, {15}, {16}, {17}, {18}, {19}, {20},\n{21}, {22}, {23}, {24},\n{25}, {26}, {27}, {28}, {29}, {30}".format(self.ticket, self.state, self.id_metaservice, self.is_global, self.is_visible, self.service, self.service_type, self.time_placed, self.time_start, self.time_start_predicted, self.time_finish_predicted, self.time_start_real, self.time_finish_real, self.order_place_start, self.order_place_start_gps, self.order_place_start_real, self.order_place_start_real_gps, self.order_place_finish_predicted, self.order_place_finish_predicted_gps, self.order_place_finish_real, self.order_place_finish_real_gps, self.predicted_price, self.real_price, self.payment_transaction_id, self.rating_id, self.provider, self.provider_screen_name, self.receiver, self.receiver_screen_name, self.client_id, self.resource_id)
|
|
|
|
|
|
+ return "{0}, {1}, {2}, {3}, {4}, {5}, {6},\n{7}, {8}, {9}, {10}, {11}, {12},\n{13}, {14}, {15}, {16}, {17}, {18}, {19}, {20},\n{21}, {22}, {23}, {24},\n{25}, {26}, {27}, {28}, {29}, {30}\n{31}, {32}, {33}, {34}, {35}, {36},\n{37}, {38}, {39}, {40}\n{41}, {42}, {43}, {44}, {45}, {46},\n{47}\n".format(self.receivers, self.receivers_names, self.comment, self.tasks, self.journey_places, self.is_with_payment_document, self.ticket, self.status, self.priority, self.title, self.note, self.due_date, self.id_metaservice, self.is_global, self.is_visible, self.service, self.service_type, self.status_changed_date, self.time_placed, self.time_start, self.time_start_predicted, self.time_finish_predicted, self.time_start_real, self.time_finish_real, self.order_place_type, self.order_place_start, self.order_place_start_gps, self.order_place_start_sector, self.order_place_start_real, self.order_place_start_real_gps, self.order_place_finish_predicted, self.order_place_finish_predicted_gps, self.order_place_finish_sector, self.order_place_finish_real, self.order_place_finish_real_gps, self.predicted_price, self.real_price, self.payment_transaction_id, self.rating_id, self.provider, self.provider_screen_name, self.receiver, self.receiver_screen_name, self.client_id, self.client_screen_name, self.resource_id, self.attempts, self.asap)
|
|
#\n добавляете в местах с пустой строкой в шаблоне
|
|
#\n добавляете в местах с пустой строкой в шаблоне
|
|
|
|
|
|
|
|
|
|
@@ -181,6 +199,7 @@ def requestGetToken(login, password, url) -> str:
|
|
}
|
|
}
|
|
response = requests.post(url, json=data)
|
|
response = requests.post(url, json=data)
|
|
result = response.json()
|
|
result = response.json()
|
|
|
|
+ print (result)
|
|
return result['auth_token']
|
|
return result['auth_token']
|
|
#Функция обращения к апи и получение токена
|
|
#Функция обращения к апи и получение токена
|
|
def createUser(username, phone, password, url) -> str:
|
|
def createUser(username, phone, password, url) -> str:
|
|
@@ -191,6 +210,7 @@ def createUser(username, phone, password, url) -> str:
|
|
}
|
|
}
|
|
response = requests.post(url, json=data)
|
|
response = requests.post(url, json=data)
|
|
result = response.json()
|
|
result = response.json()
|
|
|
|
+ print (result)
|
|
return result
|
|
return result
|
|
#Функция обращения к апи и получение списка пользователей
|
|
#Функция обращения к апи и получение списка пользователей
|
|
def requestGetListUser():
|
|
def requestGetListUser():
|