Ciox
01/05/2023, 12:58 PMerror: <identifier> expected
kotlin.coroutines.Continuation<? super dev.ciox.insyder.data.models.new.PostRemoteResponse> continuation);
My ApiService
interface ArticleApiService {
@GET("/api/posts?populate=%2A")
suspend fun getAllArticles(): PostRemoteResponse
}
Retrofit provider
@Provides
@Singleton
fun provideRetrofit(okHttpClient: OkHttpClient): Retrofit = Retrofit.Builder()
.baseUrl("<http://localhost:1337/>")
.client(okHttpClient)
.addConverterFactory(MoshiConverterFactory.create())
.build()
Dispatchers Provider
@Retention(AnnotationRetention.BINARY)
@Qualifier
annotation class MainDispatcher
@Retention(AnnotationRetention.BINARY)
@Qualifier
annotation class IODispatcher
@Retention(AnnotationRetention.BINARY)
@Qualifier
annotation class DefaultDispatcher
@InstallIn(SingletonComponent::class)
@Module
object CoroutinesModule {
@DefaultDispatcher
@Provides
fun provideDefaultDispatcher(): CoroutineDispatcher = Dispatchers.Default
@IODispatcher
@Provides
fun provideIoDispatcher(): CoroutineDispatcher = <http://Dispatchers.IO|Dispatchers.IO>
@MainDispatcher
@Provides
fun provideMainDispatcher(): CoroutineDispatcher = Dispatchers.Main
}