Приложение
This commit is contained in:
26
client-mobile/contacts/data/remote/api/ContactApi.kt
Normal file
26
client-mobile/contacts/data/remote/api/ContactApi.kt
Normal file
@@ -0,0 +1,26 @@
|
||||
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?
|
||||
)
|
||||
Reference in New Issue
Block a user