diff --git a/src/main/java/com/catchroom/chat/global/pubsub/RedisSubscriber.java b/src/main/java/com/catchroom/chat/global/pubsub/RedisSubscriber.java index 02842aa..b0436ac 100644 --- a/src/main/java/com/catchroom/chat/global/pubsub/RedisSubscriber.java +++ b/src/main/java/com/catchroom/chat/global/pubsub/RedisSubscriber.java @@ -30,8 +30,6 @@ public void sendMessage(String publishMessage) { try { log.info("Redis Subcriber publishMsg: {}", publishMessage); - // ChatMessage 객채로 맵핑 -// ChatMessageDto chatMessage = objectMapper.readValue(publishMessage, ChatMessageDto.class); ChatMessageDto chatMessage = objectMapper.readValue(publishMessage, MessageSubDto.class).getChatMessageDto(); // 채팅방을 구독한 클라이언트에게 메시지 발송 @@ -52,7 +50,7 @@ public void sendRoomList(String publishMessage) { @Override public int compare(ChatRoomListGetResponse o1, ChatRoomListGetResponse o2) { if (o1.getChatMessageDto() != null && o2.getChatMessageDto() != null) { - return LocalDateTime.parse(o1.getChatMessageDto().getTime()).withNano(0).compareTo(LocalDateTime.parse(o2.getChatMessageDto().getTime()).withNano(0)); + return LocalDateTime.parse(o2.getChatMessageDto().getTime()).withNano(0).compareTo(LocalDateTime.parse(o1.getChatMessageDto().getTime()).withNano(0)); } else { return 0; } diff --git a/src/main/java/com/catchroom/chat/message/controller/ChatController.java b/src/main/java/com/catchroom/chat/message/controller/ChatController.java index 37baa6b..571ff89 100644 --- a/src/main/java/com/catchroom/chat/message/controller/ChatController.java +++ b/src/main/java/com/catchroom/chat/message/controller/ChatController.java @@ -28,7 +28,6 @@ public class ChatController { public void message(ChatMessageDto message, @Header("Authorization") String accessToken ) { - log.error("ChatController Token {}", accessToken); ChatMessageDto chatMessageDto = chatMongoService.save(message); chatService.sendChatMessage(chatMessageDto, accessToken); } diff --git a/src/main/java/com/catchroom/chat/test/MessageSortController.java b/src/main/java/com/catchroom/chat/test/MessageSortController.java index 84ed489..bb6cbfb 100644 --- a/src/main/java/com/catchroom/chat/test/MessageSortController.java +++ b/src/main/java/com/catchroom/chat/test/MessageSortController.java @@ -2,10 +2,8 @@ import com.catchroom.chat.chatroom.dto.ChatRoomListGetResponse; import com.catchroom.chat.chatroom.service.ChatRoomService; -import com.catchroom.chat.feign.service.MainFeignService; import com.catchroom.chat.message.dto.ChatMessageDto; import com.catchroom.chat.message.dto.MessageSubDto; -import com.catchroom.chat.message.entity.ChatMessage; import com.catchroom.chat.message.type.MessageType; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; @@ -14,7 +12,6 @@ import org.springframework.web.bind.annotation.RestController; import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; import java.util.Collections; import java.util.Comparator; import java.util.List; @@ -39,9 +36,6 @@ public MessageSubDto getChatRoomListAndMessage( chatMessageDto.setNegoPrice(-1); List list = chatRoomService.getChatRoomList(accessToken); -// for (ChatRoomListGetResponse chatRoomListGetResponse : list) { -// System.out.println("time = " + chatRoomListGetResponse.getChatMessageDto().getTime()); -// } Comparator comparator = new Comparator() { @Override