Api/v1/socket/io /setAddress



Yüklə 18,25 Kb.
tarix13.05.2023
ölçüsü18,25 Kb.
#126888
start-taxi.doc


  1. setAddress.

url: /api/v1/socket/IO /setAddress

Request:


[
“id” : 1,
“latitude” : 26.352001 ,
“longitude” : 25.369012
]

  1. getAddress.

url : /api/v1/socket/IO /getAddress/1/8
1 --> bu driver ning id
8 bu client ning id
klient so’rovni shu kanalga jo’natadi va javobni pastdagi kanal orqali oladi

Response:


{
"message":{


"code": "0",
"message": null
},
"data":{
“id” : 2 ,
“longitude” : 25.69565,
“latitude” : 56.3244
}
}

Response /cars/driver/8 kanalga boradi 8- bu client ning id


Client /car/driver/8 bu kanalni eshitib turishi kerak





  1. Clinet orderni bosganda Driverga socket orqali event boradi Ya’ni qabul qilasanmi yoqmi degan

Kanal: /order/car/6 6  driver id


bu kanalni driver eshitib turishi kerak
event:
{
“orderId”: 6,
“amount”: 50000,
“longitude” : 25.366,
“latitude” : 25.1144,
“startAddressTitle” : “amir temur shoh kochasi”,
“distance”: 13.4,
“isLugguage”: false,
“isContition”: false,

“toAddress” : [


{ “destAddressTitle”: “chorsu”,
“destLongt” : 13.000,
“destLat”: 24.26345 },
{…}
]
}

  1. Driver kelgan eventga javob berishi kerak :

Request url: /order/isAccept/6 6 bu driver id


Response kanal: /order/car/6 6 bu driver id driver shu kanalni eshitib turishi kerak

Request: {


“orderId”: 13,
“isAccept” : true yoki false
}

  1. /order/data/client/7 7- client ning id si client uni listen qilib turishi kerey.

Bu kanalga zakazni qabul qilgan driverning ma’lumotlari keladi





  1. /order/data/driver/8 8- driver ning id si driver uni listen qilib turishi kerey. Bunga client haqida ma’lumotlar keladi




  1. /order/accept/driver/8 8- driver ning id si driver uni listen qilib turishi kerey. Bunga kimdir zakazni qabul qilgani haqida malumot keladi



  1. /order/cancel/9/1 client zakazini cancel qilish

Bunda 9 – client id 1 - order id . Agar clientga zakazni id si hali qaytmagan bo’lsa 0 jo’natadi





  1. /order/data/cancel/3 client cancel qilgandan keyin shu kanallarga cancel qildi degan ma’lumot jo’natiladi. Bu kanalni driver eshiitib turishi kerey.


3- driver id



  1. /order/data/begin/3 3- client id. Haydovchi klient chaqirgan manzilga borgandan keyin klientga ma’lumot boradi (Taxi yetib keldi degan). Client shu kanalni eshitib turishi kerak.



  1. /order/data/end/3 3- client id. Haydovchi buyurtmani tugatishni bosgandan keyin clientga ma’lumot jo’natiladi. Client shu kanalni eshitib turishi kerak.

Yüklə 18,25 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin