18034727885
2026-09-18 1328a7b0b90825b1fd63bca8f7675e52df8b151d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.igo.user.network
 
import com.igo.user.network.entity.AutoCompleteBean
import com.igo.user.network.entity.GPoiBean
import com.igo.user.network.entity.GeoBean
import com.igo.user.network.entity.PlaceDetailBean
import com.igo.user.network.entity.RouteBean
import com.igo.user.network.entity.SearchBean
import com.igo.user.utils.Const
import io.reactivex.Flowable
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.Query
 
interface GoogleApiService {
 
    @POST(GoogleApis.getPoi)
    fun getPoi(
        @Query("location") location: String, @Query("radius") radius: Int = 2000, @Query("key") key: String = Const.google_key,
        @Query("language") language: String
    ): Flowable<GPoiBean>
 
    @POST(GoogleApis.geoCode)
    fun geoCode(
        @Header("X-Goog-Maps-Experience-ID") tripId: String,
        @Query("latlng") location: String,
        @Query("language") language: String,
        @Query("key") key: String = Const.google_key,
        @Query("appid") appid: String = "c780a308a35740bfb946e10452ba62e0"
    ): Flowable<GeoBean>
 
    @POST(GoogleApis.textsearch)
    fun textsearch(
        @Header("X-Goog-Maps-Experience-ID") tripId: String, @Query("query") query: String, @Query("location") location: String?,
        @Query("language") language: String, @Query("radius") radius: Int = 25000, @Query("key") key: String = Const.google_key
    ): Flowable<SearchBean>
 
    @POST(GoogleApis.autocomplete)
    fun autocomplete(
        @Header("X-Goog-Maps-Experience-ID") tripId: String,
        @Query("input") query: String,
        @Query("language") language: String,
        @Query("components") region: String = "country:gh",
        @Query("key") key: String = Const.google_key
    ): Flowable<AutoCompleteBean>
 
    @POST(GoogleApis.placeDetails)
    fun placeDetails(
        @Header("X-Goog-Maps-Experience-ID") tripId: String, @Query("place_id") place_id: String, @Query("fields") region: String = "name,geometry",
        @Query("key") key: String = Const.google_key
    ): Flowable<PlaceDetailBean>
 
    @POST(GoogleApis.directions)
    fun directions(
        @Header("X-Goog-Maps-Experience-ID") tripId: String,
        @Query("origin") origin: String,
        @Query("destination") destination: String,
        @Query("language") language: String,
        @Query("mode") mode: String = "driving",
        @Query("key") key: String = Const.google_key
    ): Flowable<RouteBean>
}