RealmTest/app/src/main/java/com/navinfo/volvo/http/NavinfoVolvoCall.kt
2023-01-04 17:19:29 +08:00

27 lines
774 B
Kotlin

package com.navinfo.volvo.http
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
class NavinfoVolvoCall {
companion object {
private val service by lazy {
Retrofit.Builder().baseUrl("http://ec2-52-81-73-5.cn-north-1.compute.amazonaws.com.cn:8088/")
.addConverterFactory(GsonConverterFactory.create())
.build()
.create(NavinfoVolvoService::class.java)
}
private var instance: NavinfoVolvoCall? = null
get() {
if (field == null) {
field = NavinfoVolvoCall()
}
return field
}
fun getApi(): NavinfoVolvoService {
return service
}
}
}