Api/v1/socket/io /setAddress
Download 18.25 Kb.
|
start-taxi.doc
- Bu sahifa navigatsiya:
- /api/v1/socket/IO /getAddress/1/8
setAddress. url: /api/v1/socket/IO /setAddress Request: [ “id” : 1, “latitude” : 26.352001 , “longitude” : 25.369012 ] 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: {
"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 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 }, {…} ] } 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 } /order/data/client/7 7- client ning id si client uni listen qilib turishi kerey. Bu kanalga zakazni qabul qilgan driverning ma’lumotlari keladi /order/data/driver/8 8- driver ning id si driver uni listen qilib turishi kerey. Bunga client haqida ma’lumotlar keladi /order/accept/driver/8 8- driver ning id si driver uni listen qilib turishi kerey. Bunga kimdir zakazni qabul qilgani haqida malumot keladi /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 /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 /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. /order/data/end/3 3- client id. Haydovchi buyurtmani tugatishni bosgandan keyin clientga ma’lumot jo’natiladi. Client shu kanalni eshitib turishi kerak. Download 18.25 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling