Created
September 28, 2022 16:15
-
-
Save GabriellCosta/36424e8070a570fece16bd9596640978 to your computer and use it in GitHub Desktop.
Faq Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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