From c4171544bb3a63e08646fbf0f9b0e7b2b4755087 Mon Sep 17 00:00:00 2001 From: yeseong0412 Date: Sat, 19 Oct 2024 16:10:15 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20::=20=ED=98=84=EC=9E=AC=20=EB=B0=A9?= =?UTF-8?q?=EC=97=90=20=EC=9E=88=EC=9D=84=EC=8B=9C=20=EC=95=88=20=EC=9D=BD?= =?UTF-8?q?=EC=9D=80=EA=B0=92=20=EB=B0=98=ED=99=98=20=EC=95=88=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 채팅방에서 접속해있을때 타 서비스에서 채팅방 불러오기를 시도하면 0000 after 로 찍어서 모든 메시지를 안읽음으로 처리하던걸 수정함 --- .../chat/application/service/message/MessageServiceImpl.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/seugi/api/domain/chat/application/service/message/MessageServiceImpl.kt b/src/main/kotlin/com/seugi/api/domain/chat/application/service/message/MessageServiceImpl.kt index 3ab2fbc06..ad104ad31 100644 --- a/src/main/kotlin/com/seugi/api/domain/chat/application/service/message/MessageServiceImpl.kt +++ b/src/main/kotlin/com/seugi/api/domain/chat/application/service/message/MessageServiceImpl.kt @@ -18,6 +18,7 @@ import com.seugi.api.domain.chat.presentation.websocket.dto.MessageEventDto import com.seugi.api.global.exception.CustomException import com.seugi.api.global.infra.fcm.FCMService import com.seugi.api.global.response.BaseResponse +import com.seugi.api.global.util.DateTimeUtil import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -112,7 +113,8 @@ class MessageServiceImpl( val timestamp = room.joinUserInfo.find { it.userId == userId }?.timestamp return messageRepository.findByChatRoomIdEqualsAndTimestampAfter( chatRoomId = room.id.toString(), - timestamp = timestamp ?: LocalDateTime.now() + timestamp = if (timestamp == DateTimeUtil.localDateTime) LocalDateTime.now() else timestamp + ?: LocalDateTime.now() ).count() }