-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE]#74 : BlockedMessage Model 클래스 구현
- Loading branch information
1 parent
fce7534
commit 2652e7c
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
core/model/src/main/kotlin/com/bff/wespot/model/message/response/BlockedMessage.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.bff.wespot.model.message.response | ||
|
||
import com.bff.wespot.model.message.Sender | ||
import com.bff.wespot.model.user.response.User | ||
import java.time.LocalDateTime | ||
|
||
data class BlockedMessage( | ||
val id: Int, | ||
val senderName: String, | ||
val senderProfile: Sender, | ||
val receiver: User, | ||
val content: String, | ||
val receivedAt: LocalDateTime?, | ||
val isRead: Boolean, | ||
val isReported: Boolean, | ||
val isBlocked: Boolean, | ||
) { | ||
constructor() : this(-1, "", Sender(), User(), "", LocalDateTime.MIN, false, false, false) | ||
} |
36 changes: 36 additions & 0 deletions
36
...te/src/main/kotlin/com/bff/wespot/data/remote/model/message/response/BlockedMessageDto.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.bff.wespot.data.remote.model.message.response | ||
|
||
import com.bff.wespot.data.remote.extensions.toISOLocalDateTime | ||
import com.bff.wespot.data.remote.model.user.response.UserDto | ||
import com.bff.wespot.model.message.response.BlockedMessage | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class BlockedMessageListDto( | ||
val messages: List<BlockedMessageDto>, | ||
) | ||
|
||
@Serializable | ||
data class BlockedMessageDto( | ||
val id: Int, | ||
val senderName: String, | ||
val senderProfile: SenderDto, | ||
val receiver: UserDto, | ||
val content: String, | ||
val receivedAt: String?, | ||
val isRead: Boolean, | ||
val isReported: Boolean, | ||
val isBlocked: Boolean, | ||
) { | ||
fun toBlockedMessage(): BlockedMessage = BlockedMessage( | ||
id = id, | ||
senderName = senderName, | ||
senderProfile = senderProfile.toSender(), | ||
receiver = receiver.toUser(), | ||
content = content, | ||
receivedAt = receivedAt?.toISOLocalDateTime(), | ||
isRead = isRead, | ||
isReported = isReported, | ||
isBlocked = isBlocked, | ||
) | ||
} |