Koin - Creating Implementor for Interface in Andorid

37 views Asked by At

Using koin dependency Injection library in Android. I have doubt in creating interface implementor.

My Interface is as below:

  interface EnrollApiInterface {
    @GET("person/templates/{id}")
    fun yoonikEnroll(@Path("id") id: String) : Deferred<Response<ResponseBody>>
  }

I am trying to create implementor as below:

class EnrollApiInterfaceImp() : EnrollApiInterface{
@GET("person/templates/{id}")
override fun yoonikEnroll(@Path("id") id: String) : Deferred<Response<ResponseBody>>{
    return
  }
}

But I don't know What I can return here?

1

There are 1 answers

0
Stephan On

It seems like you are using retrofit for your api interface, therefore you have to use the retrofit builder:

Retrofit
.Builder()
.baseUrl("https://theurl.com")
.build()
.create(EnrollApiInterface::class.java)

See the retrofit documentation for more information.