I want to use this single function only, but instead of UserAPIService, there may be ProductAPIService on runtime based on what user is clicking. Is that possible?
Code:
@Provides
@Singleton
fun provideRetrofitService(retrofit: Retrofit): UserAPIService = retrofit.create(UserAPIService::class.java)
UserAPIService:
interface UserAPIService {
@GET(URLConstants.API_CUSTOMER_REVIEWS_BY_ID + "{customerId}")
suspend fun getReviewData(@Path("customerId") value: String): Response<ReviewResponse>
}
FLOW:
Activity/Fragment - Viewmodel - repo - remotedatasource