Last active
February 10, 2020 21:48
-
-
Save lukaszkalnik/f6a252ad422ba4b55ccbb64f6bb106e0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package net.grandcentrix.gatewayapi.api | |
interface GatewayApiService { | |
suspend fun getLights(roomId: String): Either<Throwable, List<Light>> | |
suspend fun getSystemDetail(): Either<Throwable, SystemDetail> | |
companion object { | |
fun with(baseUrl: String): GatewayApiService { | |
val api = GatewayApi.create(baseUrl) | |
val lightsConverter = provideConverter<List<Light>>(tag = Tag.LIGHT_LIST) | |
val systemDetailConverter = //... | |
return DefaultGatewayApiService( | |
getLightsUseCase = getLightsUseCaseFactory(api, lightsConverter), | |
getSystemDetailUseCase = getSystemDetailUseCaseFactory(api, systemDetailConverter) | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment