Skip to content

Instantly share code, notes, and snippets.

@GabriellCosta
Created September 28, 2022 16:15
Show Gist options
  • Save GabriellCosta/36424e8070a570fece16bd9596640978 to your computer and use it in GitHub Desktop.
Save GabriellCosta/36424e8070a570fece16bd9596640978 to your computer and use it in GitHub Desktop.
Faq Sample
class FaqRepositoryImpl(
val api: Api,
val faqApiInternal: InternalFaqRepository
): FaqRepository {
override fun apiRest(): FaqModel {
val result = api.apiFaq()
if (result.code.isSuccess()) {
} else if (result.code == 500) {
InternalFaqRepository.apiRest()
}
}
}
interface FaqRepository {
fun apiRest(): FaqModel
}
class InternalFaqRepository: FaqRepository{
override fun apiRest(): FaqModel {
val assetManager = ....
val responseAsString = .....
return FaqModel
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment