Skip to content

Commit

Permalink
Merge pull request #110 from catchroom/refactor/#98-chatroom
Browse files Browse the repository at this point in the history
Refactor : ChatRoom ๋ฆฌํŒฉํ† ๋ง
  • Loading branch information
HyemIin authored Feb 2, 2024
2 parents 9ca642d + 23e74e0 commit 9482b12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,19 @@ private void setListChatLastMessage(ChatRoomListGetResponse chatRoomListGetRespo

// ๋ชฝ๊ณ  ๋””๋น„์—์„œ ๋งˆ์ง€๋ง‰ ๋ฉ”์‹œ์ง€ ๊ฐ€์ ธ์™€์„œ ์ €์žฅ.
String chatRoomNumber = chatRoomListGetResponse.getChatRoomNumber();

//TODO ๋ ˆ๋””์Šค์— ๋งˆ์ง€๋ง‰ ๋ฉ”์„ธ์ง€๊ฐ€ ์—†์œผ๋ฉด??
if (chatRoomRedisRepository.getLastMessage(chatRoomNumber) != null) {
chatRoomListGetResponse.updateChatMessageDto(
chatRoomRedisRepository.getLastMessage(chatRoomNumber)
chatRoomRedisRepository.getLastMessage(chatRoomNumber)
);
return;
}

ChatMessage chatMessage = chatMongoService.findLatestMessageByRoomId(chatRoomNumber);
if (chatMessage != null) {
chatRoomListGetResponse.updateChatMessageDto(
} else {
ChatMessage chatMessage = chatMongoService.findLatestMessageByRoomId(chatRoomNumber);
if (chatMessage != null) {
chatRoomListGetResponse.updateChatMessageDto(
ChatMessageDto.fromEntity(chatMessage)
);
);
}
}

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
public class CorsConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
@Configuration
public class RedisConfig {

// yml ํŒŒ์ผ redis ์„ค์ • ๋ถˆ๋Ÿฌ์˜ค๊ธฐ
private final RedisProperties redisProperties;
/**
* ๋‹จ์ผ Topic ์‚ฌ์šฉ์„ ์œ„ํ•œ Bean ์„ค์ •
Expand Down

0 comments on commit 9482b12

Please sign in to comment.