55 lines
2.1 KiB
Kotlin
55 lines
2.1 KiB
Kotlin
package chats.data.remote.dto
|
|
|
|
import com.google.gson.annotations.SerializedName
|
|
|
|
data class UserBasicDto(
|
|
@SerializedName("id") val id: String,
|
|
@SerializedName("username") val username: String? = null,
|
|
@SerializedName("displayName") val displayName: String? = null,
|
|
@SerializedName("avatarUrl") val avatarUrl: String? = null
|
|
)
|
|
|
|
data class MessageDto(
|
|
@SerializedName("id") val id: String,
|
|
@SerializedName("chatId") val chatId: String? = null,
|
|
@SerializedName("senderId") val senderId: String? = null,
|
|
@SerializedName("content") val content: String? = null,
|
|
@SerializedName("type") val type: String? = null,
|
|
@SerializedName("sequenceId") val sequenceId: Int? = null,
|
|
@SerializedName("createdAt") val createdAt: String? = null,
|
|
@SerializedName("sender") val sender: UserBasicDto? = null,
|
|
@SerializedName("media") val media: List<MediaItemDto> = emptyList(),
|
|
@SerializedName("reactions") val reactions: List<ReactionDto>? = emptyList(),
|
|
@SerializedName("replyTo") val replyTo: MessageDto? = null
|
|
)
|
|
|
|
data class ReactionDto(
|
|
@SerializedName("emoji") val emoji: String,
|
|
@SerializedName("count") val count: Int,
|
|
@SerializedName("isSetByMe") val isSetByMe: Boolean
|
|
)
|
|
|
|
data class MediaItemDto(
|
|
@SerializedName("id") val id: String,
|
|
@SerializedName("type") val type: String,
|
|
@SerializedName("url") val url: String,
|
|
@SerializedName("filename") val filename: String? = null,
|
|
@SerializedName("size") val size: Long? = null,
|
|
@SerializedName("duration") val duration: Double? = null
|
|
)
|
|
|
|
data class ChatDto(
|
|
@SerializedName("id") val id: String,
|
|
@SerializedName("type") val type: String,
|
|
@SerializedName("name") val name: String? = null,
|
|
@SerializedName("avatar") val avatar: String? = null,
|
|
@SerializedName("unreadCount") val unreadCount: Int = 0,
|
|
@SerializedName("messages") val messages: List<MessageDto> = emptyList(),
|
|
@SerializedName("members") val members: List<ChatMemberDto> = emptyList()
|
|
)
|
|
|
|
data class ChatMemberDto(
|
|
@SerializedName("userId") val userId: String,
|
|
@SerializedName("user") val user: UserBasicDto? = null
|
|
)
|