android10 / android10/Android-CleanArchitecture-Kotlin
Declare @Body data class in Api internal interface
- Linguagem predominante
- Kotlin
- Estrelas
- 4.8k
- Forks
- 929
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
I want to make a data class in order to send data via post...but internal declaration of Api interface not allows me to archieve this. If I remove internal declaration, it works, but Repository class shouldn't have to fill an ApiParams class.....
```
internal interface LoginApi {
companion object {
private const val LOGIN = "login"
private const val PARAM_ACCOUNT = "account"
private const val PARAM_EMAIL = "email"
private const val PARAM_PASSWORD = "password"
}
@POST(LOGIN) fun login(@Body params: LoginParams): Call
data class LoginParams(
@SerializedName(PARAM_ACCOUNT) private val account: String,
@SerializedName(PARAM_EMAIL) private val email: String,
@SerializedName(PARAM_PASSWORD) private val password: String
)
}
```
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.