27 lines
623 B
Kotlin
27 lines
623 B
Kotlin
package contacts.data.remote.api
|
|
|
|
import retrofit2.http.*
|
|
|
|
interface ContactApi {
|
|
@GET("contacts")
|
|
suspend fun getContacts(): List<ContactDto>
|
|
|
|
@POST("contacts/add")
|
|
suspend fun addContact(@Body userId: String): ContactDto
|
|
|
|
@DELETE("contacts/{userId}")
|
|
suspend fun removeContact(@Path("userId") userId: String)
|
|
|
|
@GET("users/search")
|
|
suspend fun searchUsers(@Query("query") query: String): List<ContactDto>
|
|
}
|
|
|
|
data class ContactDto(
|
|
val id: String,
|
|
val username: String,
|
|
val displayName: String?,
|
|
val avatarUrl: String?,
|
|
val isOnline: Boolean,
|
|
val lastSeen: String?
|
|
)
|