Skip to content

Commit

Permalink
Merge pull request #37 from catchroom/develop
Browse files Browse the repository at this point in the history
Fix : ๋ฉ”์„ธ์ง€ ๋ฆฌ์ŠคํŠธ ์ตœ์‹ ์ˆœ ์ •๋ ฌ ๋กœ์ง fix
  • Loading branch information
HyemIin authored Jan 21, 2024
2 parents 231836d + 2b5bd46 commit 729d871
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

// ์ฑ„ํŒ…๋ฐฉ์„ ๊ตฌ๋…ํ•œ ํด๋ผ์ด์–ธํŠธ์—๊ฒŒ ๋ฉ”์‹œ์ง€ ๋ฐœ์†ก
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -39,9 +36,6 @@ public MessageSubDto getChatRoomListAndMessage(
chatMessageDto.setNegoPrice(-1);

List<ChatRoomListGetResponse> list = chatRoomService.getChatRoomList(accessToken);
// for (ChatRoomListGetResponse chatRoomListGetResponse : list) {
// System.out.println("time = " + chatRoomListGetResponse.getChatMessageDto().getTime());
// }

Comparator<ChatRoomListGetResponse> comparator = new Comparator<ChatRoomListGetResponse>() {
@Override
Expand Down

0 comments on commit 729d871

Please sign in to comment.