| | |
| | | package com.igo.user.network |
| | | |
| | | import cn.sinata.xldutils.data.ResultData |
| | | import cn.sinata.xldutils.utils.LanguageUtil |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.google.gson.JsonObject |
| | | import com.igo.user.IGoApplication |
| | | import com.igo.user.data.HomeDatas |
| | | import com.igo.user.network.entity.* |
| | | import com.igo.user.network.entity.Anchor |
| | | import com.igo.user.network.entity.AutoCompleteBean |
| | | import com.igo.user.network.entity.CarPrice |
| | | import com.igo.user.network.entity.City |
| | | import com.igo.user.network.entity.Coupon |
| | | import com.igo.user.network.entity.DriverInfo |
| | | import com.igo.user.network.entity.EmailBean |
| | | import com.igo.user.network.entity.Evaluation |
| | | import com.igo.user.network.entity.Function |
| | | import com.igo.user.network.entity.GeoBean |
| | | import com.igo.user.network.entity.Goods |
| | | import com.igo.user.network.entity.GoogleToken |
| | | import com.igo.user.network.entity.InviteHis |
| | | import com.igo.user.network.entity.InvokeHis |
| | | import com.igo.user.network.entity.Line |
| | | import com.igo.user.network.entity.LogisticProgress |
| | | import com.igo.user.network.entity.Message |
| | | import com.igo.user.network.entity.MyBankCard |
| | | import com.igo.user.network.entity.OpenCity |
| | | import com.igo.user.network.entity.Order |
| | | import com.igo.user.network.entity.Phone |
| | | import com.igo.user.network.entity.PlaceDetailBean |
| | | import com.igo.user.network.entity.Point |
| | | import com.igo.user.network.entity.RealName |
| | | import com.igo.user.network.entity.RouteBean |
| | | import com.igo.user.network.entity.SearchBean |
| | | import com.igo.user.network.entity.SeatInfo |
| | | import com.igo.user.network.entity.ServiceRecord |
| | | import com.igo.user.network.entity.Shift |
| | | import com.igo.user.network.entity.TrippingInfo |
| | | import com.igo.user.network.entity.UserInfo |
| | | import com.igo.user.network.entity.VersionData |
| | | import com.igo.user.network.entity.WalletRecord |
| | | import com.igo.user.network.entity.WalletRecordBean |
| | | import com.igo.user.utils.Const |
| | | import io.reactivex.Flowable |
| | | import okhttp3.MediaType |
| | |
| | | * @param type 1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们 |
| | | */ |
| | | fun getH5(type: Int, language: String? = null): Flowable<ResultData<JsonObject>> { |
| | | val language = |
| | | language ?: SPUtils.instance().getString("language", Const.Language.DEFAULT_LANGUAGE) |
| | | val language = language ?: LanguageUtil.getLanguage() |
| | | return request().getH5(language,type) |
| | | } |
| | | |
| | |
| | | */ |
| | | fun geoCode(lat:Double,lon: Double): Flowable<GeoBean> { |
| | | //1=简体中文,2=英语,3=法语 |
| | | val language = SPUtils.instance().getString("language") |
| | | val language = LanguageUtil.getLanguage() |
| | | val lan = if (language == Const.Language.CHINESE) "zh-CN" else language |
| | | return request().geoCode(IGoApplication.tripId,"${lat},${lon}",lan) |
| | | } |
| | |
| | | */ |
| | | fun textsearch(key:String,lat: Double,lon: Double): Flowable<SearchBean> { |
| | | //1=简体中文,2=英语,3=法语 |
| | | val language = SPUtils.instance().getString("language") |
| | | val language = LanguageUtil.getLanguage() |
| | | val lan = if (language == Const.Language.CHINESE) "zh-CN" else language |
| | | return request().textsearch(IGoApplication.tripId,key,"${lat},${lon}",lan) |
| | | // return request().textsearch(key,5.586363,-0.187788,IGoApplication.chooseCityName,lan) //阿克拉 5.586363,-0.187788 |
| | |
| | | */ |
| | | fun autocomplete(key:String,country:String = "gh"): Flowable<AutoCompleteBean> { |
| | | //1=简体中文,2=英语,3=法语 |
| | | val language = SPUtils.instance().getString("language") |
| | | val language = LanguageUtil.getLanguage() |
| | | val lan = if (language == Const.Language.CHINESE) "zh-CN" else language |
| | | return request().autocomplete(IGoApplication.tripId,key,lan,"country:$country") |
| | | } |
| | |
| | | * 路线 |
| | | */ |
| | | fun directions(startLat: Double,startLon: Double,endLat: Double,endLon: Double): Flowable<RouteBean> { |
| | | val language = SPUtils.instance().getString("language") |
| | | val language = LanguageUtil.getLanguage() |
| | | val lan = if (language == Const.Language.CHINESE) "zh-CN" else language |
| | | return request().directions(IGoApplication.tripId,"${startLat},${startLon}","${endLat},${endLon}",lan) |
| | | } |